Package org.eclipse.graphiti.pattern.id
Class IdPattern
java.lang.Object
org.eclipse.graphiti.pattern.AbstractBasePattern
org.eclipse.graphiti.pattern.AbstractPattern
org.eclipse.graphiti.pattern.TypedPattern
org.eclipse.graphiti.pattern.id.IdPattern
- All Implemented Interfaces:
IFeatureProviderHolder
,IAdd
,ICreate
,ICreateInfo
,IDelete
,IDirectEditing
,ILayout
,IMoveShape
,IRemove
,IResizeShape
,IUpdate
,IPattern
Base class for ID patterns. The basic idea behind is to tag single parts of a
pattern shape with IDs (using
Property
objects). These IDs are used
to identify the parts of that shape and to call the update and layout methods
for the shapes with IDs. Clients do not need to search through the shape
hierarchy to find the shapes to update and layout.
Besides IDs this pattern base implementation also supports tagging
PictogramElement
s with an index property that allows to number a
sequence of children using the same ID, e.g. a list of attributes inside a
class.
- Since:
- 0.10
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
The property key that is used to tag individualPictogramElement
s with a specific ID to identify them later during e.g.protected static final String
The property key that is used to tag individualPictogramElement
s with a specific index beyond the ID to identify them later during e.g.protected static final String
The property key that stores the information that aPictogramElement
is the root object of aIdPattern
subclass.Fields inherited from class org.eclipse.graphiti.pattern.TypedPattern
PROPERTY_KEY_PATTERN_TYPE
Fields inherited from class org.eclipse.graphiti.pattern.AbstractPattern
EMPTY_STRING_ARRAY
Fields inherited from interface org.eclipse.graphiti.func.IDirectEditing
TYPE_CUSTOM, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT
-
Constructor Summary
ConstructorDescriptionDefault constructor for a new IdPattern.IdPattern
(IPatternConfiguration patternConfiguration) Constructor taking some pattern configuration data for the created IdPattern. -
Method Summary
Modifier and TypeMethodDescriptionadd
(IAddContext context) Adds aPictogramElement
representation for the given context to the diagram.boolean
canAdd
(IAddContext context) Checks if adding is possible using this pattern in the given context.boolean
canDirectEdit
(IDirectEditingContext context) Clients can override this method to indicate that the pattern allows direct editing for the shape described in the passedIDirectEditingContext
, but the recommended method to override forIdPattern
iscanDirectEdit(IDirectEditingContext, String)
.protected boolean
canDirectEdit
(IDirectEditingContext context, String id) Clients can override this method to indicate that the pattern allows direct editing for the shape described in the passedIDirectEditingContext
holding the given ID.boolean
canLayout
(ILayoutContext context) Checks if layouting a shape is possible using this pattern in the given context.boolean
canUpdate
(IUpdateContext context) Checks if updating a shape is possible using this pattern in the given context.checkValueValid
(String value, IDirectEditingContext context) This method will be called by the framework to check if the passed String is valid as new value for the shape.protected String
checkValueValid
(String value, IDirectEditingContext context, String id) This method will be called by the framework to check if the passed String is valid as new value for the shape.protected abstract PictogramElement
doAdd
(IAddContext context) Clients should primarily override this method and implement their add functionality here.protected PropertyContainer
findById
(PictogramElement pictogramElement, String idToFind) Deprecated.Use {@link IdPatternHelper.findById(pictogramElement, idToFind)} instead.int
The Graphiti framework calls this method to decide which UI to show up for direct editing.protected String
getId
(PropertyContainer container) Deprecated.Use {@link IdPatternHelper.getId(container)} instead.protected int
getIndex
(PropertyContainer container) Returns any index that has been set for the givenPictogramElement
; it can be anyPropertyContainer
, especiallyShape
s orGraphicsAlgorithm
s are allowed.getInitialValue
(IDirectEditingContext context) Provides the initial value for display in the newly opened text editing UI component.protected String
getInitialValue
(IDirectEditingContext context, String id) Provides the initial value for display in the newly opened text editing UI component.protected boolean
isPatternControlled
(PictogramElement pictogramElement) Checks if thePictogramElement
is controlled by the pattern.protected boolean
isPatternRoot
(PictogramElement pictogramElement) Checks if the givenPictogramElement
is the root object of this pattern.boolean
layout
(ILayoutContext context) Layouts aPictogramElement
representation given in the context.protected abstract boolean
layout
(IdLayoutContext context, String id) Clients should primarily override this method and implement their layout functionality here.protected boolean
layoutGraphicsAlgorithmChildren
(GraphicsAlgorithm graphicsAlgorithm, IdLayoutContext context) This method implements the part of the layout that deals with theGraphicsAlgorithm
children, seelayout(IdLayoutContext)
.protected void
setId
(PropertyContainer container, String id) Deprecated.Use {@link IdPatternHelper.setId(container, id)} instead.protected void
setIndex
(PropertyContainer container, int index) Set the index property (PROPERTY_KEY_ID
) for the givenPictogramElement
; it can be anyPropertyContainer
,especiallyShape
s orGraphicsAlgorithm
s are allowed.void
setValue
(String value, IDirectEditingContext context) Set the new value after direct editing is finished.protected void
setValue
(String value, IDirectEditingContext context, String id) Set the new value after direct editing is finished.boolean
update
(IUpdateContext context) Updates aPictogramElement
representation given in the context.protected boolean
update
(IUpdateContext context, boolean innerCall) Updates aPictogramElement
representation given in the context recursively.protected abstract boolean
update
(IdUpdateContext context, String id) Clients should primarily override this method and implement their update functionality here.protected boolean
updateGraphicsAlgorithmChildren
(GraphicsAlgorithm graphicsAlgorithm, IdUpdateContext context) This method implements the part of the update that deals with theGraphicsAlgorithm
children, seeupdate(IUpdateContext, boolean)
.updateNeeded
(IUpdateContext context) Checks if an updates is needed for aPictogramElement
representation given in the context.protected abstract IReason
updateNeeded
(IdUpdateContext context, String id) Clients should primarily override this method and implement their update check functionality here.protected IReason
updateNeededGraphicsAlgorithmChildren
(GraphicsAlgorithm graphicsAlgorithm, IdUpdateContext context) This method implements the part of the update needed check that deals with theGraphicsAlgorithm
children, seeupdateNeeded(IUpdateContext)
.Methods inherited from class org.eclipse.graphiti.pattern.TypedPattern
getPatternType, setPatternType
Methods inherited from class org.eclipse.graphiti.pattern.AbstractPattern
addGraphicalRepresentation, avoidNegativeCoordinates, canCreate, canDelete, canMoveShape, canRemove, canResizeShape, completeInfo, completeInfo, completeValue, create, createDeleteFeature, createRemoveFeature, delete, getCreateDescription, getCreateImageId, getCreateLargeImageId, getCreateName, getPatternConfiguration, getPossibleValues, getProposalSupport, getResizeConfiguration, getValueProposals, hasDoneChanges, internalMove, isAutoCompletionEnabled, isCompletionAvailable, isDeleteAbort, isMainBusinessObjectApplicable, isPaletteApplicable, isRemoveAbort, layoutPictogramElement, moveAllBendpoints, moveShape, postDelete, postMoveShape, postRemove, preDelete, preMoveShape, preRemove, remove, resizeShape, setPatternConfiguration, stretchFieldToFitText, updatePictogramElement
Methods inherited from class org.eclipse.graphiti.pattern.AbstractBasePattern
getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getFeatureProvider, getMappingProvider, link, link, manageColor, manageColor, manageFont, manageFont, setFeatureProvider
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.graphiti.func.ICreateInfo
getCreateImageId, getCreateLargeImageId
Methods inherited from interface org.eclipse.graphiti.func.IDelete
canDelete, delete, isDeleteAbort, postDelete, preDelete
Methods inherited from interface org.eclipse.graphiti.func.IDirectEditing
completeValue, getPossibleValues, getProposalSupport, getValueProposals, isAutoCompletionEnabled, isCompletionAvailable, stretchFieldToFitText
Methods inherited from interface org.eclipse.graphiti.func.IMoveShape
canMoveShape, moveShape
Methods inherited from interface org.eclipse.graphiti.pattern.IPattern
completeInfo, completeInfo, getCreateDescription, getCreateName, getResizeConfiguration, hasDoneChanges, isMainBusinessObjectApplicable, isPaletteApplicable, setFeatureProvider
Methods inherited from interface org.eclipse.graphiti.func.IRemove
canRemove, isRemoveAbort, postRemove, preRemove, remove
Methods inherited from interface org.eclipse.graphiti.func.IResizeShape
canResizeShape, resizeShape
-
Field Details
-
PROPERTY_VALUE_PATTERN_TYPE_ID
The property key that stores the information that aPictogramElement
is the root object of aIdPattern
subclass. The value is set by theadd(IAddContext)
method.- See Also:
-
PROPERTY_KEY_ID
The property key that is used to tag individualPictogramElement
s with a specific ID to identify them later during e.g. update or layout.- See Also:
-
PROPERTY_KEY_INDEX
The property key that is used to tag individualPictogramElement
s with a specific index beyond the ID to identify them later during e.g. update or layout. This can e.g. be used for lists of shapes like the attributes of a class.- See Also:
-
-
Constructor Details
-
IdPattern
public IdPattern()Default constructor for a new IdPattern. Clients should call either call this or the constructor using aIPatternConfiguration
instance from their subclass constructor. -
IdPattern
Constructor taking some pattern configuration data for the created IdPattern. Clients should call either call this or the null parameter constructor from their subclass constructor.- Parameters:
patternConfiguration
- The configuration data to use
-
-
Method Details
-
isPatternControlled
Checks if thePictogramElement
is controlled by the pattern. The default implementation simply checks if the domain object linked to the givenPictogramElement
is the one that is controlled by this pattern, seeAbstractPattern.isMainBusinessObjectApplicable(Object)
. Especially the default implementation does not traverse up the hierarchy to find a suitable parent.- Specified by:
isPatternControlled
in classAbstractPattern
- Parameters:
pictogramElement
- ThePictogramElement
to check- Returns:
true
in case the pattern controls the givenPictogramElement
,false
otherwise.
-
isPatternRoot
Checks if the givenPictogramElement
is the root object of this pattern. The default implementation checks if the domain object linked to the givenPictogramElement
is the one that is controlled by this pattern, seeAbstractPattern.isMainBusinessObjectApplicable(Object)
. It also checks if the object is controlled by an ID pattern by checking the according property (TypedPattern.PROPERTY_KEY_PATTERN_TYPE
).- Specified by:
isPatternRoot
in classAbstractPattern
- Parameters:
pictogramElement
- ThePictogramElement
to check- Returns:
true
in case the givenPictogramElement
is the root shape of this pattern,false
otherwise.
-
setId
Deprecated.Use {@link IdPatternHelper.setId(container, id)} instead.Set the ID property (PROPERTY_KEY_ID
) for the givenPictogramElement
; it can be anyPropertyContainer
,especiallyShape
s orGraphicsAlgorithm
s are allowed. The used ID string can later be used to identify the shape, e.g. in the update or layout methods.- Parameters:
container
- ThePictogramElement
to set the ID property forid
- TheString
ID to set.
-
getId
Deprecated.Use {@link IdPatternHelper.getId(container)} instead.Returns any ID that has been set for the givenPictogramElement
; it can be anyPropertyContainer
, especiallyShape
s orGraphicsAlgorithm
s are allowed.- Parameters:
container
- ThePictogramElement
to get the ID property from- Returns:
- A
String
representing the value of the property ornull
in case the property is not set, seesetId(PropertyContainer, String)
.
-
findById
Deprecated.Use {@link IdPatternHelper.findById(pictogramElement, idToFind)} instead.Searches for aPictogramElement
that has the given ID starting from the givenPictogramElement
. First the given element is checked, then itsGraphicsAlgorithm
; after that thePictogramElement
children are checked recursively and last theGraphicsAlgorithm
children also recursively. The firstPictogramElement
that has the given ID is returned, in case none is found in the tree spanned by the givenPictogramElement
,null
is returned.- Parameters:
pictogramElement
- ThePictogramElement
at which the search shall start, anyShape
s orGraphicsAlgorithm
s on top of this element are ignored.idToFind
- AString
representing the ID to search for- Returns:
- The
PictogramElement
that has the given ID property, in case none id foundnull
.
-
setIndex
Set the index property (PROPERTY_KEY_ID
) for the givenPictogramElement
; it can be anyPropertyContainer
,especiallyShape
s orGraphicsAlgorithm
s are allowed. The used index can later - together with the ID string - be used to identify the concrete shape in case of a list of shapes, e.g. in the update or layout methods.- Parameters:
container
- ThePictogramElement
to set the index property forid
- TheInteger
index to set.
-
getIndex
Returns any index that has been set for the givenPictogramElement
; it can be anyPropertyContainer
, especiallyShape
s orGraphicsAlgorithm
s are allowed.- Parameters:
container
- ThePictogramElement
to get the index property from- Returns:
- An
Integer
representing the value of the property or -1 in case the property is not set, seesetIndex(PropertyContainer, int)
.
-
canAdd
Checks if adding is possible using this pattern in the given context. The default implementation simply checks if the new object passed in the context is the main domain object for the pattern, seeAbstractPattern.isMainBusinessObjectApplicable(Object)
.- Specified by:
canAdd
in interfaceIAdd
- Specified by:
canAdd
in interfaceIPattern
- Overrides:
canAdd
in classAbstractBasePattern
- Parameters:
context
- AnIAddContext
describing the add operation.- Returns:
true
in case adding is possible,false
otherwise.
-
add
Adds aPictogramElement
representation for the given context to the diagram. The default implementation delegates todoAdd(IAddContext)
(which clients should primarily override) and updates and layouts the returnedPictogramElement
afterwards.- Specified by:
add
in interfaceIAdd
- Specified by:
add
in interfaceIPattern
- Overrides:
add
in classAbstractBasePattern
- Parameters:
context
- AnIAddContext
describing the add operation.- Returns:
- The root object of the created
PictogramElement
tree.
-
doAdd
Clients should primarily override this method and implement their add functionality here. This method is called from withinadd(IAddContext)
.- Parameters:
context
- AnIAddContext
describing the add operation.- Returns:
- The root object of the created
PictogramElement
tree.
-
canLayout
Checks if layouting a shape is possible using this pattern in the given context. The default implementation simply checks if the object passed in the context is the main domain object for the pattern, seeAbstractPattern.isMainBusinessObjectApplicable(Object)
and if thePictogramElement
given in the context is controlled by an ID pattern.- Specified by:
canLayout
in interfaceILayout
- Overrides:
canLayout
in classAbstractPattern
- Parameters:
context
- AnILayoutContext
describing the layout operation.- Returns:
true
in case layouting is possible,false
otherwise.
-
layout
Layouts aPictogramElement
representation given in the context. The default implementation delegates tolayout(IdLayoutContext, String)
(which clients should primarily override) to actually update individualPictogramElement
s. This delegation is done for anyPictogramElement
tagged with an ID in the following order:- The
PictogramElement
given in the context itself - The
GraphicsAlgorithm
of thePictogramElement
in the context - The
PictogramElement
children of thePictogramElement
in the context - The
GraphicsAlgorithm
children of theGraphicsAlgorithm
of thePictogramElement
in the context. For this the methodlayoutGraphicsAlgorithmChildren(GraphicsAlgorithm, IdLayoutContext)
is called which in term calles itself and this method recursively.
- Specified by:
layout
in interfaceILayout
- Overrides:
layout
in classAbstractPattern
- Parameters:
context
- AnILayoutContext
describing the layout operation.- Returns:
true
in case the layout operation did changes to the diagram,false
otherwise.
- The
-
layoutGraphicsAlgorithmChildren
protected boolean layoutGraphicsAlgorithmChildren(GraphicsAlgorithm graphicsAlgorithm, IdLayoutContext context) This method implements the part of the layout that deals with theGraphicsAlgorithm
children, seelayout(IdLayoutContext)
. Clients should primarily overridelayout(IdLayoutContext, String)
which is called for all foundPictogramElement
s andGraphicsAlgorithm
s as described above that have an ID.- Parameters:
graphicsAlgorithm
- TheGraphicsAlgorithm
to layout.context
- AnILayoutContext
describing the layout operation.- Returns:
true
in case the layout operation did changes to the diagram,false
otherwise.
-
layout
Clients should primarily override this method and implement their layout functionality here. This method is called from withinlayout(ILayoutContext)
for each of thePictogramElement
s andGraphicsAlgorithm
s that have been tagged with an ID.- Parameters:
context
- AnIdLayoutContext
describing the layout operation.- Returns:
true
in case the layout operation did changes to the diagram,false
otherwise.
-
canUpdate
Checks if updating a shape is possible using this pattern in the given context. The default implementation simply checks if the object passed in the context is the main domain object for the pattern, seeAbstractPattern.isMainBusinessObjectApplicable(Object)
and if thePictogramElement
given in the context is controlled by an ID pattern.- Specified by:
canUpdate
in interfaceIUpdate
- Overrides:
canUpdate
in classAbstractPattern
- Parameters:
context
- AnIUpdateContext
describing the update operation.- Returns:
true
in case updating is possible,false
otherwise.
-
updateNeeded
Checks if an updates is needed for aPictogramElement
representation given in the context. The default implementation delegates toupdateNeeded(IdUpdateContext, String)
(which clients should primarily override) to actually update individualPictogramElement
s. This delegation is done for anyPictogramElement
tagged with an ID in the following order:- The
PictogramElement
given in the context itself - The
GraphicsAlgorithm
of thePictogramElement
in the context - The
PictogramElement
children of thePictogramElement
in the context - The
GraphicsAlgorithm
children of theGraphicsAlgorithm
of thePictogramElement
in the context. For this the methodupdateNeededGraphicsAlgorithmChildren(GraphicsAlgorithm, IdUpdateContext)
is called which in term calls itself and this method recursively.
- Specified by:
updateNeeded
in interfaceIUpdate
- Overrides:
updateNeeded
in classAbstractPattern
- Parameters:
context
- AnIUpdateContext
describing the update operation.- Returns:
- An
IReason
indicatingtrue
and aString
reason in case the update operation is needed, anIReason
indicatingfalse
otherwise.
- The
-
updateNeededGraphicsAlgorithmChildren
protected IReason updateNeededGraphicsAlgorithmChildren(GraphicsAlgorithm graphicsAlgorithm, IdUpdateContext context) This method implements the part of the update needed check that deals with theGraphicsAlgorithm
children, seeupdateNeeded(IUpdateContext)
. Clients should primarily overrideupdateNeeded(IdUpdateContext, String)
which is called for all foundPictogramElement
s andGraphicsAlgorithm
s as described above that have an ID.- Parameters:
graphicsAlgorithm
- TheGraphicsAlgorithm
to perform the update check for.context
- AnIdUpdateContext
describing the update operation.- Returns:
- An
IReason
indicatingtrue
and aString
reason in case the update operation is needed, anIReason
indicatingfalse
otherwise.
-
updateNeeded
Clients should primarily override this method and implement their update check functionality here. This method is called from withinupdateNeeded(IUpdateContext)
for each of thePictogramElement
s andGraphicsAlgorithm
s that have been tagged with an ID.- Parameters:
context
- AnIdUpdateContext
describing the update operation.- Returns:
- An
IReason
indicatingtrue
and aString
reason in case the update operation is needed, anIReason
indicatingfalse
otherwise.
-
update
Updates aPictogramElement
representation given in the context. The default implementation only delegates toupdate(IUpdateContext, boolean)
setting the parameter innerCall tofalse
.- Specified by:
update
in interfaceIUpdate
- Overrides:
update
in classAbstractPattern
- Parameters:
context
- AnIUpdateContext
describing the update operation.- Returns:
true
in case the update operation did changes to the diagram,false
otherwise.
-
update
Updates aPictogramElement
representation given in the context recursively. The default implementation delegates toupdate(IdUpdateContext, String)
(which clients should primarily override) to actually update individualPictogramElement
s. This delegation is done for anyPictogramElement
tagged with an ID in the following order:- The
PictogramElement
given in the context itself - The
GraphicsAlgorithm
of thePictogramElement
in the context - The
PictogramElement
children of thePictogramElement
in the context - The
GraphicsAlgorithm
children of theGraphicsAlgorithm
of thePictogramElement
in the context. For this the methodupdateGraphicsAlgorithmChildren(GraphicsAlgorithm, IdUpdateContext)
is called which in term calls itself and this method recursively.
- Parameters:
context
- AnIUpdateContext
describing the update operation.- Returns:
true
in case the update operation did changes to the diagram,false
otherwise.
- The
-
updateGraphicsAlgorithmChildren
protected boolean updateGraphicsAlgorithmChildren(GraphicsAlgorithm graphicsAlgorithm, IdUpdateContext context) This method implements the part of the update that deals with theGraphicsAlgorithm
children, seeupdate(IUpdateContext, boolean)
. Clients should primarily overrideupdate(IdUpdateContext, String)
which is called for all foundPictogramElement
s andGraphicsAlgorithm
s as described above that have an ID.- Parameters:
graphicsAlgorithm
- TheGraphicsAlgorithm
to update.context
- AnIdUpdateContext
describing the update operation.- Returns:
true
in case the update operation did changes to the diagram,false
otherwise.
-
update
Clients should primarily override this method and implement their update functionality here. This method is called from withinupdate(IUpdateContext, boolean)
for each of thePictogramElement
s andGraphicsAlgorithm
s that have been tagged with an ID.- Parameters:
context
- AnIdUpdateContext
describing the update operation.- Returns:
true
in case the update operation did changes to the diagram,false
otherwise.
-
getEditingType
public int getEditingType()The Graphiti framework calls this method to decide which UI to show up for direct editing. Corresponds to the methodIDirectEditing.getEditingType()
. The default implementation returnIDirectEditing.TYPE_NONE
, other valid type are defined by the TYPE_* constants inIDirectEditing
.- Specified by:
getEditingType
in interfaceIDirectEditing
- Overrides:
getEditingType
in classAbstractPattern
- Returns:
- The desired editing type
-
canDirectEdit
Clients can override this method to indicate that the pattern allows direct editing for the shape described in the passedIDirectEditingContext
, but the recommended method to override forIdPattern
iscanDirectEdit(IDirectEditingContext, String)
. Corresponds to the methodAbstractDirectEditingFeature.canDirectEdit(IDirectEditingContext)
. The default implementation checks if the pattern is responsible for the shape and an ID is set; in that case it delegates tocanDirectEdit(IDirectEditingContext, String)
.- Specified by:
canDirectEdit
in interfaceIDirectEditing
- Overrides:
canDirectEdit
in classAbstractPattern
- Parameters:
context
- A context object describing the direct edit request.- Returns:
true
in case direct editing shall be allowed,false
otherwise.- See Also:
-
canDirectEdit
Clients can override this method to indicate that the pattern allows direct editing for the shape described in the passedIDirectEditingContext
holding the given ID. Corresponds to the methodAbstractDirectEditingFeature.canDirectEdit(IDirectEditingContext)
. The default implementation simply returnsfalse
.- Parameters:
context
- A context object describing the direct edit request.id
- The ID to check direct editing for- Returns:
true
in case direct editing shall be allowed,false
otherwise.
-
getInitialValue
Provides the initial value for display in the newly opened text editing UI component. Corresponds to the methodIDirectEditing.getInitialValue(IDirectEditingContext)
. The default implementation checks if the pattern is responsible for the shape and an ID is set; in that case it delegates togetInitialValue(IDirectEditingContext, String)
.- Specified by:
getInitialValue
in interfaceIDirectEditing
- Overrides:
getInitialValue
in classAbstractPattern
- Parameters:
context
- A context object describing the direct edit request.- Returns:
- The initial string value to be displayed for editing by the user.
-
getInitialValue
Provides the initial value for display in the newly opened text editing UI component. Corresponds to the methodIDirectEditing.getInitialValue(IDirectEditingContext)
. The default implementation always returns an empty string.- Parameters:
context
- A context object describing the direct edit request.id
- The ID of the shape to get the initial value for- Returns:
- The initial string value to be displayed for editing by the user.
-
checkValueValid
This method will be called by the framework to check if the passed String is valid as new value for the shape. This method's response time should be small since the method is queried after each change of the value in the direct edit UI. In case of a not valid value, the returned string shall indicate the reason why the value is not valid. Corresponds to the methodAbstractDirectEditingFeature.checkValueValid(String, IDirectEditingContext)
. The default implementation checks if the pattern is responsible for the shape and an ID is set; in that case it delegates tocheckValueValid(String, IDirectEditingContext, String)
.- Specified by:
checkValueValid
in interfaceIDirectEditing
- Overrides:
checkValueValid
in classAbstractPattern
- Parameters:
value
- The new value to checkcontext
- A context object describing the direct edit request.- Returns:
null
in case of a valid value, a string describing the reason for being not valid otherwise.
-
checkValueValid
This method will be called by the framework to check if the passed String is valid as new value for the shape. This method's response time should be small since the method is queried after each change of the value in the direct edit UI. The default implementation simply returns null to indicate that all values are valid. In case of a not valid value, the returned string shall indicate the reason why the value is not valid. Corresponds to the methodAbstractDirectEditingFeature.checkValueValid(String, IDirectEditingContext)
.- Parameters:
value
- The new value to checkcontext
- A context object describing the direct edit request.id
- The ID of the shape to check the value for- Returns:
null
in case of a valid value, a string describing the reason for being not valid otherwise.
-
setValue
Set the new value after direct editing is finished. The value comes from the text editing UI component. Corresponds to the methodAbstractDirectEditingFeature.setValue(String, IDirectEditingContext)
. The default implementation checks if the pattern is responsible for the shape and an ID is set; in that case it delegates tosetValue(String, IDirectEditingContext, String)
.- Specified by:
setValue
in interfaceIDirectEditing
- Overrides:
setValue
in classAbstractPattern
- Parameters:
value
- The new value to be setcontext
- A context object describing the direct edit request.
-
setValue
Set the new value after direct editing is finished. The value comes from the text editing UI component. Corresponds to the methodAbstractDirectEditingFeature.setValue(String, IDirectEditingContext)
. The default implementation does nothing.- Parameters:
value
- The new value to be setcontext
- A context object describing the direct edit request.id
- The ID of the shape to set the value for
-