org.eclipse.gmf.runtime.lite.commands
Class DestroyElementCommand

java.lang.Object
  extended by org.eclipse.emf.common.command.AbstractCommand
      extended by org.eclipse.emf.common.command.CompoundCommand
          extended by org.eclipse.gmf.runtime.lite.commands.DestroyElementCommand
All Implemented Interfaces:
org.eclipse.emf.common.command.Command

public class DestroyElementCommand
extends org.eclipse.emf.common.command.CompoundCommand

Command that should be used to destroy an underlying model element for which a notational element may be registered. It behaves effectively the same way as the DeleteCommand, but allows filtering of some references, so that they are not removed.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.common.command.AbstractCommand.NonDirtying
 
Field Summary
protected  Collection<?> collection
          This is the collection of objects to be deleted.
protected static String DESCRIPTION
           
protected  org.eclipse.emf.edit.domain.EditingDomain domain
          This is the editing doman in which this command operates.
protected static String LABEL
           
 
Fields inherited from class org.eclipse.emf.common.command.CompoundCommand
commandList, LAST_COMMAND_ALL, MERGE_COMMAND_ALL, resultIndex
 
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label
 
Constructor Summary
DestroyElementCommand(org.eclipse.emf.edit.domain.EditingDomain domain, Collection<?> collection)
          This constructs a command that deletes the objects in the given collection.
DestroyElementCommand(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.emf.edit.command.CommandParameter commandParameter)
          This constructs a command that deletes the objects in the collection specified by the given command parameter.
 
Method Summary
static org.eclipse.emf.common.command.Command create(org.eclipse.emf.edit.domain.EditingDomain domain, Collection<?> collection)
          This creates a command that deletes the objects in the given collection.
static org.eclipse.emf.common.command.Command create(org.eclipse.emf.edit.domain.EditingDomain domain, Object object)
          This creates a command that deletes the given object.
 void execute()
           
protected  boolean prepare()
           
protected  void prepareCommand()
           
protected  boolean shouldRemoveReference(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
          Returns whether value should be removed from the reference identified by the given setting.
 
Methods inherited from class org.eclipse.emf.common.command.CompoundCommand
append, appendAndExecute, appendIfCanExecute, canUndo, dispose, getAffectedObjects, getCommandList, getDescription, getLabel, getMergedAffectedObjectsCollection, getMergedResultCollection, getResult, getResultIndex, isEmpty, redo, toString, undo, unwrap
 
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
canExecute, chain, setDescription, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

domain

protected org.eclipse.emf.edit.domain.EditingDomain domain
This is the editing doman in which this command operates.


collection

protected Collection<?> collection
This is the collection of objects to be deleted.


LABEL

protected static final String LABEL
See Also:
Constant Field Values

DESCRIPTION

protected static final String DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

DestroyElementCommand

public DestroyElementCommand(org.eclipse.emf.edit.domain.EditingDomain domain,
                             Collection<?> collection)
This constructs a command that deletes the objects in the given collection.


DestroyElementCommand

public DestroyElementCommand(org.eclipse.emf.edit.domain.EditingDomain domain,
                             org.eclipse.emf.edit.command.CommandParameter commandParameter)
This constructs a command that deletes the objects in the collection specified by the given command parameter. This constructor is called by default implementations of editing domains.

Method Detail

create

public static org.eclipse.emf.common.command.Command create(org.eclipse.emf.edit.domain.EditingDomain domain,
                                                            Object object)
This creates a command that deletes the given object.


create

public static org.eclipse.emf.common.command.Command create(org.eclipse.emf.edit.domain.EditingDomain domain,
                                                            Collection<?> collection)
This creates a command that deletes the objects in the given collection.


shouldRemoveReference

protected boolean shouldRemoveReference(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
Returns whether value should be removed from the reference identified by the given setting.


prepare

protected boolean prepare()
Overrides:
prepare in class org.eclipse.emf.common.command.CompoundCommand

prepareCommand

protected void prepareCommand()

execute

public void execute()
Specified by:
execute in interface org.eclipse.emf.common.command.Command
Overrides:
execute in class org.eclipse.emf.common.command.CompoundCommand


Copyright © 2012. All Rights Reserved.