Changeset 12575 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2017-08-06T20:24:40+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OverpassDownloadAction.java
r12574 r12575 106 106 * want to save the last query in OverpassQueryList. 107 107 */ 108 Consumer<Collection > errorReporter = (errors)-> {108 Consumer<Collection<Object>> errorReporter = errors -> { 109 109 110 110 boolean onlyNoDataError = errors.size() == 1 && … … 221 221 @Override 222 222 public void focusLost(FocusEvent e) { 223 223 // ignored 224 224 } 225 225 }); … … 233 233 ? BasicArrowButton.EAST 234 234 : BasicArrowButton.WEST); 235 arrowButton.addActionListener(e -> 235 arrowButton.addActionListener(e -> { 236 236 if (overpassQueryList.isVisible()) { 237 237 overpassQueryList.setVisible(false); … … 288 288 private static final class QueryWizardDialog extends ExtendedDialog { 289 289 290 private static final String HEADLINE_START = "<h3>"; 291 private static final String HEADLINE_END = "</h3>"; 292 private static final String TR_START = "<tr>"; 293 private static final String TR_END = "</tr>"; 294 private static final String TD_START = "<td>"; 295 private static final String TD_END = "</td>"; 290 296 private static QueryWizardDialog dialog; 291 297 private final HistoryComboBox queryWizard; … … 329 335 330 336 JLabel searchLabel = new JLabel(tr("Search :")); 331 JTextComponent descPane = this.buildDescriptionSection();337 JTextComponent descPane = buildDescriptionSection(); 332 338 JScrollPane scroll = GuiHelper.embedInVerticalScrollPane(descPane); 333 339 scroll.getVerticalScrollBar().setUnitIncrement(10); // make scrolling smooth … … 422 428 } 423 429 424 private JTextComponent buildDescriptionSection() {425 JEditorPane descriptionSection = new JEditorPane("text/html", this.getDescriptionContent());430 private static JTextComponent buildDescriptionSection() { 431 JEditorPane descriptionSection = new JEditorPane("text/html", getDescriptionContent()); 426 432 descriptionSection.setEditable(false); 427 433 descriptionSection.addHyperlinkListener(e -> { … … 434 440 } 435 441 436 private String getDescriptionContent() {442 private static String getDescriptionContent() { 437 443 return new StringBuilder("<html>") 438 444 .append(DESCRIPTION_STYLE) 439 445 .append("<body>") 440 .append( "<h3>")446 .append(HEADLINE_START) 441 447 .append(tr("Query Wizard")) 442 .append( "</h3>")448 .append(HEADLINE_END) 443 449 .append("<p>") 444 450 .append(tr("Allows you to interact with <i>Overpass API</i> by writing declarative, human-readable terms.")) … … 447 453 .append(tr("<a href=\"{0}\">OSM Wiki</a>.", Main.getOSMWebsite() + "/wiki/Overpass_turbo/Wizard")) 448 454 .append("</p>") 449 .append( "<h3>").append(tr("Hints")).append("</h3>")450 .append("<table>").append( "<tr>").append("<td>")455 .append(HEADLINE_START).append(tr("Hints")).append(HEADLINE_END) 456 .append("<table>").append(TR_START).append(TD_START) 451 457 .append(Utils.joinAsHtmlUnorderedList(Arrays.asList("<i>type:node</i>", "<i>type:relation</i>", "<i>type:way</i>"))) 452 .append( "</td>").append("<td>")458 .append(TD_END).append(TD_START) 453 459 .append("<span>").append(tr("Download objects of a certain type.")).append("</span>") 454 .append( "</td>").append("</tr>")455 .append( "<tr>").append("<td>")460 .append(TD_END).append(TR_END) 461 .append(TR_START).append(TD_START) 456 462 .append(Utils.joinAsHtmlUnorderedList( 457 463 Arrays.asList("<i>key=value in <u>location</u></i>", 458 464 "<i>key=value around <u>location</u></i>", 459 465 "<i>key=value in bbox</i>"))) 460 .append( "</td>").append("<td>")466 .append(TD_END).append(TD_START) 461 467 .append(tr("Download object by specifying a specific location. For example,")) 462 468 .append(Utils.joinAsHtmlUnorderedList(Arrays.asList( … … 469 475 .append(tr("Instead of <i>location</i> any valid place name can be used like address, city, etc.")) 470 476 .append("</span>") 471 .append( "</td>").append("</tr>")472 .append( "<tr>").append("<td>")477 .append(TD_END).append(TR_END) 478 .append(TR_START).append(TD_START) 473 479 .append(Utils.joinAsHtmlUnorderedList(Arrays.asList("<i>key=value</i>", "<i>key=*</i>", "<i>key~regex</i>", 474 480 "<i>key!=value</i>", "<i>key!~regex</i>", "<i>key=\"combined value\"</i>"))) 475 .append( "</td>").append("<td>")481 .append(TD_END).append(TD_START) 476 482 .append(tr("<span>Download objects that have some concrete key/value pair, only the key with any contents for the value, " + 477 483 "the value matching some regular expression. 'Not equal' operators are supported as well.</span>")) 478 .append( "</td>").append("</tr>")479 .append( "<tr>").append("<td>")484 .append(TD_END).append(TR_END) 485 .append(TR_START).append(TD_START) 480 486 .append(Utils.joinAsHtmlUnorderedList(Arrays.asList( 481 487 tr("<i>expression1 {0} expression2</i>", "or"), 482 488 tr("<i>expression1 {0} expression2</i>", "and")))) 483 .append( "</td>").append("<td>")489 .append(TD_END).append(TD_START) 484 490 .append("<span>") 485 491 .append(tr("Basic logical operators can be used to create more sophisticated queries. Instead of 'or' - '|', '||' " + 486 492 "can be used, and instead of 'and' - '&', '&&'.")) 487 493 .append("</span>") 488 .append( "</td>").append("</tr>").append("</table>")494 .append(TD_END).append(TR_END).append("</table>") 489 495 .append("</body>") 490 496 .append("</html>") -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r12574 r12575 30 30 private final DownloadTask task; 31 31 private final Future<?> future; 32 private Consumer<Collection > errorReporter;32 private Consumer<Collection<Object>> errorReporter; 33 33 34 34 /** 35 * constructor35 * Creates a new {@link PostDownloadHandler} 36 36 * @param task the asynchronous download task 37 37 * @param future the future on which the completion of the download task can be synchronized … … 43 43 44 44 /** 45 * constructor45 * Creates a new {@link PostDownloadHandler} using a custom error reporter 46 46 * @param task the asynchronous download task 47 47 * @param future the future on which the completion of the download task can be synchronized … … 49 49 * task 50 50 */ 51 public PostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection > errorReporter) {51 public PostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection<Object>> errorReporter) { 52 52 this(task, future); 53 53 this.errorReporter = errorReporter;
Note:
See TracChangeset
for help on using the changeset viewer.