| 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")); |
| | 250 | final JPanel right; |
| | 251 | if (Main.pref.getBoolean("dialog.search.new", false)) { |
| | 252 | right = new JPanel(new GridBagLayout()); |
| | 253 | buildHintsNew(right, hcbSearchString); |
| | 254 | } else { |
| | 255 | right = new JPanel(); |
| | 256 | buildHintsOld(right); |
| | 323 | private static void buildHintsOld(JPanel right) { |
| | 324 | DescriptionTextBuilder descriptionText = new DescriptionTextBuilder(); |
| | 325 | descriptionText.append("<html><style>li.header{font-size:110%; list-style-type:none; margin-top:5px;}</style><ul>"); |
| | 326 | descriptionText.appendItem(tr("<b>Baker Street</b> - ''Baker'' and ''Street'' in any key")); |
| | 327 | descriptionText.appendItem(tr("<b>\"Baker Street\"</b> - ''Baker Street'' in any key")); |
| | 328 | descriptionText.appendItem(tr("<b>key:Bak</b> - ''Bak'' anywhere in the key ''key''")); |
| | 329 | descriptionText.appendItem(tr("<b>-key:Bak</b> - ''Bak'' nowhere in the key ''key''")); |
| | 330 | descriptionText.appendItem(tr("<b>key=value</b> - key ''key'' with value exactly ''value''")); |
| | 331 | descriptionText.appendItem(tr("<b>key=*</b> - key ''key'' with any value. Try also <b>*=value</b>, <b>key=</b>, <b>*=*</b>, <b>*=</b>")); |
| | 332 | descriptionText.appendItem(tr("<b>key:</b> - key ''key'' set to any value")); |
| | 333 | descriptionText.appendItem(tr("<b>key?</b> - key ''key'' with the value ''yes'', ''true'', ''1'' or ''on''")); |
| | 334 | if(Main.pref.getBoolean("expert", false)) |
| | 335 | { |
| | 336 | descriptionText.appendItemHeader(tr("Special targets")); |
| | 337 | /* 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>)")); |
| | 338 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>user:</b>... - objects changed by user")); |
| | 339 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>user:anonymous</b> - objects changed by anonymous users")); |
| | 340 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>id:</b>... - objects with given ID (0 for new objects)")); |
| | 341 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>version:</b>... - objects with given version (0 objects without an assigned version)")); |
| | 342 | /* 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)")); |
| | 343 | /* 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)")); |
| | 344 | /* 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)")); |
| | 345 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>role:</b>... - objects with given role in a relation")); |
| | 346 | /* 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 ...)")); |
| | 347 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>timestamp:</b>min/max - objects with last modification within range")); |
| | 348 | /* 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)")); |
| | 349 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>modified</b> - all changed objects")); |
| | 350 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>selected</b> - all selected objects")); |
| | 351 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>incomplete</b> - all incomplete objects")); |
| | 352 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>untagged</b> - all untagged objects")); |
| | 353 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>closed</b> - all closed ways (a node is not considered closed)")); |
| | 354 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>child <i>expr</i></b> - all children of objects matching the expression")); |
| | 355 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("<b>parent <i>expr</i></b> - all parents of objects matching the expression")); |
| | 356 | /* 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")); |
| | 357 | /* 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")); |
| | 358 | } |
| | 359 | /* I18n: don't translate the bold text keyword */ descriptionText.appendItem(tr("Use <b>|</b> or <b>OR</b> to combine with logical or")); |
| | 360 | descriptionText.appendItem(tr("Use <b>\"</b> to quote operators (e.g. if key contains <b>:</b>)") |
| | 361 | + "<br/>" |
| | 362 | + 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>).")); |
| | 363 | descriptionText.appendItem(tr("Use <b>(</b> and <b>)</b> to group expressions")); |
| | 364 | descriptionText.append("</ul></html>"); |
| | 365 | JLabel description = new JLabel(descriptionText.toString()); |
| | 366 | description.setFont(description.getFont().deriveFont(Font.PLAIN)); |
| | 367 | right.add(description); |
| | 368 | } |
| | 369 | |
| | 370 | private static void buildHintsNew(JPanel right, HistoryComboBox hcbSearchString) { |
| | 371 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 372 | .addTitle(tr("basic examples")) |
| | 373 | .addKeyword("Baker Street", "Baker Street", tr("''Baker'' and ''Street'' in any key")) |
| | 374 | .addKeyword("\"Baker Street\"", "\"Baker Street\"", tr("''Baker Street'' in any key")) |
| | 375 | , GBC.eol()); |
| | 376 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 377 | .addTitle(tr("basics")) |
| | 378 | .addKeyword("<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' anywhere in ''key''"), "name:str matches name=Bakerstreet") |
| | 379 | .addKeyword("-<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' nowhere in ''key''")) |
| | 380 | .addKeyword("<i>key</i>=<i>value</i>", null, tr("''key'' with exactly ''value''")) |
| | 381 | .addKeyword("<i>key</i>=*", null, tr("''key'' with any value")) |
| | 382 | .addKeyword("*=<i>value</i>", null, tr("''value'' in any key")) |
| | 383 | .addKeyword("<i>key</i>=", null, tr("matches if ''key'' exists")) |
| | 384 | , GBC.eol()); |
| | 385 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 386 | .addTitle(tr("combinators")) |
| | 387 | .addKeyword("<i>expr</i> <i>expr</i>", null, tr("logical and (both expressions have to be satisfied)")) |
| | 388 | .addKeyword("<i>expr</i> | <i>expr</i>", "| ", tr("logical or (at least one expression has to be satisfied)")) |
| | 389 | .addKeyword("<i>expr</i> OR <i>expr</i>", "OR ", tr("logical or (at least one expression has to be satisfied)")) |
| | 390 | .addKeyword("-<i>expr</i>", null, tr("logical not")) |
| | 391 | .addKeyword("(<i>expr</i>)", null, tr("use parenthesis to group expressions")) |
| | 392 | .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\"") |
| | 393 | , GBC.eol()); |
| | 394 | |
| | 395 | if (Main.pref.getBoolean("expert", false)) { |
| | 396 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 397 | .addTitle(tr("objects")) |
| | 398 | .addKeyword("type:node", "type:node", tr("all ways")) |
| | 399 | .addKeyword("type:way", "type:way", tr("all ways")) |
| | 400 | .addKeyword("type:relation", "type:relation", tr("all relations")) |
| | 401 | .addKeyword("closed", "closed", tr("all closed ways")) |
| | 402 | , GBC.eol()); |
| | 403 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 404 | .addTitle(tr("metadata")) |
| | 405 | .addKeyword("user:", "user:", tr("objects changed by user", "user:anonymous")) |
| | 406 | .addKeyword("id:", "id:", tr("objects with given ID"), "id:0 (new objects)") |
| | 407 | .addKeyword("version:", "version:", tr("objects with given version"), "version:0 (objects without an assigned version)") |
| | 408 | .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID"), "changeset:0 (objects without an assigned changeset)") |
| | 409 | .addKeyword("timestamp:", "timestamp:", tr("objects with last modification timestamp within range"), "timestamp:2012/", "timestamp:2008/2011-02-04T12") |
| | 410 | , GBC.eol()); |
| | 411 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 412 | .addTitle(tr("properties")) |
| | 413 | .addKeyword("nodes:<i>20-</i>", "nodes:", tr("objects with at least 20 nodes")) |
| | 414 | .addKeyword("tags:<i>5-10</i>", "tags:", tr("objects having 5 to 10 tags")) |
| | 415 | .addKeyword("role:", "role:", tr("objects with given role in a relation")) |
| | 416 | .addKeyword("areasize:<i>-100</i>", "areasize:", tr("closed ways with an area of 100 m\u00b2")) |
| | 417 | , GBC.eol()); |
| | 418 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 419 | .addTitle(tr("state")) |
| | 420 | .addKeyword("modified", "modified", tr("all modified objects")) |
| | 421 | .addKeyword("new", "new", tr("all new objects")) |
| | 422 | .addKeyword("selected", "selected", tr("all selected objects")) |
| | 423 | .addKeyword("incomplete", "incomplete", tr("all incomplete objects")) |
| | 424 | , GBC.eol()); |
| | 425 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 426 | .addTitle(tr("relations")) |
| | 427 | .addKeyword("child <i>expr</i>", "child", tr("all children of objects matching the expression"), "child building") |
| | 428 | .addKeyword("parent <i>expr</i>", "parent", tr("all parents of objects matching the expression"), "parent bus_stop") |
| | 429 | , GBC.eol()); |
| | 430 | right.add(new SearchKeywordRow(hcbSearchString) |
| | 431 | .addTitle(tr("view")) |
| | 432 | .addKeyword("inview", "inview", tr("objects in current view")) |
| | 433 | .addKeyword("allinview", "allinview", tr("objects (and all its way nodes / relation members) in current view")) |
| | 434 | .addKeyword("indownloadedarea", "indownloadedarea", tr("objects in downloaded area")) |
| | 435 | .addKeyword("allindownloadedarea", "allindownloadedarea", tr("objects (and all its way nodes / relation members) in downloaded area")) |
| | 436 | , GBC.eol()); |
| | 437 | } |
| | 438 | } |
| | 439 | |