Changeset 3030 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-02-21T09:34:24+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
r2923 r3030 13 13 import javax.swing.JLabel; 14 14 import javax.swing.JPanel; 15 import javax.swing.KeyStroke; 15 16 16 17 import org.openstreetmap.josm.Main; … … 62 63 OsmIdTextField tfId = new OsmIdTextField(); 63 64 tfId.setToolTipText(tr("Enter the ID of the object that should be downloaded")); 65 // forward the enter key stroke to the download button 66 tfId.getKeymap().removeKeyStrokeBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false)); 64 67 gc.weightx = 1; 65 68 all.add(tfId, gc); … … 81 84 tr("Close dialog and cancel downloading") 82 85 }); 86 dialog.setDefaultButton(1); 83 87 dialog.configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */); 84 88 dialog.showDialog(); -
trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
r2801 r3030 84 84 */ 85 85 public AbstractTextComponentValidator(JTextComponent tc) throws IllegalArgumentException { 86 this(tc, true); 87 } 88 89 /** 90 * Alternative constructor that allows to turn off the actionListener. 91 * This can be useful if the enter key stroke needs to be forwarded to the default button in a dialog. 92 */ 93 public AbstractTextComponentValidator(JTextComponent tc, boolean addActionListener) throws IllegalArgumentException { 86 94 CheckParameterUtil.ensureParameterNotNull(tc, "tc"); 87 95 this.tc = tc; 88 96 tc.addFocusListener(this); 89 97 tc.getDocument().addDocumentListener(this); 90 if (tc instanceof JTextField) { 91 JTextField tf = (JTextField)tc; 92 tf.addActionListener(this); 98 if (addActionListener) { 99 if (tc instanceof JTextField) { 100 JTextField tf = (JTextField)tc; 101 tf.addActionListener(this); 102 } 93 103 } 94 104 tc.addPropertyChangeListener("enabled", this); -
trunk/src/org/openstreetmap/josm/gui/widgets/OsmIdTextField.java
r2923 r3030 33 33 34 34 public OsmIdValidator(JTextComponent tc) { 35 super(tc );35 super(tc, false); 36 36 } 37 37
Note:
See TracChangeset
for help on using the changeset viewer.