public class CreateCustomMatrixCommandHandler 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_MATRIX_NAME
Command parameter for the matrix name.
|
static java.lang.String |
PARAM_VAL_PARAM_PREFIX
Command parameter prefix for value definition parameters.
|
static java.lang.String |
PARAM_VALUEDEF
Command parameter for value definition class name.
|
static java.lang.String |
PARAM_X
Command parameter for column query class name.
|
static java.lang.String |
PARAM_X_PARAM_PREFIX
Command parameter prefix for column query parameters.
|
static java.lang.String |
PARAM_Y
Command parameter for line query class name.
|
static java.lang.String |
PARAM_Y_PARAM_PREFIX
Command parameter prefix for line query parameters.
|
static java.lang.String |
PARAM_Z
Command parameter for depth query class name.
|
static java.lang.String |
PARAM_Z_PARAM_PREFIX
Command parameter prefix for depth query parameters.
|
Constructor and Description |
---|
CreateCustomMatrixCommandHandler() |
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 MatrixDescriptor |
getDescriptor(ModelElement matrixContext,
IModule module)
Compute 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_X
public static final java.lang.String PARAM_Y
public static final java.lang.String PARAM_Z
public static final java.lang.String PARAM_VALUEDEF
public static final java.lang.String PARAM_X_PARAM_PREFIX
public static final java.lang.String PARAM_Y_PARAM_PREFIX
public static final java.lang.String PARAM_Z_PARAM_PREFIX
public static final java.lang.String PARAM_VAL_PARAM_PREFIX
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 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)
MatrixDescriptor
that will be used to create the MatrixDefinition
model
from this command handler parameters.matrixContext
- the elements on which the matrix is to be created.module
- the current moduleprotected 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 module