Changeset 4427


Ignore:
Timestamp:
2003-05-30T14:06:18+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/gui
Files:
4 edited

Legend:

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

    r4367 r4427  
    4040import javax.swing.*;
    4141import org.greenstone.gatherer.Gatherer;
     42import org.greenstone.gatherer.gui.SimpleMenuBar;
     43import org.greenstone.gatherer.gui.ModalDialog;
     44
    4245/** A class that extends a JDialog into a editor for editing large block of text for the metadata value.
    4346 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4548 */
    4649final public class EditorDialog
    47     extends JDialog
     50    extends ModalDialog
    4851    implements ActionListener {
    4952    /** The cancel, and I don't want the text I've typed, button. */
     
    5659    private String result = null;
    5760    /** The size of the edit pop-up. */
    58     final static private Dimension SIZE = new Dimension(400,400);
     61    final static private Dimension SIZE = new Dimension(400,425);
    5962    /** Constructor.*/
    6063    public EditorDialog() {
     64    super(Gatherer.g_man);
     65   
    6166    }
    6267    /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we generate a pop-up window to edit in.
     
    7782    setSize(SIZE);
    7883    setTitle(Gatherer.dictionary.get("General.Edit"));
     84    setJMenuBar(new SimpleMenuBar("6.1"));
    7985    // Create
    8086    cancel = new JButton(Gatherer.dictionary.get("General.Cancel"));
     
    101107    Dimension screen_size = Gatherer.config.screen_size;
    102108    setLocation((screen_size.width - SIZE.width) / 2, (screen_size.height - SIZE.height) / 2);
    103     show();
     109    setVisible(true);
    104110    return result;
    105111    }
  • trunk/gli/src/org/greenstone/gatherer/gui/FileAssociationDialog.java

    r4367 r4427  
    4646import org.greenstone.gatherer.util.Utility;
    4747import org.outerj.pollo.util.*;
     48import org.greenstone.gatherer.gui.SimpleMenuBar;
     49import org.greenstone.gatherer.gui.ModalDialog;
     50
    4851/** The file association allows the entry of new file associations and the modification of existing ones. This is done via a list of known extensions, and two fields to fill out relevant details.
    4952 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5154 */
    5255public class FileAssociationDialog
    53     extends JDialog {
     56    extends ModalDialog {
    5457    /** <i>true</i> iff this addition action been cancelled by the user. */
    5558    private boolean cancelled = false;
     
    7780    static final private Dimension LABEL_SIZE = new Dimension(150, 25);
    7881    /** The default size for the dialog. */
    79     static final private Dimension SIZE = new Dimension(600, 150);
     82    static final private Dimension SIZE = new Dimension(600, 175);
    8083    /** Create a new file association dialog.
    8184     * @param manager A reference to the <strong>FileAssociationManager</strong> so we can determine what extensions are already associated.
     
    9295    setSize(SIZE);
    9396    setTitle(get("Title"));
     97    setJMenuBar(new SimpleMenuBar("0"));// need to find an appropriate help page
    9498    JPanel content_pane = (JPanel) getContentPane();
    9599    content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    181185
    182186    }
    183     show();
     187    setVisible(true);
    184188    if(save_required) {
    185189        manager.setCommand((String)extension.getSelectedItem(), (String)command.getText());
  • trunk/gli/src/org/greenstone/gatherer/gui/LockFileDialog.java

    r4367 r4427  
    1010import org.greenstone.gatherer.msm.MSMUtils;
    1111import org.greenstone.gatherer.util.Utility;
     12import org.greenstone.gatherer.gui.SimpleMenuBar;
     13import org.greenstone.gatherer.gui.ModalDialog;
    1214import org.w3c.dom.*;
    1315
    1416public class LockFileDialog
    15     extends JDialog {
     17    extends ModalDialog {
    1618
    1719    private int choice;
     
    2527
    2628    static final private Dimension LABEL_SIZE = new Dimension(100, 25);
    27     static final private Dimension SIZE = new Dimension(500, 225);
     29    static final private Dimension SIZE = new Dimension(500, 250);
    2830    static final private int ICON_SIZE = 30;
    2931
     
    3133    super(parent, get("Title"), true);
    3234    setSize(SIZE);
     35    setJMenuBar(new SimpleMenuBar("2.3"));
    3336    this.self = this;
    3437    // Parse the lock file, but do so quietly so that if the XML is poorly formed it doesn't show exception.
     
    122125
    123126    public int getChoice() {
    124     show();
     127    setVisible(true);
    125128    return choice;
    126129    }
     
    151154        choice = NO_OPTION;
    152155        }
    153         self.hide();
     156        self.setVisible(false);
    154157        self.dispose();
    155158    }
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPrompt.java

    r4367 r4427  
    3434import org.greenstone.gatherer.gui.TextFieldLabel;
    3535import org.greenstone.gatherer.util.Utility;
     36import org.greenstone.gatherer.gui.SimpleMenuBar;
     37import org.greenstone.gatherer.gui.ModalDialog;
     38
    3639/** Displays a dynamic prompt to allow the user to choose how metadata is to be added, updated or removed from target FileNodes. The prompt changes depending on the action requested, the file nodes encountered and the number of file nodes in the selection. */
    3740public class MetaEditPrompt
    38     extends JDialog
     41    extends ModalDialog
    3942    implements ActionListener {
    4043
     
    5154    private JButton update_all;
    5255    static private Dimension LABEL_SIZE = new Dimension(100, 25);
    53     static private Dimension SIZE = new Dimension(400, 280);
     56    static private Dimension SIZE = new Dimension(400, 305);
    5457    // Generic prompt values.
    5558    static public int CONFIRM         =  0;
     
    7679    this.setSize(SIZE);
    7780    this.setTitle(get("MetaEditPrompt.Title"));
    78 
     81    this.setJMenuBar(new SimpleMenuBar("6.3"));
    7982    // Creation
    8083    JPanel content_pane = (JPanel)this.getContentPane();
     
    213216
    214217    public int display() {
    215     show();
     218    setVisible(true);
    216219    return value;
    217220    }
Note: See TracChangeset for help on using the changeset viewer.