Changeset 4418


Ignore:
Timestamp:
2003-05-30T12:25:22+12:00 (21 years ago)
Author:
kjdon
Message:

the modal dialog now is one of our special ModalDialogs which only block the parent, enabling the use of help files while the dialog is open. A SimpleMenuBar with help on it has been added to the dialog.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/ExportMDSPrompt.java

    r4365 r4418  
    4545import org.greenstone.gatherer.msm.MetadataSetManager;
    4646import org.greenstone.gatherer.util.Utility;
     47import org.greenstone.gatherer.gui.SimpleMenuBar;
     48import org.greenstone.gatherer.gui.ModalDialog;
     49
    4750/** A GUI component for allowing the user to export a metadata set, based on certain conditions, and to a certain file (not necessarily a .mds file).
    4851 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5053 */
    5154final public class ExportMDSPrompt
    52     extends JDialog
     55    extends ModalDialog
    5356    implements ActionListener, KeyListener {
    5457    /** Is this an export prompt or an import one? */
     
    7780    private MetadataSetManager manager;
    7881    /** The default size for this dialog window. */
    79     final static public Dimension EXPORT_SIZE = new Dimension(500,220);
     82    final static public Dimension EXPORT_SIZE = new Dimension(500,245);
    8083    /** The default size for this dialog window. */
    81     final static public Dimension IMPORT_SIZE = new Dimension(500,120);
     84    final static public Dimension IMPORT_SIZE = new Dimension(500,145);
    8285    /** The default export action (there are several depending on how much information you wish to export). */
    8386    final static public int EXPORT = 0;
     
    8891     */
    8992    public ExportMDSPrompt(MetadataSetManager manager, boolean export) {
    90     super();
     93    super(Gatherer.g_man);
    9194    this.export = export;
    9295    // Creation
     
    9598        setSize(EXPORT_SIZE);
    9699        setTitle(get("Export_Title"));
     100        setJMenuBar(new SimpleMenuBar("0")); // need to find an appropriate help page to open at
    97101    }
    98102    else {
    99103        setSize(IMPORT_SIZE);
    100104        setTitle(get("Import_Title"));
     105        setJMenuBar(new SimpleMenuBar("0")); // need to find an appropriate help page to open at
    101106    }
    102107    JPanel content_pane = (JPanel) getContentPane();
     
    206211      */
    207212    public int display() {
    208     show();
     213    setVisible(true);
    209214    return action;
    210215    }
  • trunk/gli/src/org/greenstone/gatherer/sarm/SearchAndReplace.java

    r4364 r4418  
    5555import org.greenstone.gatherer.valuetree.GValueModel;
    5656import org.greenstone.gatherer.valuetree.GValueNode;
     57import org.greenstone.gatherer.gui.SimpleMenuBar;
     58import org.greenstone.gatherer.gui.ModalDialog;
    5759/** Provides a convenient class which searches through all of the various data attached to a collection, globally searching and replacing values as necessary, and firing the relevant events to have the gui update properly.
    5860 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    6062 */
    6163public class SearchAndReplace
    62     extends JDialog {
     64    extends ModalDialog {
    6365    /** <i>true</i> if this dialog should allow for the replace and replace all buttons to be validated, <i>false</i> otherwise. */
    6466    private boolean enable_replace = false;
     
    124126    static final private Dimension LABEL_SIZE = new Dimension(120, 30);
    125127    /** The default size for the dialog. */
    126     static final private Dimension SIZE = new Dimension(640,210);
     128    static final private Dimension SIZE = new Dimension(640,235);
    127129    /** Constructor.
    128130     * @param enable_replace <i>true</i> if this dialog can be used for replace actions, <i>false</i> otherwise.
    129131      */
    130132    public SearchAndReplace(boolean enable_replace) {
    131     super();
     133    super(Gatherer.g_man);
    132134    ///ystem.err.println("Creating a new search and replace dialog.");
    133135    this.enable_replace = enable_replace;
     
    137139    setSize(SIZE);
    138140    setTitle(get("Title"));
     141    setJMenuBar(new SimpleMenuBar("10.1")); 
    139142    JPanel content_pane = (JPanel) getContentPane();
    140143
     
    278281    // Restore visual position.
    279282    setLocation((screen_size.width - SIZE.width) / 2, (screen_size.height - SIZE.height) / 2);
    280     show();
     283    setVisible(true);
    281284    }
    282285    /** Updates the status bar to reflect the result of the latest action. Includes the ability to reset the status label whenever the find() state resets.
Note: See TracChangeset for help on using the changeset viewer.