//
// $Id: BrowsePanel.java,v 1.2 2002/02/22 07:06:33 mdb Exp $

package robodj.chooser;

import javax.swing.*;

import robodj.repository.*;

public class BrowsePanel extends JTabbedPane
{
    public BrowsePanel ()
    {
        EntryList elist;
        Category[] cats = Chooser.model.getCategories();

        // create a tab for each category
        for (int i = 0; i < cats.length; i++) {
            elist = new CategoryEntryList(cats[i].categoryid);
            String tip = "Browse entries in '" + cats[i].name + "' category.";
            addTab(cats[i].name, null, elist, tip);
        }

        // and add one for uncategorized entries
        elist = new CategoryEntryList(-1);
        addTab("Uncategorized", null, elist,
               "Browse uncategorized entries.");

        setSelectedIndex(0);
    }
}

//
// $Id: BrowsePanel.java,v 1.3 2002/11/11 17:04:12 mdb Exp $

package robodj.chooser;

import javax.swing.*;

import robodj.repository.*;

public class BrowsePanel extends JTabbedPane
{
    public BrowsePanel ()
    {
        EntryList elist;
        Category[] cats = Chooser.model.getCategories();

        // stick our tabs along the side and scroll if they don't fit
        setTabPlacement(LEFT);
        setTabLayoutPolicy(SCROLL_TAB_LAYOUT);

        // create a tab for each category
        for (int i = 0; i < cats.length; i++) {
            elist = new CategoryEntryList(cats[i].categoryid);
            String tip = "Browse entries in '" + cats[i].name + "' category.";
            addTab(cats[i].name, null, elist, tip);
        }

        // and add one for uncategorized entries
        elist = new CategoryEntryList(-1);
        addTab("Uncategorized", null, elist,
               "Browse uncategorized entries.");

        setSelectedIndex(0);
    }
}

Put the category tabs on the left and scroll them if they are too many.
Put the category tabs on the left and scroll them if they are too many.


git-svn-id: 64ebf368729f38804935acb7146e017e0f909c6b@907 6335cc39-0255-0410-8fd6-9bcaacd3b74c
