Changeset 5102
- Timestamp:
- 2003-08-06T17:32:28+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/valuetree/GValueTree.java
r4803 r5102 93 93 value.setPreferredSize(new Dimension(413, 24)); 94 94 value.getDocument().addDocumentListener(new DocumentListenerImpl()); 95 value.addActionListener(new MetadataFieldListener()); 95 96 96 97 JPanel button_pane = new JPanel(); … … 217 218 public void valueChanged(TreeSelectionEvent event) 218 219 { 219 if (tree.getSelectionCount() != 0 && !ignore_tree_selection_event) {220 if (tree.getSelectionCount() != 0 && !ignore_tree_selection_event) { 220 221 TreePath path = tree.getSelectionPath(); 221 222 GValueNode node = (GValueNode) path.getLastPathComponent(); … … 245 246 246 247 private String get(String key, String args[]) { 247 if (key.indexOf('.') == -1) {248 if (key.indexOf('.') == -1) { 248 249 key = "MetaEdit." + key; 249 250 } … … 312 313 313 314 315 private class MetadataFieldListener 316 implements ActionListener { 317 /** Gives notification of the Enter key being pressed on the text field */ 318 public void actionPerformed(ActionEvent e) { 319 if (tree.getSelectionCount() != 0 && !value.getText().equals("")) { 320 TreePath path = tree.getSelectionPath(); 321 GValueNode node = (GValueNode) path.getLastPathComponent(); 322 value.setText(Utility.stripNL(node.getFullPath())); 323 } 324 } 325 } 326 327 314 328 private class DocumentListenerImpl 315 329 implements DocumentListener {
Note:
See TracChangeset
for help on using the changeset viewer.