- Timestamp:
- 2020-06-07T17:32:46+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/relation/DuplicateRelationAction.java
r14241 r16561 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.GridBagLayout; 6 7 import java.awt.event.ActionEvent; 7 8 9 import javax.swing.JOptionPane; 10 import javax.swing.JPanel; 11 12 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 8 13 import org.openstreetmap.josm.data.osm.IRelation; 9 14 import org.openstreetmap.josm.data.osm.Relation; 15 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 10 16 import org.openstreetmap.josm.gui.MainApplication; 11 17 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; 18 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 12 19 import org.openstreetmap.josm.tools.ImageProvider; 13 20 … … 32 39 */ 33 40 public static void duplicateRelationAndLaunchEditor(Relation original) { 41 if (!confirmRelationDuplicate(original)) { 42 return; 43 } 34 44 Relation copy = new Relation(original, true); 35 45 copy.setModified(true); … … 62 72 && isEditableRelation(relations.iterator().next())); 63 73 } 74 75 private static boolean confirmRelationDuplicate(Relation relation) { 76 JPanel msg = new JPanel(new GridBagLayout()); 77 msg.add(new JMultilineLabel("<html>" + tr( 78 "You are about to duplicate {0} relation: {1}" 79 + "<br/>" 80 + "This step is rarely necessary. Do you really want to duplicate?", 81 1, DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(relation)) 82 + "</html>")); 83 return ConditionalOptionPaneUtil.showConfirmationDialog( 84 "delete_relations", 85 MainApplication.getMainFrame(), 86 msg, 87 tr("Duplicate relation?"), 88 JOptionPane.YES_NO_OPTION, 89 JOptionPane.QUESTION_MESSAGE, 90 JOptionPane.YES_OPTION); 91 } 64 92 }
Note:
See TracChangeset
for help on using the changeset viewer.