- Timestamp:
- 2003-10-03T14:07:35+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/EditorDialog.java
r5527 r5564 1 package org.greenstone.gatherer.gui;2 1 /** 3 2 *######################################################################### … … 36 35 *######################################################################## 37 36 */ 37 package org.greenstone.gatherer.gui; 38 38 39 import java.awt.*; 39 40 import java.awt.event.*; 40 41 import javax.swing.*; 42 import org.greenstone.gatherer.Dictionary; 41 43 import org.greenstone.gatherer.Gatherer; 42 44 import org.greenstone.gatherer.gui.SimpleMenuBar; … … 60 62 /** The size of the edit pop-up. */ 61 63 final static private Dimension SIZE = new Dimension(400,425); 62 /** Constructor.*/ 64 65 /** Constructor */ 63 66 public EditorDialog() { 64 67 super(Gatherer.g_man); 65 66 68 } 69 67 70 /** 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. 68 69 71 * @param event An <strong>ActionEvent</strong> containing information about the event. 72 */ 70 73 public void actionPerformed(ActionEvent event) { 71 if (event.getSource() == ok) {74 if (event.getSource() == ok) { 72 75 result = text.getText(); 73 76 } 74 77 dispose(); 75 78 } 79 76 80 /** Method to display the editing box on screen. 77 78 79 81 * @param value The initial text to be displayed in the editing area, as a <strong>String</strong>. 82 * @return The new value for the metadata value as a <strong>String</strong> or <i>null</i> if the user has pressed cancel. 83 */ 80 84 public String display(String value) { 81 85 setModal(true); 82 86 setSize(SIZE); 83 setTitle(Gatherer.dictionary.get("General.Edit"));84 87 setJMenuBar(new SimpleMenuBar("theenrichview")); 88 Dictionary.setText(this, "General.Edit"); 89 85 90 // Create 86 cancel = new JButton(Gatherer.dictionary.get("General.Cancel"));87 ok = new JButton(Gatherer.dictionary.get("General.OK"));88 91 text = new JTextArea(value); 89 92 text.setCaretPosition(value.length()); … … 91 94 text.setLineWrap(true); 92 95 text.setWrapStyleWord(true); 96 Dictionary.setTooltip(text, "MetaEdit.Value_Field_Tooltip"); 97 98 cancel = new JButton(); 99 cancel.setMnemonic(KeyEvent.VK_C); 100 Dictionary.setBoth(cancel, "General.Cancel", "General.Pure_Cancel_Tooltip"); 101 ok = new JButton(); 102 ok.setMnemonic(KeyEvent.VK_0); 103 Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip"); 104 93 105 // Listeners 94 106 cancel.addActionListener(this); 95 107 ok.addActionListener(this); 108 96 109 // Layout 97 110 JPanel button_pane = new JPanel();
Note:
See TracChangeset
for help on using the changeset viewer.