public interface IModuleCommandHandler
The module contextual commands are displayed in the contextual menu and in the specific toolbar of each module property page.
The developer may inherit the DefaultModuleCommandHandler
class which
contains a default standard contextual command implementation.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.util.List<MObject> selectedElements,
IModule module)
This methods authorizes a command to be displayed in a defined context.
|
void |
actionPerformed(java.util.List<MObject> selectedElements,
IModule module)
Method invoked when the command is launched.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters() |
java.util.List<ElementScope> |
getScopes() |
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.
|
boolean |
isActiveFor(java.util.List<MObject> selectedElements,
IModule module)
This method precizes if a command has to be desactivated.
|
void actionPerformed(java.util.List<MObject> selectedElements, IModule module)
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 commandboolean accept(java.util.List<MObject> selectedElements, IModule module)
The commands are displayed, by default, depending on the kind of metaclass on which the command has been launched. If the
module developer wants to refine the command activation depending on specific markers that can be defined on the selection
(tagged value, specific properties...), it can be implemented in the accept
method.
This method is invoked only if all the default filters are passed (if the kind of metaclass is valid)
selectedElements
- Current selectionmodule
- Owner of the commandboolean isActiveFor(java.util.List<MObject> selectedElements, IModule module)
If the command has to be displayed (which means that the accept
method has returned a positive value, it is
sometimes needed to deactivate the command depending on specific constraints that are specific to the module.
This method is invoked only if all the default filters are passed (depending on the read only status of the tool and the objects)
selectedElements
- Current selectionmodule
- Owner of the commandvoid initialize(java.util.List<ElementScope> scopes, java.util.Map<java.lang.String,java.lang.String> hParameters)
java.util.Map<java.lang.String,java.lang.String> getParameters()
java.util.List<ElementScope> getScopes()