public class CreateMatrixStandardCommandHandler extends AbstractCreateMatrixCommandHandler
IMatrixWizardContributor
that creates a matrix from the attached matrix descriptor.
Used parameters:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARAM_DESCRIPTOR
Command parameter for the matrix descriptor identifier.
|
static java.lang.String |
PARAM_MATRIX_NAME
Command parameter for the matrix name.
|
static java.lang.String |
PARAM_QUERY_USE_ADDITIONS
Command parameter for a query.
|
Constructor and Description |
---|
CreateMatrixStandardCommandHandler() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.util.List<MObject> selectedElements,
IModule module)
Method invoked when the command is launched.
|
protected java.lang.String |
computeMatrixDescription(ModelElement matrixContext,
IModule module)
Compute a description note content to put on the matrix.
|
protected java.lang.String |
computeMatrixName(ModelElement matrixContext,
IModule module)
Compute the matrix name.
|
protected void |
copyParameters(java.util.Map<java.lang.String,java.lang.String> source,
PropertyTable target)
Copy the source parameters to the given property table.
|
protected QueryDefinition |
createQueryDefinition(IModule module,
java.lang.String implementationClassName,
java.util.Map<java.lang.String,java.lang.String> parameters)
Creates a
QueryDefinition to be used as line, column or depth query. |
protected MatrixDescriptor |
getDescriptor(ModelElement matrixContext,
IModule module)
Get the
MatrixDescriptor that will be used to create the MatrixDefinition model
from this command handler parameters. |
protected void |
postConfigure(MatrixDefinition matrix,
ModelElement matrixContext,
IModule module)
Hook called after a matrix is created.
|
createExternProcessor, createMatrixValueDefinition, createQueryDefinition, isActiveFor
accept, findStereotypeFromSpec, getParameter, getParameters, getScopes, initialize
public static final java.lang.String PARAM_DESCRIPTOR
public static final java.lang.String PARAM_MATRIX_NAME
The parameter value may contain "$name" that will be replaced by the matrix owner name.
public static final java.lang.String PARAM_QUERY_USE_ADDITIONS
The parameter value must contain "true" or "false".
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 commandprotected void copyParameters(java.util.Map<java.lang.String,java.lang.String> source, PropertyTable target)
source
- the source parameters.target
- the target property table.protected MatrixDescriptor getDescriptor(ModelElement matrixContext, IModule module) throws java.lang.IllegalStateException
MatrixDescriptor
that will be used to create the MatrixDefinition
model
from this command handler parameters.
By default reads the matrix descriptor identifier in the "x"
command parameter and asks the IMatrixDescriptorService
Modelio service for it.
matrixContext
- the elements on which the matrix is to be created.module
- the current modulejava.lang.IllegalStateException
- if the matrix descriptor is not found or not defined.protected java.lang.String computeMatrixDescription(ModelElement matrixContext, IModule module)
By default returns null meaning no description will be created.
matrixContext
- the matrix ownermodule
- the current moduleprotected java.lang.String computeMatrixName(ModelElement matrixContext, IModule module)
By default look for a "matrix_name" command parameter and replace "$name" by the matrix owner name.
matrixContext
- the matrix ownermodule
- the current moduleprotected void postConfigure(MatrixDefinition matrix, ModelElement matrixContext, IModule module)
Does nothing by default.
matrix
- the create MatrixDefinition
.matrixContext
- the matrix owner.module
- the current moduleprotected final QueryDefinition createQueryDefinition(IModule module, java.lang.String implementationClassName, java.util.Map<java.lang.String,java.lang.String> parameters)
QueryDefinition
to be used as line, column or depth query.module
- the module.implementationClassName
- the query java implementation class name.parameters
- the query parameters obtained from the matrix descriptor.