Changeset 5063 in josm for trunk/src/org


Ignore:
Timestamp:
2012-03-09T22:18:05+01:00 (13 years ago)
Author:
simon04
Message:

see #7230 - improve alternative search dialog (adapt insert text, hand cursor if text can be inserted, differentiate labels from the rest)

File:
1 edited

Legend:

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

    r4982 r5063  
    66import static org.openstreetmap.josm.tools.I18n.trc;
    77
     8import java.awt.Cursor;
    89import java.awt.Dimension;
    910import java.awt.FlowLayout;
     
    176177
    177178        public SearchKeywordRow addKeyword(String displayText, final String insertText, String description, String... examples) {
    178             JLabel label = new JLabel("<html><style>td{border:1px solid gray;}</style><table><tr><td>" + displayText + "</td></tr></table></html>");
     179            JLabel label = new JLabel("<html>"
     180                    + "<style>td{border:1px solid gray; font-weight:normal;}</style>"
     181                    + "<table><tr><td>" + displayText + "</td></tr></table></html>");
    179182            add(label);
    180183            if (description != null || examples.length > 0) {
     
    185188            }
    186189            if (insertText != null) {
     190                label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    187191                label.addMouseListener(new MouseAdapter() {
    188192
     
    375379        right.add(new SearchKeywordRow(hcbSearchString)
    376380                .addTitle(tr("basic examples"))
    377                 .addKeyword(tr("Baker Street"), tr("Baker Street"), tr("''Baker'' and ''Street'' in any key"))
    378                 .addKeyword(tr("\"Baker Street\""), tr("\"Baker Street\""), tr("''Baker Street'' in any key"))
     381                .addKeyword(tr("Baker Street"), null, tr("''Baker'' and ''Street'' in any key"))
     382                .addKeyword(tr("\"Baker Street\""), "\"\"", tr("''Baker Street'' in any key"))
    379383                , GBC.eol());
    380384        right.add(new SearchKeywordRow(hcbSearchString)
     
    393397                .addKeyword("<i>expr</i> OR <i>expr</i>", "OR ", tr("logical or (at least one expression has to be satisfied)"))
    394398                .addKeyword("-<i>expr</i>", null, tr("logical not"))
    395                 .addKeyword("(<i>expr</i>)", null, tr("use parenthesis to group expressions"))
    396                 .addKeyword("\"key\"=\"value\"", null, tr("to quote operators.<br>Within quoted strings the <b>\"</b> and <b>\\</b> characters need to be escaped by a preceding <b>\\</b> (e.g. <b>\\\"</b> and <b>\\\\</b>)."), "\"addr:street\"")
     399                .addKeyword("(<i>expr</i>)", "()", tr("use parenthesis to group expressions"))
     400                .addKeyword("\"key\"=\"value\"", "\"\"=\"\"", tr("to quote operators.<br>Within quoted strings the <b>\"</b> and <b>\\</b> characters need to be escaped by a preceding <b>\\</b> (e.g. <b>\\\"</b> and <b>\\\\</b>)."), "\"addr:street\"")
    397401                , GBC.eol());
    398402
Note: See TracChangeset for help on using the changeset viewer.