Changeset 12064


Ignore:
Timestamp:
2006-07-07T11:20:35+12:00 (18 years ago)
Author:
kjdon
Message:

added in the format pane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r11992 r12064  
    7474    /** The enrich pane is used to assign, edit and remove metadata from files within the collection. */
    7575    public EnrichPane enrich_pane = null;
    76     /** The design pane allows you to edit the design of the library in terms of the collection configuration file. */
     76    /** The design pane allows you to edit the design of the library in terms of the collection configuration file. - the stuff that requires rebuilding */
    7777    public DesignPane design_pane = null;
    7878    /** The create pane contains scripting options for importing and building collections into libraries. */
    7979    public CreatePane create_pane = null;
    80 
     80    /** The format pane allows you to edit the design of the library in terms of the collection configuration file. - the stuff that doesn't require rebuilding */
     81    public FormatPane format_pane = null;
     82   
    8183    public FileOpenActionListener foa_listener = new FileOpenActionListener();
    8284
     
    135137 
    136138
    137          public void windowGainedFocus(WindowEvent e) {
    138          //System.out.println("JPanel windowGainedFocus.");
     139    public void windowGainedFocus(WindowEvent e) {
     140    //System.out.println("JPanel windowGainedFocus.");
    139141    }
    140142
     
    142144        //System.out.println("JPanel windowLostFocus.");
    143145
    144     Gatherer.g_man.design_pane.saveConfiguration();
     146    if (Gatherer.c_man.getCollection()!=null) {
     147        Gatherer.c_man.getCollection().cdm.save();
     148    }
     149    //Gatherer.g_man.design_pane.saveConfiguration();
    145150   
    146151    }
     
    395400        }
    396401
     402        format_pane = new FormatPane();
     403        format_pane.display();
     404        if (Configuration.get("workflow.format", true)) {
     405        tab_pane.addTab("GUI.Format", JarTools.getImage("format.gif"), format_pane);
     406        tab_pane.setEnabledAt(tab_pane.indexOfComponent(format_pane), false);
     407        }
     408       
    397409        // The MetaAuditFrame must be created after the gather/enrich panes but before they get focus
    398410        meta_audit = new MetaAuditFrame();
     
    520532        create_pane.modeChanged(mode);
    521533    }
     534    if (format_pane != null) {
     535        format_pane.modeChanged(mode);
     536    }
    522537    }
    523538
     
    552567    if (create_pane != null) {
    553568        create_pane.refresh(refresh_reason, collection_loaded);
     569    }
     570    if (format_pane != null) {
     571        format_pane.refresh(refresh_reason, collection_loaded);
    554572    }
    555573
     
    601619        // Some tabs are also dependant on if a collection is ready
    602620        Component component = tab_pane.getComponentAt(index);
    603         if(component == enrich_pane || component == design_pane || component == create_pane) {
     621        if(component == enrich_pane || component == design_pane || component == create_pane || component == format_pane) {
    604622        tab_pane.setEnabledAt(index, state && Gatherer.c_man != null && Gatherer.c_man.ready());
    605623        }
     
    788806    public void stateChanged(ChangeEvent event)
    789807    {
    790     // Tell the previous pane that it has lost focus
    791808    if (previous_pane != null) {
    792809        if (previous_pane == gather_pane) {
     
    801818        else if (previous_pane == create_pane) {
    802819        create_pane.loseFocus();
     820        }
     821        else if (previous_pane == format_pane) {
     822        format_pane.loseFocus();
    803823        }
    804824    }
     
    821841        create_pane.gainFocus();
    822842    }
     843    else if (selected_index == tab_pane.indexOfComponent(format_pane)) {
     844        format_pane.gainFocus();
     845    }
    823846
    824847    previous_pane = (JPanel) tab_pane.getSelectedComponent();
     848   
    825849    }
    826850
     
    838862    workflowUpdate("Design", Configuration.get("workflow.design", false));
    839863    workflowUpdate("Create", Configuration.get("workflow.create", false));
     864    workflowUpdate("Format", Configuration.get("workflow.format", false));
    840865    }
    841866
     
    907932    private int design_pos = -1;
    908933    private int create_pos = -1;
     934    private int format_pos = -1;
    909935    private int export_pos = -1;
    910936    private JTabbedPane tab_pane = null;
     
    917943        design_pos = tab_pane.indexOfComponent(design_pane);
    918944        create_pos = tab_pane.indexOfComponent(create_pane);
     945        format_pos = tab_pane.indexOfComponent(format_pane);
    919946    }
    920947
     
    937964        if (create_pos != -1) {
    938965        tab_pane.setEnabledAt(create_pos, ready && Configuration.get("workflow.create", false));
     966        }
     967        if (format_pos != -1) {
     968        tab_pane.setEnabledAt(format_pos, ready && Configuration.get("workflow.format", false));
    939969        }
    940970    }
Note: See TracChangeset for help on using the changeset viewer.