Package org.eclipse.graphiti.pattern
Interface IPattern
- All Superinterfaces:
IAdd
,ICreate
,ICreateInfo
,IDelete
,IDirectEditing
,ILayout
,IMoveShape
,IRemove
,IResizeShape
,IUpdate
- All Known Implementing Classes:
AbstractPattern
,IdPattern
,TypedPattern
public interface IPattern
extends ICreate, IAdd, IDelete, IRemove, IUpdate, ILayout, IResizeShape, IMoveShape, IDirectEditing
The Interface IPattern marks a pattern for handling shapes. Please see the
information in
AbstractPattern
.-
Field Summary
Fields inherited from interface org.eclipse.graphiti.func.IDirectEditing
TYPE_CUSTOM, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT
-
Method Summary
Modifier and TypeMethodDescriptionadd
(IAddContext context) Clients must override this method to provide the functionality to add an existing domain object to a diagram.boolean
canAdd
(IAddContext context) Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram.void
completeInfo
(IDirectEditingInfo info, Object bo) Complete the directEditing info.void
completeInfo
(IDirectEditingInfo info, Object bo, String keyProperty) Complete the directEditing info.Gets the create description.Gets the create name.Provides configuration object, which describes the resize behavior.boolean
hasDoneChanges
(Class<?> actionType) Is queried by the framework after a pattern has been executed to find out if this pattern should appear in the undo stack.boolean
isMainBusinessObjectApplicable
(Object mainBusinessObject) This method must be implemented by the pattern user.boolean
Determines whether the pattern supports the creation of new business objects from the palette.void
Sets the feature provider.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
canDirectEdit, checkValueValid, completeValue, getEditingType, getInitialValue, getPossibleValues, getProposalSupport, getValueProposals, isAutoCompletionEnabled, isCompletionAvailable, setValue, stretchFieldToFitText
Methods inherited from interface org.eclipse.graphiti.func.IMoveShape
canMoveShape, moveShape
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
Methods inherited from interface org.eclipse.graphiti.func.IUpdate
canUpdate, update, updateNeeded
-
Method Details
-
isPaletteApplicable
boolean isPaletteApplicable()Determines whether the pattern supports the creation of new business objects from the palette. Setting this tofalse
will suppress the creation of a palette item for this pattern.- Returns:
true
if the pattern supports theICreate
methods and a palette item should be generated
-
getCreateName
String getCreateName()Gets the create name.- Specified by:
getCreateName
in interfaceICreateInfo
- Returns:
- name for UI representation
-
getCreateDescription
String getCreateDescription()Gets the create description.- Specified by:
getCreateDescription
in interfaceICreateInfo
- Returns:
- description for UI representation
-
setFeatureProvider
Sets the feature provider.- Parameters:
fp
- the new feature provider
-
isMainBusinessObjectApplicable
This method must be implemented by the pattern user. The main pictogram element of the pattern is linked with the main business object.- Parameters:
mainBusinessObject
- the main business object- Returns:
- True, if this pattern is responsible for the main business object
-
completeInfo
Complete the directEditing info. This information is needed to switch automatically into the direct editing mode. (e.g. after creation of a new object)- Parameters:
info
- the directEditing infobo
- the business object
-
completeInfo
Complete the directEditing info. This information is needed to switch automatically into the direct editing mode. (e.g. after creation of a new object)- Parameters:
info
- the directEditing infobo
- the business objectkeyProperty
- the key property
-
add
Clients must override this method to provide the functionality to add an existing domain object to a diagram. Corresponds to theIAdd.add(IAddContext)
method. The default implementation simply does nothing and returnsnull
. -
canAdd
Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram. Corresponds to theIAdd.canAdd(IAddContext)
method. The default implementation simply returnsfalse
. -
getResizeConfiguration
Provides configuration object, which describes the resize behavior.- Parameters:
context
- the resizing context- Returns:
- the resize configuration object
-
hasDoneChanges
Is queried by the framework after a pattern has been executed to find out if this pattern should appear in the undo stack. By default all patterns should appear there (see implementation in AbstractPattern), but single pattern may decide to override this behavior. Note that this is a dynamic attribute of the pattern that is queried each time after the pattern has been executed.IMPORTANT NOTE: The implementor of the feature is responsible for correctly implementing this method! It will lead to inconsistencies if this method returns
false
although the pattern did changes.- Parameters:
actionType
- the followings types are currently supported:IDelete.class, IRemove.class
- Returns:
true
if the last action of the pattern from this action type should appear in the undo stack,false
otherwise- Since:
- 0.9
-