|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.graphiti.pattern.AbstractBasePattern
org.eclipse.graphiti.pattern.AbstractPattern
public abstract class AbstractPattern
The Class AbstractPattern.
| Field Summary | |
|---|---|
protected static java.lang.String[] |
EMPTY_STRING_ARRAY
An empty string array used in direct editing. |
private IPatternConfiguration |
patternConfiguration
|
private IDeleteFeature |
wrappedDeleteFeature
To avoid code duplication, this base class uses a wrapped default implementation of an IDeleteFeature to provide the default
deletion behaviour. |
private IRemoveFeature |
wrappedRemoveFeature
To avoid code duplication, this base class uses a wrapped default implementation of an IRemoveFeature to provide the default
removal behavior. |
| Fields inherited from interface org.eclipse.graphiti.func.ICreate |
|---|
EMPTY |
| Fields inherited from interface org.eclipse.graphiti.func.IDirectEditing |
|---|
TYPE_CHECK, TYPE_COLOR, TYPE_DIALOG, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT |
| Constructor Summary | |
|---|---|
AbstractPattern(IPatternConfiguration patternConfiguration)
Creates a new AbstractPattern. |
|
| Method Summary | |
|---|---|
protected void |
addGraphicalRepresentation(IAreaContext context,
java.lang.Object newObject)
Adds the graphical representation. |
protected boolean |
avoidNegativeCoordinates()
|
boolean |
canCreate(ICreateContext context)
Checks if business object can be created for the given context. |
boolean |
canDelete(IDeleteContext context)
Can delete. |
boolean |
canDirectEdit(IDirectEditingContext context)
Checks if the feature can perform direct editing on the context handed over. |
boolean |
canLayout(ILayoutContext context)
Checks whether the current pictogram element of the given context can be layouted. |
boolean |
canMoveShape(IMoveShapeContext context)
Can move shape. |
boolean |
canRemove(IRemoveContext context)
Checks if given object could be removed. |
boolean |
canResizeShape(IResizeShapeContext context)
Can resize shape. |
boolean |
canUpdate(IUpdateContext context)
Checks whether the values of the current pictogram element of the given context can be updated. |
java.lang.String |
checkValueValid(java.lang.String value,
IDirectEditingContext context)
This method will be called by clients many times to see if current value is valid and could be set. |
void |
completeInfo(IDirectEditingInfo info,
java.lang.Object bo)
Complete the directEditing info. |
void |
completeInfo(IDirectEditingInfo info,
java.lang.Object bo,
java.lang.String keyProperty)
Complete the directEditing info. |
java.lang.String |
completeValue(java.lang.String value,
int caretPos,
java.lang.String choosenValue,
IDirectEditingContext context)
Framework calls this method to let the feature calculate the new value. |
java.lang.Object[] |
create(ICreateContext context)
Creates the business object for the given context. |
protected IDeleteFeature |
createDeleteFeature(IDeleteContext context)
Creates the IDeleteFeature instance that handles the deletion of
business objects and diagram elements. |
protected IRemoveFeature |
createRemoveFeature(IRemoveContext context)
Creates the IRemoveFeature instance that handles the removal of
diagram elements. |
void |
delete(IDeleteContext context)
Delete. |
private java.util.List<Anchor> |
getAnchors(ContainerShape containerShape)
|
java.lang.String |
getCreateDescription()
Gets the create description. |
java.lang.String |
getCreateImageId()
Gets the create image id. |
java.lang.String |
getCreateLargeImageId()
Gets the create large image id. |
java.lang.String |
getCreateName()
Gets the create name. |
int |
getEditingType()
Framework calls this method to decide which UI to show up. |
protected java.lang.String |
getImage(IStructureMapping structureMapping,
PictogramLink link)
Gets the image. |
java.lang.String |
getInitialValue(IDirectEditingContext context)
Provides the initial value for the opened text editing UI component. |
protected IPatternConfiguration |
getPatternConfiguration()
Gets the pattern configuration. |
java.lang.String[] |
getPossibleValues(IDirectEditingContext context)
This value will be used if the cell editor is a combo box. |
IProposalSupport |
getProposalSupport()
The direct editing mode contains controls for code completion and the selection from a combo box. |
IResizeConfiguration |
getResizeConfiguration(IResizeShapeContext context)
Provides configuration object, which describes the resize behavior. |
protected java.lang.String |
getText(IStructureMapping structureMapping,
PictogramLink link)
Gets the text. |
java.lang.String[] |
getValueProposals(java.lang.String value,
int caretPos,
IDirectEditingContext context)
This proposals will be used for the completion list of a simple text cell editor. |
protected void |
internalMove(IMoveShapeContext context)
Internal move. |
boolean |
isAutoCompletionEnabled()
Checks if auto completion is enabled. |
boolean |
isCompletionAvailable()
Checks if completion is available. |
abstract boolean |
isMainBusinessObjectApplicable(java.lang.Object mainBusinessObject)
This method must be implemented by the pattern user. |
boolean |
isPaletteApplicable()
Determines whether the pattern supports the creation of new business objects from the palette. |
protected abstract boolean |
isPatternControlled(PictogramElement pictogramElement)
This method must be implemented by the pattern developer / provider. |
protected abstract boolean |
isPatternRoot(PictogramElement pictogramElement)
This method must be implemented by the pattern developer / provider. |
boolean |
layout(ILayoutContext context)
Layoutes the pictogram element. |
protected void |
layoutPictogramElement(PictogramElement pe)
Layout pictogram element. |
protected void |
moveAllBendpoints(IMoveShapeContext context)
Move all bendpoints within a container shape. |
void |
moveShape(IMoveShapeContext context)
Move shape. |
void |
postDelete(IDeleteContext context)
Post delete. |
protected void |
postMoveShape(IMoveShapeContext context)
Post move shape. |
void |
postRemove(IRemoveContext context)
called after remove call. |
void |
preDelete(IDeleteContext context)
Pre delete. |
protected void |
preMoveShape(IMoveShapeContext context)
Pre move shape. |
void |
preRemove(IRemoveContext context)
called prior to remove call. |
void |
remove(IRemoveContext context)
Remove the given object. |
void |
resizeShape(IResizeShapeContext context)
Resize shape. |
protected void |
setPatternConfiguration(IPatternConfiguration patternConfiguration)
Sets the pattern configuration. |
void |
setValue(java.lang.String value,
IDirectEditingContext context)
Set the new value. |
boolean |
stretchFieldToFitText()
Stretch input field to fit its contents. |
boolean |
update(IUpdateContext context)
Updates the pictogram element. |
IReason |
updateNeeded(IUpdateContext context)
Check whether the values in the pictogram element are up to date, that means whether the graphics algorithm of this pictogram element contain the latest values from the business objects. |
protected void |
updatePictogramElement(PictogramElement pe)
Update pictogram element. |
| Methods inherited from class org.eclipse.graphiti.pattern.AbstractBasePattern |
|---|
add, canAdd, getBusinessObjectForPictogramElement, getDiagram, getDiagramEditor, getFeatureProvider, getMappingProvider, link, link, manageColor, manageColor, 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.pattern.IPattern |
|---|
add, canAdd, setFeatureProvider |
| Field Detail |
|---|
protected static final java.lang.String[] EMPTY_STRING_ARRAY
private IPatternConfiguration patternConfiguration
private IDeleteFeature wrappedDeleteFeature
IDeleteFeature to provide the default
deletion behaviour. Subclasses may decide to either override
createDeleteFeature(IDeleteContext) to provide another
IDeleteFeature implementation or override and extend the
individual IDelete methods or return a IDeleteFeature by
overriding the method
DefaultFeatureProviderWithPatterns.getDeleteFeature(IDeleteContext)
.
private IRemoveFeature wrappedRemoveFeature
IRemoveFeature to provide the default
removal behavior. Subclasses may decide to either override
createRemoveFeature(IRemoveContext) to provide another
IRemoveFeature implementation or override and extend the
individual IRemove methods or return a IRemoveFeature by
overriding the method
DefaultFeatureProviderWithPatterns.getRemoveFeature(IRemoveContext)
.
| Constructor Detail |
|---|
public AbstractPattern(IPatternConfiguration patternConfiguration)
AbstractPattern.
patternConfiguration - the pattern configuration| Method Detail |
|---|
public boolean isPaletteApplicable()
IPatternfalse will
suppress the creation of a palette item for this pattern.
isPaletteApplicable in interface IPatterntrue if the pattern supports the ICreate
methods and a palette item should be generatedpublic boolean canCreate(ICreateContext context)
ICreate
canCreate in interface ICreatecontext - the context
public boolean canLayout(ILayoutContext context)
ILayout
canLayout in interface ILayoutcontext - the context
public boolean canMoveShape(IMoveShapeContext context)
IMoveShape
canMoveShape in interface IMoveShapecontext - the context
public boolean canResizeShape(IResizeShapeContext context)
IResizeShape
canResizeShape in interface IResizeShapecontext - the context
public boolean canUpdate(IUpdateContext context)
IUpdate
canUpdate in interface IUpdatecontext - the context
public java.lang.Object[] create(ICreateContext context)
ICreate
create in interface ICreatecontext - the context
public java.lang.String getCreateDescription()
IPattern
getCreateDescription in interface ICreateInfogetCreateDescription in interface IPatternpublic java.lang.String getCreateImageId()
ICreateInfo
getCreateImageId in interface ICreateInfopublic java.lang.String getCreateLargeImageId()
ICreateInfo
getCreateLargeImageId in interface ICreateInfopublic java.lang.String getCreateName()
IPattern
getCreateName in interface ICreateInfogetCreateName in interface IPatternpublic abstract boolean isMainBusinessObjectApplicable(java.lang.Object mainBusinessObject)
IPattern
isMainBusinessObjectApplicable in interface IPatternmainBusinessObject - the main business object
public boolean layout(ILayoutContext context)
ILayout
layout in interface ILayoutcontext - the context
public final void moveShape(IMoveShapeContext context)
IMoveShape
moveShape in interface IMoveShapecontext - the contextprotected void postMoveShape(IMoveShapeContext context)
context - the move shape contextprotected void preMoveShape(IMoveShapeContext context)
context - the move shape contextprotected void internalMove(IMoveShapeContext context)
context - the move shape contextprotected void moveAllBendpoints(IMoveShapeContext context)
context - the move shape contextprivate java.util.List<Anchor> getAnchors(ContainerShape containerShape)
public void resizeShape(IResizeShapeContext context)
IResizeShape
resizeShape in interface IResizeShapecontext - the contextpublic boolean update(IUpdateContext context)
IUpdate
update in interface IUpdatecontext - the context
public IReason updateNeeded(IUpdateContext context)
IUpdate
updateNeeded in interface IUpdatecontext - the context
protected void addGraphicalRepresentation(IAreaContext context,
java.lang.Object newObject)
context - the area contextnewObject - the new objectprotected boolean avoidNegativeCoordinates()
protected java.lang.String getImage(IStructureMapping structureMapping,
PictogramLink link)
structureMapping - the structure mappinglink - the pictogram link
protected java.lang.String getText(IStructureMapping structureMapping,
PictogramLink link)
structureMapping - the structure mappinglink - the pictogram link
protected abstract boolean isPatternControlled(PictogramElement pictogramElement)
pictogramElement - the pictogram element
protected abstract boolean isPatternRoot(PictogramElement pictogramElement)
pictogramElement - the pictogram element
protected void layoutPictogramElement(PictogramElement pe)
pe - the pictogram elementprotected void updatePictogramElement(PictogramElement pe)
pe - the pictogram elementprotected void setPatternConfiguration(IPatternConfiguration patternConfiguration)
patternConfiguration - the new patternConfigurationprotected IPatternConfiguration getPatternConfiguration()
public void completeInfo(IDirectEditingInfo info,
java.lang.Object bo)
IPattern
completeInfo in interface IPatterninfo - the directEditing infobo - the business object
public void completeInfo(IDirectEditingInfo info,
java.lang.Object bo,
java.lang.String keyProperty)
IPattern
completeInfo in interface IPatterninfo - the directEditing infobo - the business objectkeyProperty - the key propertypublic IResizeConfiguration getResizeConfiguration(IResizeShapeContext context)
IPattern
getResizeConfiguration in interface IPatterncontext - the resizing context
protected IDeleteFeature createDeleteFeature(IDeleteContext context)
IDeleteFeature instance that handles the deletion of
business objects and diagram elements. The default implementation just
creates a DefaultDeleteFeature. Concrete pattern implementations
may either override this method to provide their own subclass of
DefaultDeleteFeature or override and extend the individual
methods provided by IDelete.
context - the deletion context
IDeleteFeature instance to use for this patterncanDelete(IDeleteContext),
preDelete(IDeleteContext),
delete(IDeleteContext),
postDelete(IDeleteContext)public boolean canDelete(IDeleteContext context)
IDelete
canDelete in interface IDeletecontext - the context
public void preDelete(IDeleteContext context)
IDelete
preDelete in interface IDeletecontext - the contextpublic void delete(IDeleteContext context)
IDelete
delete in interface IDeletecontext - the contextpublic void postDelete(IDeleteContext context)
IDelete
postDelete in interface IDeletecontext - the contextprotected IRemoveFeature createRemoveFeature(IRemoveContext context)
IRemoveFeature instance that handles the removal of
diagram elements. The default implementation just creates a
DefaultRemoveFeature. Concrete pattern implementations may either
override this method to provide their own subclass of
DefaultRemoveFeature or override and extend the individual
methods provided by IRemove.
context - the removal context
IRemoveFeature instance to use for this patterncanRemove(IRemoveContext),
preRemove(IRemoveContext),
#Remove(IRemoveContext),
postRemove(IRemoveContext)public boolean canRemove(IRemoveContext context)
IRemove
canRemove in interface IRemovecontext - contains object to remove
public void preRemove(IRemoveContext context)
IRemove
preRemove in interface IRemovecontext - the contextpublic void remove(IRemoveContext context)
IRemove
remove in interface IRemovecontext - contains object to removepublic void postRemove(IRemoveContext context)
IRemove
postRemove in interface IRemovecontext - the contextpublic boolean canDirectEdit(IDirectEditingContext context)
IDirectEditing
canDirectEdit in interface IDirectEditingcontext - the context
IDirecEditingFeature.canExecute()
public java.lang.String checkValueValid(java.lang.String value,
IDirectEditingContext context)
IDirectEditing
checkValueValid in interface IDirectEditingvalue - the valuecontext - the context
public java.lang.String completeValue(java.lang.String value,
int caretPos,
java.lang.String choosenValue,
IDirectEditingContext context)
IDirectEditing
completeValue in interface IDirectEditingvalue - current valuecaretPos - current cursor positionchoosenValue - value choosen by usercontext - the context
public java.lang.String[] getPossibleValues(IDirectEditingContext context)
IDirectEditing
getPossibleValues in interface IDirectEditingcontext - the context
public java.lang.String[] getValueProposals(java.lang.String value,
int caretPos,
IDirectEditingContext context)
IDirectEditing
getValueProposals in interface IDirectEditingvalue - current valuecaretPos - current cursor positioncontext - the context
public boolean isAutoCompletionEnabled()
IDirectEditing
isAutoCompletionEnabled in interface IDirectEditingpublic boolean isCompletionAvailable()
IDirectEditing
isCompletionAvailable in interface IDirectEditingpublic boolean stretchFieldToFitText()
IDirectEditing
stretchFieldToFitText in interface IDirectEditingpublic int getEditingType()
IDirectEditing
getEditingType in interface IDirectEditingpublic java.lang.String getInitialValue(IDirectEditingContext context)
IDirectEditing
getInitialValue in interface IDirectEditingcontext - the context
public void setValue(java.lang.String value,
IDirectEditingContext context)
IDirectEditing
setValue in interface IDirectEditingvalue - the valuecontext - the contextpublic IProposalSupport getProposalSupport()
IDirectEditing
If the customer wants to work with Objects he must provide an
implementation of IProposalSupport. In this case the following
methods of IDirectEditing are ignored:
* String checkValueValid(String value, IDirectEditingContext context);
* String completeValue(String value, int caretPosition, String choosenValue, IDirectEditingContext context);
* String[] getPossibleValues(IDirectEditingContext context);
* String[] getValueProposals(String value, int caretPosition, IDirectEditingContext context);
* void setValue(String value, IDirectEditingContext context);
getProposalSupport in interface IDirectEditing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||