Changeset 1397 in josm for trunk/src/org/openstreetmap/josm/actions/search
- Timestamp:
- 2009-02-14T12:25:54+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r1375 r1397 21 21 import org.openstreetmap.josm.actions.JosmAction; 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 import org.openstreetmap.josm.gui.ExtendedDialog; 23 24 import org.openstreetmap.josm.tools.GBC; 24 25 import org.openstreetmap.josm.tools.Shortcut; … … 55 56 JLabel label = new JLabel(tr("Please enter a search string.")); 56 57 final JTextField input = new JTextField(initialValues.text); 58 input.selectAll(); 59 input.requestFocusInWindow(); 57 60 JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace); 58 61 JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add); … … 99 102 p.add(left); 100 103 p.add(right); 101 102 JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) { 103 @Override 104 public void selectInitialValue() { 105 input.requestFocusInWindow(); 106 input.selectAll(); 107 } 108 }; 109 pane.createDialog(Main.parent, tr("Search")).setVisible(true); 110 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) 111 return; 104 105 int result = new ExtendedDialog(Main.parent, 106 tr("Search"), 107 p, 108 new String[] {tr("Start Search"), tr("Cancel")}, 109 new String[] {"dialogs/search.png", "cancel.png"}).getValue(); 110 if(result != 1) return; 111 112 112 // User pressed OK - let's perform the search 113 113 SearchMode mode = replace.isSelected() ? SearchAction.SearchMode.replace
Note:
See TracChangeset
for help on using the changeset viewer.