Changeset 5718
- Timestamp:
- 2003-10-23T11:00:44+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/EditorDialog.java
r5564 r5718 52 52 extends ModalDialog 53 53 implements ActionListener { 54 /** The cancel, and I don't want the text I've typed, button. */ 54 /** Is this dialog editable? */ 55 private boolean editable = true; 56 /** The cancel, and I don't want the text I've typed, button. */ 55 57 private JButton cancel = null; 56 58 /** The ok, I'll save what I've just typed in, button. */ … … 91 93 text = new JTextArea(value); 92 94 text.setCaretPosition(value.length()); 93 text.setEditable( true);95 text.setEditable(editable); 94 96 text.setLineWrap(true); 95 text.setWrapStyleWord( true);97 text.setWrapStyleWord(false); 96 98 Dictionary.setTooltip(text, "MetaEdit.Value_Field_Tooltip"); 97 99 … … 100 102 Dictionary.setBoth(cancel, "General.Cancel", "General.Pure_Cancel_Tooltip"); 101 103 ok = new JButton(); 102 ok.setMnemonic(KeyEvent.VK_ 0);104 ok.setMnemonic(KeyEvent.VK_O); 103 105 Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip"); 104 106 … … 110 112 JPanel button_pane = new JPanel(); 111 113 button_pane.setLayout(new GridLayout(1,2)); 112 button_pane.add(ok); 113 button_pane.add(cancel); 114 if(editable) { 115 button_pane.add(ok); 116 button_pane.add(cancel); 117 } 118 else { 119 button_pane.add(new JPanel()); 120 button_pane.add(ok); 121 } 114 122 115 123 JPanel content_pane = (JPanel) getContentPane(); … … 123 131 return result; 124 132 } 133 134 /** Specify if this text dialog should be editable or readonly 135 * @param editable true to allow editing, false otherwise 136 */ 137 public void setEditable(boolean editable) { 138 if(text == null) { 139 this.editable = editable; 140 } 141 else { 142 text.setEditable(editable); 143 } 144 } 125 145 }
Note:
See TracChangeset
for help on using the changeset viewer.