UML Modeling Layer

com.ibm.xtools.uml.type
Class UMLElementFactory

java.lang.Object
  extended by com.ibm.xtools.uml.type.UMLElementFactory

public class UMLElementFactory
extends Object

A factory for commands to edit model elements. Corresponding to the command factory methods are similar utility methods that simply obtain the command and execute it (not on the operation history), after first doing file validation on its affected files. Note that the client must invoke these latter utility methods in the context of a read/write transaction (i.e., during the execution of a command). The command factory methods require only a read-only transaction to inspect the elements that are to be edited.

Some of the factory methods accept a map of requestParameters, whose keys can be any of the parameter names declared in the EditRequestParameters. The request parameter values carry information used by the extensible commands to perform the model editing operations. For example, the value of the EditRequestParameters.PROPERTY_TYPE parameter is used by the commands to initialize the type of a new UML property when it is created.


Constructor Summary
UMLElementFactory()
           
 
Method Summary
static EObject createElement(EObject container, IElementType typeToCreate, EReference containmentFeature, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createElement(EObject container, IElementType typeToCreate, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createElement(EObject container, IElementType typeToCreate, Map requestParameters, EReference containmentFeature, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createElement(EObject container, IElementType typeToCreate, Map requestParameters, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createRelationship(EObject container, IElementType typeToCreate, EObject source, EObject target, EReference containmentFeature, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createRelationship(EObject container, IElementType typeToCreate, EObject source, EObject target, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createRelationship(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters, EReference containmentFeature, boolean prompt, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createRelationship(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters, EReference containmentFeature, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static EObject createRelationship(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters, IProgressMonitor progressMonitor)
          Convenience method to create a new element of kind typeToCreate in the context of container.
static boolean destroyElement(EObject element, IProgressMonitor monitor)
          A convenience method that obtains a command to destroy the specified element and also executes it.
static boolean destroyElement(EObject element, Map parameters, IProgressMonitor monitor)
          A convenience method that obtains a command to destroy the specified element and also executes it.
static ICommand getCreateElementCommand(EObject container, IElementType typeToCreate)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateElementCommand(EObject container, IElementType typeToCreate, EObject redefContextHint)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateElementCommand(EObject container, IElementType typeToCreate, EReference containmentFeature)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateElementCommand(EObject container, IElementType typeToCreate, Map requestParameters)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateElementCommand(EObject container, IElementType typeToCreate, Map requestParameters, EReference containmentFeature)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateRelationshipCommand(EObject container, IElementType typeToCreate, EObject source, EObject target)
          Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.
static ICommand getCreateRelationshipCommand(EObject container, IElementType typeToCreate, EObject source, EObject target, EReference containmentFeature)
          Convenience method to get a command create a new relationship of kind typeToCreate in the context of container.
static ICommand getCreateRelationshipCommand(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters)
          Convenience method to get a command to create a new element of kind typeToCreate in the context of container.
static ICommand getCreateRelationshipCommand(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters, EReference containmentFeature)
          Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.
static ICommand getCreateRelationshipCommand(EObject container, IElementType typeToCreate, EObject source, EObject target, Map requestParameters, EReference containmentFeature, boolean prompt)
          Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.
static ICommand getDestroyElementCommand(EObject element)
          Obtains a command that destroys the specified model element.
static ICommand getDestroyElementCommand(EObject element, Map parameters)
          Obtains a command that destroys the specified model element.
static ICommand getEditElementCommand(IEditCommandRequest request)
          Obtains a command that edits an element, according to the details specified by the given request.
static ICommand getMoveElementCommand(EObject targetContainer, EReference targetFeature, EObject elementToMove)
          Obtains a command to move a model element from one container into the specified target feature of another.
static ICommand getMoveElementCommand(EObject targetContainer, EReference targetFeature, EObject elementToMove, Map parameters)
          Obtains a command to move a model element from one container into the specified target feature of another.
static ICommand getMoveElementsCommand(EObject targetContainer, EReference targetFeature, List elementsToMove)
          Obtains a command to move a collection of model elements into the specified feature of a new container.
static ICommand getMoveElementsCommand(EObject targetContainer, EReference targetFeature, List elementsToMove, Map parameters)
          Obtains a command to move a collection of model elements into the specified feature of a new container.
static ICommand getSetValueCommand(EObject element, Object newValue, EReference feature, Map requestParameters)
          Convenience method to get a command to set the value of feature in container.
static boolean moveElement(EObject targetContainer, EReference targetFeature, EObject elementToMove, IProgressMonitor monitor)
          A convenience method that obtains a command to move the specified elementToMove and also executes it.
static boolean moveElement(EObject targetContainer, EReference targetFeature, EObject elementToMove, Map parameters, IProgressMonitor monitor)
          A convenience method that obtains a command to move the specified elementToMove and also executes it.
static boolean moveElements(EObject targetContainer, EReference targetFeature, List elementsToMove, IProgressMonitor monitor)
          A convenience method that obtains a command to move the specified elementsToMove and also executes it.
static boolean moveElements(EObject targetContainer, EReference targetFeature, List elementsToMove, Map parameters, IProgressMonitor monitor)
          A convenience method that obtains a command to move the specified elementsToMove and also executes it.
static boolean setAttributeValue(EObject element, Object newValue, EAttribute attribute, Map requestParameters, IProgressMonitor progressMonitor)
          Convenience method to set the value of attribute in container.
static boolean setValue(EObject element, Object newValue, EReference feature, Map requestParameters, IProgressMonitor progressMonitor)
          Convenience method to set the value of feature in container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UMLElementFactory

public UMLElementFactory()
Method Detail

createElement

public static EObject createElement(EObject container,
                                    IElementType typeToCreate,
                                    IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateElementCommand(EObject, IElementType)

getCreateElementCommand

public static ICommand getCreateElementCommand(EObject container,
                                               IElementType typeToCreate)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
Returns:
the command
See Also:
UMLElementFactory.createElement(EObject, IElementType, IProgressMonitor)

getCreateElementCommand

public static ICommand getCreateElementCommand(EObject container,
                                               IElementType typeToCreate,
                                               EObject redefContextHint)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
redefContextHint - redefinition context hint
Returns:
the command
See Also:
UMLElementFactory.createElement(EObject, IElementType, IProgressMonitor)

createElement

public static EObject createElement(EObject container,
                                    IElementType typeToCreate,
                                    EReference containmentFeature,
                                    IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
containmentFeature - the feature to contain the new element
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateElementCommand(EObject, IElementType, EReference)

getCreateElementCommand

public static ICommand getCreateElementCommand(EObject container,
                                               IElementType typeToCreate,
                                               EReference containmentFeature)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
containmentFeature - the feature to contain the new element
Returns:
the command
See Also:
UMLElementFactory.createElement(EObject, IElementType, EReference, IProgressMonitor)

createElement

public static EObject createElement(EObject container,
                                    IElementType typeToCreate,
                                    Map requestParameters,
                                    IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container. Will use the default containment feature.

Parameters:
container - the container element
typeToCreate - the kind of element to create
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateElementCommand(EObject, IElementType, Map)

getCreateElementCommand

public static ICommand getCreateElementCommand(EObject container,
                                               IElementType typeToCreate,
                                               Map requestParameters)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container. Will use the default containment feature.

Parameters:
container - the container element
typeToCreate - the kind of element to create
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
Returns:
the command
See Also:
UMLElementFactory.createElement(EObject, IElementType, Map, IProgressMonitor)

createElement

public static EObject createElement(EObject container,
                                    IElementType typeToCreate,
                                    Map requestParameters,
                                    EReference containmentFeature,
                                    IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateElementCommand(EObject, IElementType, Map, EReference)

getCreateElementCommand

public static ICommand getCreateElementCommand(EObject container,
                                               IElementType typeToCreate,
                                               Map requestParameters,
                                               EReference containmentFeature)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
Returns:
the command
See Also:
UMLElementFactory.createElement(EObject, IElementType, Map, EReference, IProgressMonitor)

createRelationship

public static EObject createRelationship(EObject container,
                                         IElementType typeToCreate,
                                         EObject source,
                                         EObject target,
                                         IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject)

getCreateRelationshipCommand

public static ICommand getCreateRelationshipCommand(EObject container,
                                                    IElementType typeToCreate,
                                                    EObject source,
                                                    EObject target)
Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
Returns:
the command
See Also:
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, IProgressMonitor)

createRelationship

public static EObject createRelationship(EObject container,
                                         IElementType typeToCreate,
                                         EObject source,
                                         EObject target,
                                         EReference containmentFeature,
                                         IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
containmentFeature - the feature to contain the new element
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, EReference)

getCreateRelationshipCommand

public static ICommand getCreateRelationshipCommand(EObject container,
                                                    IElementType typeToCreate,
                                                    EObject source,
                                                    EObject target,
                                                    EReference containmentFeature)
Convenience method to get a command create a new relationship of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
containmentFeature - the feature to contain the new element
Returns:
the command
See Also:
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, EReference, IProgressMonitor)

createRelationship

public static EObject createRelationship(EObject container,
                                         IElementType typeToCreate,
                                         EObject source,
                                         EObject target,
                                         Map requestParameters,
                                         IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container. Uses the default containment feature.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map)

getCreateRelationshipCommand

public static ICommand getCreateRelationshipCommand(EObject container,
                                                    IElementType typeToCreate,
                                                    EObject source,
                                                    EObject target,
                                                    Map requestParameters)
Convenience method to get a command to create a new element of kind typeToCreate in the context of container. Uses the default containment feature.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
Returns:
the command
See Also:
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, IProgressMonitor)

createRelationship

public static EObject createRelationship(EObject container,
                                         IElementType typeToCreate,
                                         EObject source,
                                         EObject target,
                                         Map requestParameters,
                                         EReference containmentFeature,
                                         IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map, EReference)

createRelationship

public static EObject createRelationship(EObject container,
                                         IElementType typeToCreate,
                                         EObject source,
                                         EObject target,
                                         Map requestParameters,
                                         EReference containmentFeature,
                                         boolean prompt,
                                         IProgressMonitor progressMonitor)
Convenience method to create a new element of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
prompt - prompt flag
progressMonitor - the progress monitor
Returns:
the newly created element, or null if it wasn't created
See Also:
UMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map, EReference, boolean)

getCreateRelationshipCommand

public static ICommand getCreateRelationshipCommand(EObject container,
                                                    IElementType typeToCreate,
                                                    EObject source,
                                                    EObject target,
                                                    Map requestParameters,
                                                    EReference containmentFeature)
Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
Returns:
the command
See Also:
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, EReference, IProgressMonitor)

getCreateRelationshipCommand

public static ICommand getCreateRelationshipCommand(EObject container,
                                                    IElementType typeToCreate,
                                                    EObject source,
                                                    EObject target,
                                                    Map requestParameters,
                                                    EReference containmentFeature,
                                                    boolean prompt)
Convenience method to get a command to create a new relationship of kind typeToCreate in the context of container.

Parameters:
container - the container element
typeToCreate - the kind of element to create
source - the relationship source
target - the relationship target
requestParameters - parameters to be set in the creation request; keys can be parameter names declared in EditRequestParameters
containmentFeature - the feature to contain the new element
prompt - prompt flag
Returns:
the command
See Also:
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, EReference, boolean, IProgressMonitor)

setValue

public static boolean setValue(EObject element,
                               Object newValue,
                               EReference feature,
                               Map requestParameters,
                               IProgressMonitor progressMonitor)
Convenience method to set the value of feature in container.

Validates the files affected by the command and returns false if validation fails.

Parameters:
element - the element whose value will be set
newValue - the new value
feature - the feature to of the element whose value will be set
requestParameters - parameters to be set in the set request; keys can be parameter names declared in EditRequestParameters
progressMonitor - the progress monitor
Returns:
true if the value was set, false otherwise.
See Also:
UMLElementFactory.getSetValueCommand(EObject, Object, EReference, Map)

getSetValueCommand

public static ICommand getSetValueCommand(EObject element,
                                          Object newValue,
                                          EReference feature,
                                          Map requestParameters)
Convenience method to get a command to set the value of feature in container.

Parameters:
element - the element whose value will be set
newValue - the new value
feature - the feature to of the element whose value will be set
requestParameters - parameters to be set in the set request; keys can be parameter names declared in EditRequestParameters
Returns:
the command
See Also:
UMLElementFactory.setValue(EObject, Object, EReference, Map, IProgressMonitor)

setAttributeValue

public static boolean setAttributeValue(EObject element,
                                        Object newValue,
                                        EAttribute attribute,
                                        Map requestParameters,
                                        IProgressMonitor progressMonitor)
Convenience method to set the value of attribute in container.

Validates the files affected by the command and returns false if validation fails.

Parameters:
element - the element whose value will be set
newValue - the new value
attribute - the attribute to of the element whose value will be set
requestParameters - parameters to be set in the set request; keys can be parameter names declared in EditRequestParameters
progressMonitor - the progress monitor
Returns:
true if the value was set, false otherwise.
See Also:
UMLElementFactory.getSetValueCommand(EObject, Object, EReference, Map)

getMoveElementCommand

public static ICommand getMoveElementCommand(EObject targetContainer,
                                             EReference targetFeature,
                                             EObject elementToMove)
Obtains a command to move a model element from one container into the specified target feature of another.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementToMove - the element to be moved
Returns:
the move command
See Also:
UMLElementFactory.moveElement(EObject, EReference, EObject, IProgressMonitor)

getMoveElementCommand

public static ICommand getMoveElementCommand(EObject targetContainer,
                                             EReference targetFeature,
                                             EObject elementToMove,
                                             Map parameters)
Obtains a command to move a model element from one container into the specified target feature of another.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementToMove - the element to be moved
parameters - additional parameters for the command (may be null); keys can be parameter names declared in EditRequestParameters
Returns:
the move command
See Also:
UMLElementFactory.moveElement(EObject, EReference, EObject, Map, IProgressMonitor)

getMoveElementsCommand

public static ICommand getMoveElementsCommand(EObject targetContainer,
                                              EReference targetFeature,
                                              List elementsToMove)
Obtains a command to move a collection of model elements into the specified feature of a new container.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementsToMove - the list of EObjects to be moved.
Returns:
the move command
See Also:
UMLElementFactory.moveElements(EObject, EReference, List, IProgressMonitor)

getMoveElementsCommand

public static ICommand getMoveElementsCommand(EObject targetContainer,
                                              EReference targetFeature,
                                              List elementsToMove,
                                              Map parameters)
Obtains a command to move a collection of model elements into the specified feature of a new container.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementsToMove - the list of EObjects to be moved.
parameters - additional parameters for the command; keys can be parameter names declared in EditRequestParameters
Returns:
the move command
See Also:
UMLElementFactory.moveElements(EObject, EReference, List, Map, IProgressMonitor)

moveElement

public static boolean moveElement(EObject targetContainer,
                                  EReference targetFeature,
                                  EObject elementToMove,
                                  IProgressMonitor monitor)
A convenience method that obtains a command to move the specified elementToMove and also executes it. The command is not executed on the operation history.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementToMove - the element to be moved
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the element was successfully moved; false if it could not be moved
See Also:
UMLElementFactory.getMoveElementCommand(EObject, EReference, EObject)

moveElement

public static boolean moveElement(EObject targetContainer,
                                  EReference targetFeature,
                                  EObject elementToMove,
                                  Map parameters,
                                  IProgressMonitor monitor)
A convenience method that obtains a command to move the specified elementToMove and also executes it. The command is not executed on the operation history.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementToMove - the element to be moved
parameters - additional parameters for the move command; keys can be parameter names declared in EditRequestParameters
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the element was successfully moved; false if it could not be moved
See Also:
UMLElementFactory.getMoveElementCommand(EObject, EReference, EObject, Map)

moveElements

public static boolean moveElements(EObject targetContainer,
                                   EReference targetFeature,
                                   List elementsToMove,
                                   IProgressMonitor monitor)
A convenience method that obtains a command to move the specified elementsToMove and also executes it. The command is not executed on the operation history.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementsToMove - the list of EObjects to be moved.
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the elements were successfully moved; false if they could not be moved
See Also:
UMLElementFactory.getMoveElementsCommand(EObject, EReference, List)

moveElements

public static boolean moveElements(EObject targetContainer,
                                   EReference targetFeature,
                                   List elementsToMove,
                                   Map parameters,
                                   IProgressMonitor monitor)
A convenience method that obtains a command to move the specified elementsToMove and also executes it. The command is not executed on the operation history.

Parameters:
targetContainer - the target container
targetFeature - the target feature
elementsToMove - the list of EObjects to be moved.
parameters - additional parameters for the move command; keys can be parameter names declared in EditRequestParameters
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the elements were successfully moved; false if they could not be moved
See Also:
UMLElementFactory.getMoveElementsCommand(EObject, EReference, List)

getDestroyElementCommand

public static ICommand getDestroyElementCommand(EObject element)
Obtains a command that destroys the specified model element. This command will detach the element from the model and clear all references to it, from other elements in the model.

Parameters:
element - an element to be destroyed
Returns:
the command that will destroy it
See Also:
UMLElementFactory.destroyElement(EObject, IProgressMonitor)

getDestroyElementCommand

public static ICommand getDestroyElementCommand(EObject element,
                                                Map parameters)
Obtains a command that destroys the specified model element. This command will detach the element from the model and clear all references to it, from other elements in the model.

Parameters:
element - an element to be destroyed
parameters - additional parameters for the destroy command; keys can be parameter names declared in EditRequestParameters
Returns:
the command that will destroy it
See Also:
UMLElementFactory.destroyElement(EObject, Map, IProgressMonitor)

destroyElement

public static boolean destroyElement(EObject element,
                                     IProgressMonitor monitor)
A convenience method that obtains a command to destroy the specified element and also executes it. The command is not executed on the operation history.

Parameters:
element - an element to destroy
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the element was successfully destroyed; false if it could not be destroyed
See Also:
UMLElementFactory.getDestroyElementCommand(EObject)

destroyElement

public static boolean destroyElement(EObject element,
                                     Map parameters,
                                     IProgressMonitor monitor)
A convenience method that obtains a command to destroy the specified element and also executes it. The command is not executed on the operation history.

Parameters:
element - an element to destroy
parameters - additional parameters for the destroy command; keys can be parameter names declared in EditRequestParameters
monitor - a progress monitor to use in execution of the command. Specify null if progress monitoring is not required
Returns:
true if the element was successfully destroyed; false if it could not be destroyed
See Also:
UMLElementFactory.getDestroyElementCommand(EObject, Map)

getEditElementCommand

public static ICommand getEditElementCommand(IEditCommandRequest request)
Obtains a command that edits an element, according to the details specified by the given request.

Parameters:
request - the specification of the edit operation to perform
Returns:
the command that will perform the edit

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.