public interface IMdacContextualCommand
The MDAC contextual commands are displayed in the contextual menu and in the specific toolbar of each mdac property page.
The developer may inherit the DefaultMdacContextualCommand
class which
contains a default standard contextual command implementation.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(ObList<IElement> selectedElements,
IMdac mdac)
This methods authorizes a command to be displayed in a defined context.
|
void |
actionPerformed(ObList<IElement> selectedElements,
IMdac mdac)
Method invoked when the command is launched.
|
boolean |
isActiveFor(ObList<IElement> selectedElements,
IMdac mdac)
This method precizes if a command has to be desactivated.
|
void actionPerformed(ObList<IElement> selectedElements, IMdac mdac)
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 mdac that is passed as parameter corresponds to the owner of the command.
selectedElements
- Current selectionmdac
- Owner of the commandboolean accept(ObList<IElement> selectedElements, IMdac mdac)
The commands are displayed, by default, depending on the kind of metaclass
on which the command has been launched. If the user wants to affine 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 selectionmdac
- Owner of the commandboolean isActiveFor(ObList<IElement> selectedElements, IMdac mdac)
If the command has to be displayed (which means that the accept
method
has returned a positive value, it is sometimes needed to
desactivate the command depending on specific constraints that are specific to the
MDAC.
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 selectionmdac
- Owner of the command