public class ElementCreationStandardHandler extends DefaultModuleCommandHandler
This handler supports the following parameters;
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CREATION_NAME
Command parameter containing the name of the element to create.
|
static java.lang.String |
METACLASS_NAME
Command parameter containing the metaclass of the element to create.
|
static java.lang.String |
RELATION_NAME
Command parameter containing the created element's relation towards its parent.
|
static java.lang.String |
STEREOTYPE_NAME
Command parameter created element's stereotype.
|
Constructor and Description |
---|
ElementCreationStandardHandler()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.util.List<MObject> selectedElements,
IModule module)
The handler accepts elements matching at least one scope
|
void |
actionPerformed(java.util.List<MObject> selectedElements,
IModule module)
Method invoked when the command is launched.
|
protected java.lang.String |
getMetaclass() |
protected java.lang.String |
getName() |
protected java.lang.String |
getRelation() |
protected java.lang.String |
getStereotype() |
void |
initialize(java.util.List<ElementScope> scopes,
java.util.Map<java.lang.String,java.lang.String> hParameters)
This method is called right after the constructor to initialize scopes and parameters for the handler.
|
protected void |
postConfigureElement(MObject newElement,
IModule module)
Hook called once the element is created and configured and before the transaction is committed.
|
findStereotypeFromSpec, getParameter, getParameters, getScopes, isActiveFor
public static final java.lang.String CREATION_NAME
public static final java.lang.String METACLASS_NAME
public static final java.lang.String STEREOTYPE_NAME
null
.public static final java.lang.String RELATION_NAME
null
means the default composition relation is used.public ElementCreationStandardHandler()
public void actionPerformed(java.util.List<MObject> selectedElements, IModule module)
IModuleCommandHandler
This command is launched by Modelio when the user clicks on the contextual menu command. The selected elements that corresponds to the current selection are given as parameter.
The module that is passed as parameter corresponds to the owner of the command.
selectedElements
- Current selectionmodule
- Owner of the commandpublic boolean accept(java.util.List<MObject> selectedElements, IModule module)
DefaultModuleCommandHandler
accept
in interface IModuleCommandHandler
accept
in class DefaultModuleCommandHandler
selectedElements
- Current selectionmodule
- Owner of the commandprotected void postConfigureElement(MObject newElement, IModule module)
does nothing by default. Sub classes may redefine this method to make additional modifications.
Deleting "newElement" in this method triggers an automatic rollback for the current transaction.
newElement
- the new created elementmodule
- the modulepublic void initialize(java.util.List<ElementScope> scopes, java.util.Map<java.lang.String,java.lang.String> hParameters)
IModuleCommandHandler
initialize
in interface IModuleCommandHandler
initialize
in class DefaultModuleCommandHandler
protected java.lang.String getName()
protected java.lang.String getMetaclass()
protected java.lang.String getRelation()
null
means the default composition relation is used.protected java.lang.String getStereotype()
null
.