Changeset 18181 in josm
- Timestamp:
- 2021-08-26T15:33:04+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r16553 r18181 24 24 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 25 25 import org.openstreetmap.josm.gui.MainApplication; 26 import org.openstreetmap.josm.gui.Notification; 26 27 import org.openstreetmap.josm.gui.help.HelpUtil; 27 28 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; … … 513 514 int checkRes = Command.checkOutlyingOrIncompleteOperation(primitives, ignore); 514 515 if ((checkRes & Command.IS_OUTSIDE) != 0) { 515 JPanel msg = new JPanel(new GridBagLayout()); 516 msg.add(new JMultilineLabel("<html>" + outsideDialogMessage + "</html>")); 517 boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( 518 operation + "_outside_nodes", 519 MainApplication.getMainFrame(), 520 msg, 521 dialogTitle, 522 JOptionPane.YES_NO_OPTION, 523 JOptionPane.QUESTION_MESSAGE, 524 JOptionPane.YES_OPTION); 516 boolean answer = showConfirmOutlyingOperationDialog(operation + "_outside_nodes", outsideDialogMessage, dialogTitle); 525 517 if (!answer) 526 518 return false; 527 519 } 528 520 if ((checkRes & Command.IS_INCOMPLETE) != 0) { 529 JPanel msg = new JPanel(new GridBagLayout()); 530 msg.add(new JMultilineLabel("<html>" + incompleteDialogMessage + "</html>")); 531 boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( 532 operation + "_incomplete", 533 MainApplication.getMainFrame(), 534 msg, 535 dialogTitle, 536 JOptionPane.YES_NO_OPTION, 537 JOptionPane.QUESTION_MESSAGE, 538 JOptionPane.YES_OPTION); 521 boolean answer = showConfirmOutlyingOperationDialog(operation + "_incomplete", incompleteDialogMessage, dialogTitle); 539 522 if (!answer) 540 523 return false; … … 542 525 return true; 543 526 } 527 528 private static boolean showConfirmOutlyingOperationDialog(String preferenceKey, String dialogMessage, String dialogTitle) { 529 JPanel msg = new JPanel(new GridBagLayout()); 530 msg.add(new JMultilineLabel("<html>" + dialogMessage + "</html>")); 531 boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( 532 preferenceKey, 533 MainApplication.getMainFrame(), 534 msg, 535 dialogTitle, 536 JOptionPane.YES_NO_OPTION, 537 JOptionPane.QUESTION_MESSAGE, 538 JOptionPane.YES_OPTION); 539 if (!answer && JOptionPane.NO_OPTION == ConditionalOptionPaneUtil.getDialogReturnValue(preferenceKey)) { 540 String message = tr("Operation was not performed, as per {0} preference", preferenceKey); 541 new Notification(message).show(); 542 Logging.info(message); 543 } 544 return answer; 545 } 544 546 }
Note:
See TracChangeset
for help on using the changeset viewer.