|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.xtools.uml.type.UMLElementFactory
public class UMLElementFactory
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 container. |
static EObject |
createElement(EObject container,
IElementType typeToCreate,
IProgressMonitor progressMonitor)
Convenience method to create a new element of kind container. |
static EObject |
createElement(EObject container,
IElementType typeToCreate,
Map requestParameters,
EReference containmentFeature,
IProgressMonitor progressMonitor)
Convenience method to create a new element of kind container. |
static EObject |
createElement(EObject container,
IElementType typeToCreate,
Map requestParameters,
IProgressMonitor progressMonitor)
Convenience method to create a new element of kind 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 container. |
static EObject |
createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
IProgressMonitor progressMonitor)
Convenience method to create a new element of kind 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 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 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 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 container. |
static ICommand |
getCreateElementCommand(EObject container,
IElementType typeToCreate,
EObject redefContextHint)
Convenience method to get a command to create a new element of kind container. |
static ICommand |
getCreateElementCommand(EObject container,
IElementType typeToCreate,
EReference containmentFeature)
Convenience method to get a command to create a new element of kind container. |
static ICommand |
getCreateElementCommand(EObject container,
IElementType typeToCreate,
Map requestParameters)
Convenience method to get a command to create a new element of kind 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 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 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 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 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 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 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 |
|---|
public UMLElementFactory()
| Method Detail |
|---|
public static EObject createElement(EObject container,
IElementType typeToCreate,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateElementCommand(EObject, IElementType)
public static ICommand getCreateElementCommand(EObject container,
IElementType typeToCreate)
container.
container - the container elementtypeToCreate - the kind of element to create
UMLElementFactory.createElement(EObject, IElementType, IProgressMonitor)
public static ICommand getCreateElementCommand(EObject container,
IElementType typeToCreate,
EObject redefContextHint)
container.
container - the container elementtypeToCreate - the kind of element to createredefContextHint - redefinition context hint
UMLElementFactory.createElement(EObject, IElementType, IProgressMonitor)
public static EObject createElement(EObject container,
IElementType typeToCreate,
EReference containmentFeature,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createcontainmentFeature - the feature to contain the new elementprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateElementCommand(EObject, IElementType, EReference)
public static ICommand getCreateElementCommand(EObject container,
IElementType typeToCreate,
EReference containmentFeature)
container.
container - the container elementtypeToCreate - the kind of element to createcontainmentFeature - the feature to contain the new element
UMLElementFactory.createElement(EObject, IElementType, EReference, IProgressMonitor)
public static EObject createElement(EObject container,
IElementType typeToCreate,
Map requestParameters,
IProgressMonitor progressMonitor)
container. Will use the default
containment feature.
container - the container elementtypeToCreate - the kind of element to createrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParametersprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateElementCommand(EObject, IElementType, Map)
public static ICommand getCreateElementCommand(EObject container,
IElementType typeToCreate,
Map requestParameters)
container.
Will use the default containment feature.
container - the container elementtypeToCreate - the kind of element to createrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.createElement(EObject, IElementType, Map, IProgressMonitor)
public static EObject createElement(EObject container,
IElementType typeToCreate,
Map requestParameters,
EReference containmentFeature,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new elementprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateElementCommand(EObject, IElementType, Map, EReference)
public static ICommand getCreateElementCommand(EObject container,
IElementType typeToCreate,
Map requestParameters,
EReference containmentFeature)
container.
container - the container elementtypeToCreate - the kind of element to createrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new element
UMLElementFactory.createElement(EObject, IElementType, Map, EReference, IProgressMonitor)
public static EObject createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject)
public static ICommand getCreateRelationshipCommand(EObject container,
IElementType typeToCreate,
EObject source,
EObject target)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship target
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, IProgressMonitor)
public static EObject createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
EReference containmentFeature,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetcontainmentFeature - the feature to contain the new elementprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, EReference)
public static ICommand getCreateRelationshipCommand(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
EReference containmentFeature)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetcontainmentFeature - the feature to contain the new element
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, EReference, IProgressMonitor)
public static EObject createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters,
IProgressMonitor progressMonitor)
container. Uses the default containment
feature.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParametersprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map)
public static ICommand getCreateRelationshipCommand(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters)
container.
Uses the default containment feature.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, IProgressMonitor)
public static EObject createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters,
EReference containmentFeature,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new elementprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map, EReference)
public static EObject createRelationship(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters,
EReference containmentFeature,
boolean prompt,
IProgressMonitor progressMonitor)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new elementprompt - prompt flagprogressMonitor - the progress monitor
null if it wasn't
createdUMLElementFactory.getCreateRelationshipCommand(EObject, IElementType, EObject, EObject, Map, EReference, boolean)
public static ICommand getCreateRelationshipCommand(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters,
EReference containmentFeature)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new element
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, EReference, IProgressMonitor)
public static ICommand getCreateRelationshipCommand(EObject container,
IElementType typeToCreate,
EObject source,
EObject target,
Map requestParameters,
EReference containmentFeature,
boolean prompt)
container.
container - the container elementtypeToCreate - the kind of element to createsource - the relationship sourcetarget - the relationship targetrequestParameters - parameters to be set in the creation request; keys can be
parameter names declared in
EditRequestParameterscontainmentFeature - the feature to contain the new elementprompt - prompt flag
UMLElementFactory.createRelationship(EObject, IElementType, EObject, EObject, Map, EReference, boolean, IProgressMonitor)
public static boolean setValue(EObject element,
Object newValue,
EReference feature,
Map requestParameters,
IProgressMonitor progressMonitor)
feature in
container.
Validates the files affected by the command and returns
false if validation fails.
element - the element whose value will be setnewValue - the new valuefeature - the feature to of the element whose value will be setrequestParameters - parameters to be set in the set request; keys can be
parameter names declared in
EditRequestParametersprogressMonitor - the progress monitor
true if the value was set, false
otherwise.UMLElementFactory.getSetValueCommand(EObject, Object, EReference, Map)
public static ICommand getSetValueCommand(EObject element,
Object newValue,
EReference feature,
Map requestParameters)
feature in container.
element - the element whose value will be setnewValue - the new valuefeature - the feature to of the element whose value will be setrequestParameters - parameters to be set in the set request; keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.setValue(EObject, Object, EReference, Map, IProgressMonitor)
public static boolean setAttributeValue(EObject element,
Object newValue,
EAttribute attribute,
Map requestParameters,
IProgressMonitor progressMonitor)
attribute in
container.
Validates the files affected by the command and returns
false if validation fails.
element - the element whose value will be setnewValue - the new valueattribute - the attribute to of the element whose value will be setrequestParameters - parameters to be set in the set request; keys can be
parameter names declared in
EditRequestParametersprogressMonitor - the progress monitor
true if the value was set, false
otherwise.UMLElementFactory.getSetValueCommand(EObject, Object, EReference, Map)
public static ICommand getMoveElementCommand(EObject targetContainer,
EReference targetFeature,
EObject elementToMove)
targetContainer - the target containertargetFeature - the target featureelementToMove - the element to be moved
UMLElementFactory.moveElement(EObject, EReference, EObject, IProgressMonitor)
public static ICommand getMoveElementCommand(EObject targetContainer,
EReference targetFeature,
EObject elementToMove,
Map parameters)
targetContainer - the target containertargetFeature - the target featureelementToMove - the element to be movedparameters - additional parameters for the command (may be null); keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.moveElement(EObject, EReference, EObject, Map, IProgressMonitor)
public static ICommand getMoveElementsCommand(EObject targetContainer,
EReference targetFeature,
List elementsToMove)
targetContainer - the target containertargetFeature - the target featureelementsToMove - the list of EObjects to be moved.
UMLElementFactory.moveElements(EObject, EReference, List, IProgressMonitor)
public static ICommand getMoveElementsCommand(EObject targetContainer,
EReference targetFeature,
List elementsToMove,
Map parameters)
targetContainer - the target containertargetFeature - the target featureelementsToMove - the list of EObjects to be moved.parameters - additional parameters for the command; keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.moveElements(EObject, EReference, List, Map, IProgressMonitor)
public static boolean moveElement(EObject targetContainer,
EReference targetFeature,
EObject elementToMove,
IProgressMonitor monitor)
targetContainer - the target containertargetFeature - the target featureelementToMove - the element to be movedmonitor - a progress monitor to use in execution of the command.
Specify null if progress monitoring is not required
true if the element was successfully moved;
false if it could not be movedUMLElementFactory.getMoveElementCommand(EObject, EReference, EObject)
public static boolean moveElement(EObject targetContainer,
EReference targetFeature,
EObject elementToMove,
Map parameters,
IProgressMonitor monitor)
targetContainer - the target containertargetFeature - the target featureelementToMove - the element to be movedparameters - additional parameters for the move command; keys can be
parameter names declared in
EditRequestParametersmonitor - a progress monitor to use in execution of the command.
Specify null if progress monitoring is not required
true if the element was successfully moved;
false if it could not be movedUMLElementFactory.getMoveElementCommand(EObject, EReference, EObject, Map)
public static boolean moveElements(EObject targetContainer,
EReference targetFeature,
List elementsToMove,
IProgressMonitor monitor)
targetContainer - the target containertargetFeature - the target featureelementsToMove - 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
true if the elements were successfully moved;
false if they could not be movedUMLElementFactory.getMoveElementsCommand(EObject, EReference, List)
public static boolean moveElements(EObject targetContainer,
EReference targetFeature,
List elementsToMove,
Map parameters,
IProgressMonitor monitor)
targetContainer - the target containertargetFeature - the target featureelementsToMove - the list of EObjects to be moved.parameters - additional parameters for the move command; keys can be
parameter names declared in
EditRequestParametersmonitor - a progress monitor to use in execution of the command.
Specify null if progress monitoring is not required
true if the elements were successfully moved;
false if they could not be movedUMLElementFactory.getMoveElementsCommand(EObject, EReference, List)public static ICommand getDestroyElementCommand(EObject element)
element - an element to be destroyed
UMLElementFactory.destroyElement(EObject, IProgressMonitor)
public static ICommand getDestroyElementCommand(EObject element,
Map parameters)
element - an element to be destroyedparameters - additional parameters for the destroy command; keys can be
parameter names declared in
EditRequestParameters
UMLElementFactory.destroyElement(EObject, Map, IProgressMonitor)
public static boolean destroyElement(EObject element,
IProgressMonitor monitor)
element - an element to destroymonitor - a progress monitor to use in execution of the command.
Specify null if progress monitoring is not required
true if the element was successfully destroyed;
false if it could not be destroyedUMLElementFactory.getDestroyElementCommand(EObject)
public static boolean destroyElement(EObject element,
Map parameters,
IProgressMonitor monitor)
element - an element to destroyparameters - additional parameters for the destroy command; keys can be
parameter names declared in
EditRequestParametersmonitor - a progress monitor to use in execution of the command.
Specify null if progress monitoring is not required
true if the element was successfully destroyed;
false if it could not be destroyedUMLElementFactory.getDestroyElementCommand(EObject, Map)public static ICommand getEditElementCommand(IEditCommandRequest request)
request - the specification of the edit operation to perform
|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||