org.openstreetmap.josm.command
Class ChangePropertyKeyCommand

java.lang.Object
  extended by org.openstreetmap.josm.command.PseudoCommand
      extended by org.openstreetmap.josm.command.Command
          extended by org.openstreetmap.josm.command.ChangePropertyKeyCommand

public class ChangePropertyKeyCommand
extends Command

Command that replaces the key of several objects


Field Summary
private  java.lang.String key
          The key that is subject to change.
private  java.lang.String newKey
          The mew key.
private  java.util.List<OsmPrimitive> objects
          All primitives, that are affected with this command.
 
Constructor Summary
ChangePropertyKeyCommand(java.util.Collection<? extends OsmPrimitive> objects, java.lang.String key, java.lang.String newKey)
          Constructor
 
Method Summary
 boolean executeCommand()
          Executes the command on the dataset.
 void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
          Fill in the changed data this command operates on.
 java.util.Collection<PseudoCommand> getChildren()
          Returns the subcommands of this command.
 javax.swing.Icon getDescriptionIcon()
          Provides a descriptive icon of this command.
 java.lang.String getDescriptionText()
          Provides a description text representing this command.
 
Methods inherited from class org.openstreetmap.josm.command.Command
checkAndConfirmOutlyingOperation, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved, undoCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objects

private final java.util.List<OsmPrimitive> objects
All primitives, that are affected with this command.


key

private final java.lang.String key
The key that is subject to change.


newKey

private final java.lang.String newKey
The mew key.

Constructor Detail

ChangePropertyKeyCommand

public ChangePropertyKeyCommand(java.util.Collection<? extends OsmPrimitive> objects,
                                java.lang.String key,
                                java.lang.String newKey)
Constructor

Parameters:
objects - all objects subject to change replacement
key - The key to replace
newKey - the new value of the key
Method Detail

executeCommand

public boolean executeCommand()
Description copied from class: Command
Executes the command on the dataset. This implementation will remember all primitives returned by fillModifiedData for restoring them on undo.

Overrides:
executeCommand in class Command

fillModifiedData

public void fillModifiedData(java.util.Collection<OsmPrimitive> modified,
                             java.util.Collection<OsmPrimitive> deleted,
                             java.util.Collection<OsmPrimitive> added)
Description copied from class: Command
Fill in the changed data this command operates on. Add to the lists, don't clear them.

Specified by:
fillModifiedData in class Command
Parameters:
modified - The modified primitives
deleted - The deleted primitives
added - The added primitives

getDescriptionText

public java.lang.String getDescriptionText()
Description copied from class: PseudoCommand
Provides a description text representing this command.

Specified by:
getDescriptionText in class PseudoCommand

getDescriptionIcon

public javax.swing.Icon getDescriptionIcon()
Description copied from class: PseudoCommand
Provides a descriptive icon of this command.

Overrides:
getDescriptionIcon in class PseudoCommand

getChildren

public java.util.Collection<PseudoCommand> getChildren()
Description copied from class: PseudoCommand
Returns the subcommands of this command. Override for subclasses that have child commands.

Overrides:
getChildren in class PseudoCommand
Returns:
the subcommands, null if there are no child commands


JOSM