Ignore:
Timestamp:
2010-09-27T14:12:13+13:00 (14 years ago)
Author:
sjm84
Message:

Added the ability to change the database type between GDBM, JDBM and SQLite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r22410 r22970  
    5757public class ClassifierManager
    5858extends DOMProxyListModel {
     59
     60    private DatabaseTypeManager database_type_manager = null;
     61    private String database_type = null;
     62
    5963    /** The controls for editing the contents of this manager. */
    6064    private Control controls = null;
     
    7175        this.model = this;
    7276        DebugStream.println ("ClassifierManager: " + getSize () + " classifiers parsed.");
     77
     78    database_type_manager = new DatabaseTypeManager();
     79    database_type = database_type_manager.getDatabaseType();
    7380       
    7481        // Force the assigned classifiers to be loaded and cached now
     
    269276    private class ClassifierControl
    270277    extends JPanel
    271     implements Control {
     278    implements Control, DatabaseTypeManager.DatabaseTypeListener {
    272279        /** A combobox containing all of the known classifiers, including those that may have already been assigned. */
    273280        private JComboBox classifier_combobox = null;
     
    281288        /** Button to remove the selected classifier. */
    282289        private JButton remove = null;
     290
     291    private JPanel database_type_panel = (JPanel)database_type_manager.getControls();
    283292       
    284293        /** A list of assigned classifiers. */
     
    404413            central_pane.setBorder (BorderFactory.createEmptyBorder (5,0,0,0));
    405414            central_pane.setLayout (new BorderLayout ());
     415            central_pane.add (database_type_panel, BorderLayout.NORTH);
    406416            central_pane.add (classifier_list_pane, BorderLayout.CENTER);
    407417            central_pane.add (temp, BorderLayout.SOUTH);
     
    430440        }
    431441       
     442
     443    public void databaseTypeChanged(String new_database_type)
     444    {
     445        if(database_type.equals(new_database_type)){
     446        return;
     447        }
     448        database_type = new_database_type;
     449    }
    432450       
    433451        private class AddListener
Note: See TracChangeset for help on using the changeset viewer.