Ignore:
Timestamp:
2009-02-14T12:25:54+01:00 (15 years ago)
Author:
stoecker
Message:

apply patches from xeen for #1977.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r1375 r1397  
    2121import org.openstreetmap.josm.actions.JosmAction;
    2222import org.openstreetmap.josm.data.osm.OsmPrimitive;
     23import org.openstreetmap.josm.gui.ExtendedDialog;
    2324import org.openstreetmap.josm.tools.GBC;
    2425import org.openstreetmap.josm.tools.Shortcut;
     
    5556        JLabel label = new JLabel(tr("Please enter a search string."));
    5657        final JTextField input = new JTextField(initialValues.text);
     58        input.selectAll();
     59        input.requestFocusInWindow();
    5760        JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace);
    5861        JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add);
     
    99102        p.add(left);
    100103        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
    112112        // User pressed OK - let's perform the search
    113113        SearchMode mode = replace.isSelected() ? SearchAction.SearchMode.replace
Note: See TracChangeset for help on using the changeset viewer.