### Eclipse Workspace Patch 1.0
#P josm
diff --git src/org/openstreetmap/josm/actions/JosmAction.java src/org/openstreetmap/josm/actions/JosmAction.java
index 3cc62a1..9ebfce4 100644
|
|
|
|
| 83 | 83 | String toolbarId, boolean installAdapters) { |
| 84 | 84 | super(name); |
| 85 | 85 | if (icon != null) { |
| 86 | | ImageResource resource = icon.getResource(); |
| | 86 | final ImageResource resource = icon.getResource(); |
| 87 | 87 | if (resource != null) { |
| 88 | 88 | try { |
| 89 | 89 | resource.attachImageIcon(this, true); |
| … |
… |
|
| 353 | 353 | MainApplication.worker.submit(() -> { |
| 354 | 354 | try { |
| 355 | 355 | future.get(); |
| 356 | | } catch (InterruptedException | ExecutionException | CancellationException e) { |
| | 356 | } catch (InterruptedException e) { |
| | 357 | Logging.error(e); |
| | 358 | Thread.currentThread().interrupt(); |
| | 359 | } catch (ExecutionException | CancellationException e) { |
| 357 | 360 | Logging.error(e); |
| 358 | 361 | return; |
| | 362 | } finally { |
| | 363 | monitor.close(); |
| 359 | 364 | } |
| 360 | | monitor.close(); |
| 361 | 365 | }); |
| 362 | 366 | } |
| 363 | 367 | |
| … |
… |
|
| 419 | 423 | * @since 13434 |
| 420 | 424 | */ |
| 421 | 425 | protected final void updateEnabledStateOnCurrentSelection(boolean allowReadOnly) { |
| 422 | | DataSet ds = getLayerManager().getActiveDataSet(); |
| | 426 | final DataSet ds = getLayerManager().getActiveDataSet(); |
| 423 | 427 | if (ds != null && (allowReadOnly || !ds.isLocked())) { |
| 424 | 428 | updateEnabledState(ds.getSelected()); |
| 425 | 429 | } else { |
| … |
… |
|
| 511 | 515 | String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage, |
| 512 | 516 | Collection<? extends OsmPrimitive> primitives, |
| 513 | 517 | Collection<? extends OsmPrimitive> ignore) { |
| 514 | | int checkRes = Command.checkOutlyingOrIncompleteOperation(primitives, ignore); |
| | 518 | final int checkRes = Command.checkOutlyingOrIncompleteOperation(primitives, ignore); |
| 515 | 519 | if ((checkRes & Command.IS_OUTSIDE) != 0) { |
| 516 | | boolean answer = showConfirmOutlyingOperationDialog(operation + "_outside_nodes", outsideDialogMessage, dialogTitle); |
| 517 | | if (!answer) |
| 518 | | return false; |
| | 520 | final boolean answer = showConfirmOutlyingOperationDialog(operation + "_outside_nodes", outsideDialogMessage, dialogTitle); |
| | 521 | if (!answer) { |
| | 522 | return false; |
| | 523 | } |
| 519 | 524 | } |
| 520 | 525 | if ((checkRes & Command.IS_INCOMPLETE) != 0) { |
| 521 | 526 | return showConfirmOutlyingOperationDialog(operation + "_incomplete", incompleteDialogMessage, dialogTitle); |
| … |
… |
|
| 524 | 529 | } |
| 525 | 530 | |
| 526 | 531 | private static boolean showConfirmOutlyingOperationDialog(String preferenceKey, String dialogMessage, String dialogTitle) { |
| 527 | | JPanel msg = new JPanel(new GridBagLayout()); |
| | 532 | final JPanel msg = new JPanel(new GridBagLayout()); |
| 528 | 533 | msg.add(new JMultilineLabel("<html>" + dialogMessage + "</html>")); |
| 529 | | boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( |
| | 534 | final boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( |
| 530 | 535 | preferenceKey, |
| 531 | 536 | MainApplication.getMainFrame(), |
| 532 | 537 | msg, |
| … |
… |
|
| 535 | 540 | JOptionPane.QUESTION_MESSAGE, |
| 536 | 541 | JOptionPane.YES_OPTION); |
| 537 | 542 | if (!answer && JOptionPane.NO_OPTION == ConditionalOptionPaneUtil.getDialogReturnValue(preferenceKey)) { |
| 538 | | String message = tr("Operation was not performed, as per {0} preference", preferenceKey); |
| | 543 | final String message = tr("Operation was not performed, as per {0} preference", preferenceKey); |
| 539 | 544 | new Notification(message).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
| 540 | 545 | Logging.info(message); |
| 541 | 546 | } |