Ignore:
Timestamp:
2009-10-26T15:23:39+01:00 (10 years ago)
Author:
Gubaer
Message:

Added explicit help topics
See also current list of help topics with links to source files and to help pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r2308 r2323  
    2828import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2929import org.openstreetmap.josm.data.osm.Relation;
    30 import org.openstreetmap.josm.data.osm.RelationMember;
    3130import org.openstreetmap.josm.data.osm.Way;
    3231import org.openstreetmap.josm.data.osm.WaySegment;
     
    3534import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    3635import org.openstreetmap.josm.gui.DefaultNameFormatter;
    37 import org.openstreetmap.josm.gui.ExtendedDialog;
    3836import org.openstreetmap.josm.gui.actionsupport.DeleteFromRelationConfirmationDialog;
    3937import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4038import org.openstreetmap.josm.tools.ImageProvider;
    4139
    42 import sun.swing.BakedArrayList;
    43 
    4440/**
    4541 * A command to delete a number of primitives from the dataset.
    46 
     42 *
    4743 */
    4844public class DeleteCommand extends Command {
     
    232228    public static Command deleteWithReferences(OsmDataLayer layer, Collection<? extends OsmPrimitive> selection) {
    233229        return deleteWithReferences(layer, selection, false);
    234     }
    235 
    236     private static int testRelation(Relation ref, OsmPrimitive osm, boolean simulate) {
    237         // If this delete action is simulated, do not bug the user with dialogs
    238         // and assume the relations should be deleted
    239         if(simulate)
    240             return 1;
    241 
    242         String role = "";
    243         for (RelationMember m : ref.getMembers()) {
    244             if (m.getMember() == osm) {
    245                 role = m.getRole();
    246                 break;
    247             }
    248         }
    249         ExtendedDialog dialog = new ExtendedDialog(
    250                 Main.parent,
    251                 tr("Conflicting relation"),
    252                 new String[] { tr("Delete from relation"),tr("Cancel") }
    253         );
    254         dialog.setButtonIcons( new String[] { "dialogs/delete.png", "cancel.png" });
    255         if (role.length() > 0) {
    256             dialog.setContent(
    257                     tr(
    258                             "<html>Selection \"{0}\" is used by relation \"{1}\" with role {2}.<br>Delete from relation?</html>",
    259                             osm.getDisplayName(DefaultNameFormatter.getInstance()),
    260                             ref.getDisplayName(DefaultNameFormatter.getInstance()),
    261                             role
    262                     )
    263             );
    264             dialog.showDialog();
    265             return dialog.getValue();
    266         } else {
    267             dialog.setContent(
    268                     tr(
    269                             "<html>Selection \"{0}\" is used by relation \"{1}\".<br>Delete from relation?</html>",
    270                             osm.getDisplayName(DefaultNameFormatter.getInstance()),
    271                             ref.getDisplayName(DefaultNameFormatter.getInstance())
    272                     )
    273             );
    274             dialog.showDialog();
    275             return dialog.getValue();
    276         }
    277230    }
    278231
Note: See TracChangeset for help on using the changeset viewer.