| 208 | | JPanel right = new JPanel(); |
| 209 | | DescriptionTextBuilder descriptionText = new DescriptionTextBuilder(); |
| 210 | | descriptionText.append("<html><style>li.header{font-size:110%; list-style-type:none; margin-top:5px;}</style><ul>"); |
| 211 | | descriptionText.appendItem(tr("<b>Baker Street</b> - ''Baker'' and ''Street'' in any key")); |
| 212 | | descriptionText.appendItem(tr("<b>\"Baker Street\"</b> - ''Baker Street'' in any key")); |
| 213 | | descriptionText.appendItem(tr("<b>key:Bak</b> - ''Bak'' anywhere in the key ''key''")); |
| 214 | | descriptionText.appendItem(tr("<b>-key:Bak</b> - ''Bak'' nowhere in the key ''key''")); |
| 215 | | descriptionText.appendItem(tr("<b>key=value</b> - key ''key'' with value exactly ''value''")); |
| 216 | | descriptionText.appendItem(tr("<b>key=*</b> - key ''key'' with any value. Try also <b>*=value</b>, <b>key=</b>, <b>*=*</b>, <b>*=</b>")); |
| 217 | | descriptionText.appendItem(tr("<b>key:</b> - key ''key'' set to any value")); |
| 218 | | descriptionText.appendItem(tr("<b>key?</b> - key ''key'' with the value ''yes'', ''true'', ''1'' or ''on''")); |
| 219 | | if(Main.pref.getBoolean("expert", false)) |
| 220 | | { |
| 221 | | descriptionText.appendItemHeader(tr("Special targets")); |
| 222 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>type:</b>... - objects with corresponding type (<b>node</b>, <b>way</b>, <b>relation</b>)")); |
| 223 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>user:</b>... - objects changed by user")); |
| 224 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>user:anonymous</b> - objects changed by anonymous users")); |
| 225 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>id:</b>... - objects with given ID (0 for new objects)")); |
| 226 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>version:</b>... - objects with given version (0 objects without an assigned version)")); |
| 227 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>changeset:</b>... - objects with given changeset ID (0 objects without an assigned changeset)")); |
| 228 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>nodes:</b>... - objects with given number of nodes (<b>nodes:</b>count, <b>nodes:</b>min-max, <b>nodes:</b>min- or <b>nodes:</b>-max)")); |
| 229 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>tags:</b>... - objects with given number of tags (<b>tags:</b>count, <b>tags:</b>min-max, <b>tags:</b>min- or <b>tags:</b>-max)")); |
| 230 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>role:</b>... - objects with given role in a relation")); |
| 231 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>timestamp:</b>timestamp - objects with this last modification timestamp (2009-11-12T14:51:09Z, 2009-11-12 or T14:51 ...)")); |
| 232 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>timestamp:</b>min/max - objects with last modification within range")); |
| 233 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>areasize:</b>... - closed ways with given area in m\u00b2 (<b>areasize:</b>min-max or <b>areasize:</b>max)")); |
| 234 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>modified</b> - all changed objects")); |
| 235 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>selected</b> - all selected objects")); |
| 236 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>incomplete</b> - all incomplete objects")); |
| 237 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>untagged</b> - all untagged objects")); |
| 238 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>closed</b> - all closed ways (a node is not considered closed)")); |
| 239 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>child <i>expr</i></b> - all children of objects matching the expression")); |
| 240 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>parent <i>expr</i></b> - all parents of objects matching the expression")); |
| 241 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>(all)indownloadedarea</b> - objects (and all its way nodes / relation members) in downloaded area")); |
| 242 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>(all)inview</b> - objects (and all its way nodes / relation members) in current view")); |
| 243 | | } |
| 244 | | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("Use <b>|</b> or <b>OR</b> to combine with logical or")); |
| 245 | | descriptionText.appendItem(tr("Use <b>\"</b> to quote operators (e.g. if key contains <b>:</b>)") |
| 246 | | + "<br/>" |
| 247 | | + tr("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>).")); |
| 248 | | descriptionText.appendItem(tr("Use <b>(</b> and <b>)</b> to group expressions")); |
| 249 | | descriptionText.append("</ul></html>"); |
| 250 | | JLabel description = new JLabel(descriptionText.toString()); |
| 251 | | description.setFont(description.getFont().deriveFont(Font.PLAIN)); |
| 252 | | right.add(description); |
| | 250 | JPanel right = new JPanel(new GridBagLayout()); |
| | 251 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 252 | .addTitle(tr("basic examples")) |
| | 253 | .addKeyword("Baker Street", "Baker Street", tr("''Baker'' and ''Street'' in any key")) |
| | 254 | .addKeyword("\"Baker Street\"", "\"Baker Street\"", tr("''Baker Street'' in any key")) |
| | 255 | , GBC.eol()); |
| | 256 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 257 | .addTitle(tr("basics")) |
| | 258 | .addKeyword("<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' anywhere in ''key''")) |
| | 259 | .addKeyword("-<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' nowhere in ''key''")) |
| | 260 | .addKeyword("<i>key</i>=<i>value</i>", null, tr("''key'' with exactly ''value''")) |
| | 261 | .addKeyword("<i>key</i>=*", null, tr("''key'' with any value")) |
| | 262 | .addKeyword("*=<i>value</i>", null, tr("''value'' in any key")) |
| | 263 | .addKeyword("<i>key</i>=", null, null) |
| | 264 | , GBC.eol()); |
| | 265 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 266 | .addTitle(tr("combinators")) |
| | 267 | .addKeyword("<i>expr</i> <i>expr</i>", null, tr("logical and (both expressions have to be satisfied)")) |
| | 268 | .addKeyword("<i>expr</i> | <i>expr</i>", "| ", tr("logical or (at least one expression has to be satisfied)")) |
| | 269 | .addKeyword("<i>expr</i> OR <i>expr</i>", "OR ", tr("logical or (at least one expression has to be satisfied)")) |
| | 270 | .addKeyword("-<i>expr</i>", null, tr("logical not")) |
| | 271 | .addKeyword("(<i>expr</i>)", null, tr("use parenthesis to group expressions")) |
| | 272 | .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\"") |
| | 273 | , GBC.eol()); |
| | 274 | |
| | 275 | if (Main.pref.getBoolean("expert", false)) { |
| | 276 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 277 | .addTitle(tr("objects")) |
| | 278 | .addKeyword("<img src=\"http://josm.openstreetmap.de/export/4326/josm/trunk/images/Mf_node.png\"> type:node", "type:node", tr("all ways")) |
| | 279 | .addKeyword("<img src=\"http://josm.openstreetmap.de/export/4326/josm/trunk/images/Mf_way.png\"> type:way", "type:way", tr("all ways")) |
| | 280 | .addKeyword("<img src=\"http://josm.openstreetmap.de/export/4326/josm/trunk/images/Mf_relation.png\"> type:relation", "type:relation", tr("all relations")) |
| | 281 | .addKeyword("<img src=\"http://josm.openstreetmap.de/export/4326/josm/trunk/images/Mf_closedway.png\"> closed", "closed", tr("all closed ways")) |
| | 282 | , GBC.eol()); |
| | 283 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 284 | .addTitle(tr("metadata")) |
| | 285 | .addKeyword("user:", "user:", tr("objects changed by user", "user:anonymous")) |
| | 286 | .addKeyword("id:", "id:", tr("objects with given ID (0 for new objects)")) |
| | 287 | .addKeyword("version:", "version:", tr("objects with given version (0 objects without an assigned version)")) |
| | 288 | .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID (0 objects without an assigned changeset)")) |
| | 289 | .addKeyword("timestamp:", "timestamp:", tr("objects with last modification timestamp within range", "timestamp:2012/", "timestamp:2008/2011-02-04T12")) |
| | 290 | , GBC.eol()); |
| | 291 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 292 | .addTitle(tr("properties")) |
| | 293 | .addKeyword("nodes:<i>20-</i>", "nodes:", tr("objects with at least 20 nodes")) |
| | 294 | .addKeyword("tags:<i>5-10</i>", "tags:", tr("objects having 5 to 10 tags")) |
| | 295 | .addKeyword("role:", "role:", tr("objects with given role in a relation")) |
| | 296 | .addKeyword("areasize:<i>-100</i>", "areasize", tr("closed ways with an area of 100 m\u00b2")) |
| | 297 | , GBC.eol()); |
| | 298 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 299 | .addTitle(tr("state")) |
| | 300 | .addKeyword("modified", "modified", tr("all modified objects")) |
| | 301 | .addKeyword("new", "new", tr("all new objects")) |
| | 302 | .addKeyword("selected", "selected", tr("all selected objects")) |
| | 303 | .addKeyword("incomplete", "incomplete", tr("all incomplete objects")) |
| | 304 | , GBC.eol()); |
| | 305 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 306 | .addTitle(tr("relations")) |
| | 307 | .addKeyword("child <i>expr</i>", "child", tr("all children of objects matching the expression", "child building")) |
| | 308 | .addKeyword("parent <i>expr</i>", "parent", tr("all parents of objects matching the expression", "parent bus_stop")) |
| | 309 | , GBC.eol()); |
| | 310 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 311 | .addTitle(tr("view")) |
| | 312 | .addKeyword("inview", "inview", tr("objects in current view")) |
| | 313 | .addKeyword("allinview", "allinview", tr("objects (and all its way nodes / relation members) in current view")) |
| | 314 | .addKeyword("indownloadedarea", "indownloadedarea", tr("objects in downloaded area")) |
| | 315 | .addKeyword("allindownloadedarea", "allindownloadedarea", tr("objects (and all its way nodes / relation members) in downloaded area")) |
| | 316 | , GBC.eol()); |
| | 317 | } |