Ticket #1878: search.patch

File search.patch, 3.6 KB (added by stoecker, 17 years ago)
  • D:\hps\josm\trunk\src\org\openstreetmap\josm\actions\search\SearchAction.java

    old new  
    5454    public void showSearchDialog(SearchSetting initialValues) {
    5555        JLabel label = new JLabel(tr("Please enter a search string."));
    5656        final JTextField input = new JTextField(initialValues.text);
    57         input.setToolTipText(tr("<html>Fulltext search:<ul>"
     57        JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace);
     58        JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add);
     59        JRadioButton remove = new JRadioButton(tr("remove from selection"), initialValues.mode == SearchMode.remove);
     60        ButtonGroup bg = new ButtonGroup();
     61        bg.add(replace);
     62        bg.add(add);
     63        bg.add(remove);
     64
     65        JCheckBox caseSensitive = new JCheckBox(tr("case sensitive"), initialValues.caseSensitive);
     66        JCheckBox regexSearch   = new JCheckBox(tr("regular expression"), initialValues.regexSearch);
     67
     68        JPanel left = new JPanel(new GridBagLayout());
     69        left.add(label, GBC.eop());
     70        left.add(input, GBC.eop().fill(GBC.HORIZONTAL));
     71        left.add(replace, GBC.eol());
     72        left.add(add, GBC.eol());
     73        left.add(remove, GBC.eop());
     74        left.add(caseSensitive, GBC.eol());
     75        left.add(regexSearch, GBC.eol());
     76       
     77        JPanel right = new JPanel();
     78        right.add(new JLabel(tr("<html><ul>"
    5879                + "<li><b>Baker Street</b> - 'Baker' and 'Street' in any key or name.</li>"
    5980                + "<li><b>\"Baker Street\"</b> - 'Baker Street' in any key or name.</li>"
    6081                + "<li><b>name:Bak</b> - 'Bak' anywhere in the name.</li>"
     
    6990                + "<li><b>incomplete</b> - all incomplete objects</li>"
    7091                + "<li>Use <b>|</b> or <b>OR</b> to combine with logical or</li>"
    7192                + "<li>Use <b>\"</b> to quote operators (e.g. if key contains :)</li>"
    72                 + "<li>Use <b>(</b> and <b>)</b> to group expressions</li>" + "</ul></html>"));
    73 
    74         JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace);
    75         JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add);
    76         JRadioButton remove = new JRadioButton(tr("remove from selection"), initialValues.mode == SearchMode.remove);
    77         ButtonGroup bg = new ButtonGroup();
    78         bg.add(replace);
    79         bg.add(add);
    80         bg.add(remove);
    81 
    82         JCheckBox caseSensitive = new JCheckBox(tr("case sensitive"), initialValues.caseSensitive);
    83         JCheckBox regexSearch   = new JCheckBox(tr("regular expression"), initialValues.regexSearch);
    84 
    85         JPanel p = new JPanel(new GridBagLayout());
    86         p.add(label, GBC.eop());
    87         p.add(input, GBC.eop().fill(GBC.HORIZONTAL));
    88         p.add(replace, GBC.eol());
    89         p.add(add, GBC.eol());
    90         p.add(remove, GBC.eop());
    91         p.add(caseSensitive, GBC.eol());
    92         p.add(regexSearch, GBC.eol());
     93                + "<li>Use <b>(</b> and <b>)</b> to group expressions</li>" + "</ul></html>")));
     94       
     95        final JPanel p = new JPanel();
     96        p.add(left);
     97        p.add(right);
     98       
    9399        JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) {
    94100            @Override
    95101            public void selectInitialValue() {