|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.AbstractUpdateFeature
org.eclipse.graphiti.features.impl.DefaultUpdateDiagramFeature
public class DefaultUpdateDiagramFeature
The Class DefaultUpdateDiagramFeature. Updates the shapes directly contained in the diagram. Does not update the connections contained in the diagram, since in many cases the connections get already updated by the shapes they belong to.
Field Summary | |
---|---|
private boolean |
hasDoneChanges
|
Constructor Summary | |
---|---|
DefaultUpdateDiagramFeature(IFeatureProvider fp)
Creates a new DefaultUpdateDiagramFeature . |
Method Summary | |
---|---|
boolean |
canRedo(IContext context)
Decides if the processed feature can be re-done. |
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the execute operation. |
boolean |
canUpdate(IUpdateContext context)
Checks whether the values of the current pictogram element of the given context can be updated. |
protected Map<IUpdateFeature,IUpdateContext> |
findFeaturesToUpdateChildren(PictogramElement pe,
boolean checkUpdateNeeded)
|
boolean |
hasDoneChanges()
Is queried by the framework after a feature has been executed to find out if this feature should appear in the undo stack of e.g. |
boolean |
isAbort()
The Graphiti framework will call this method after ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext) /
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. |
void |
postRedo(IContext context)
This method will be called by the Graphiti framework after the EMF undo has finished. |
void |
postUndo(IContext context)
This method will be called by the Graphiti framework after the EMF undo is finished. |
void |
preRedo(IContext context)
This method will be called by the Graphiti framework before the EMF undo has triggered. |
void |
preUndo(IContext context)
This method will be called by the Graphiti framework before the EMF undo is triggered. |
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. |
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractUpdateFeature |
---|
canExecute, canUpdatePictogramElement, execute, getDescription, getName, resizeShape, updatePictogramElement, updatePictogramElementNeeded |
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature |
---|
addGraphicalRepresentation, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.graphiti.features.IFeature |
---|
isAvailable |
Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder |
---|
getFeatureProvider |
Field Detail |
---|
private boolean hasDoneChanges
Constructor Detail |
---|
public DefaultUpdateDiagramFeature(IFeatureProvider fp)
DefaultUpdateDiagramFeature
.
fp
- the feature providerMethod Detail |
---|
public boolean canUpdate(IUpdateContext context)
IUpdate
canUpdate
in interface IUpdate
context
- the context
public boolean update(IUpdateContext context)
IUpdate
update
in interface IUpdate
context
- the context
public IReason updateNeeded(IUpdateContext context)
IUpdate
updateNeeded
in interface IUpdate
context
- the context
public boolean hasDoneChanges()
IFeature
AbstractFeature
), but features may decide to override this
behavior. Note that this is a dynamic attribute of the feature that is
queried each time after the feature has been executed.
IMPORTANT NOTE: The implementor of the feature is responsible for
correctly implementing this method! It might lead to inconsistencies in
the command stack if this method returns false
although the
feature did changes.
hasDoneChanges
in interface IFeature
hasDoneChanges
in class AbstractFeature
true
if the feature should appear in the undo stack,
false
otherwisepublic boolean canUndo(IContext context)
IFeature
canUndo
in interface ICustomUndoRedoFeature
canUndo
in interface IFeature
canUndo
in class AbstractFeature
context
- this is the general input for this method
IContext
public void preUndo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.postUndo(IContext)
.
preUndo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic void postUndo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preUndo(IContext)
.
postUndo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic boolean canRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preRedo(IContext)
.
Note that as soon as any feature reports false
here, also
all consecutive entries in the command stack are no longer reachable for
redo.
canRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the feature
public void preRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.postRedo(IContext)
. (Usually it might be
sufficient to delegate to the execution method of the feature.)
preRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic void postRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preRedo(IContext)
. (Usually it might be
sufficient to delegate to the execution method of the feature.)
postRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic boolean isAbort()
ICustomAbortableUndoRedoFeature
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)
/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)
have
been called and before the actual undo/redo operation is triggered. In
case this method returns true
, the operation will be
cancelled by the Graphiti framework by throwing an
OperationCanceledException
that causes am EMF revert of the
operation.
Implementing classes might e.g. set a flag in
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)
/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)
as
cancellation indication and check that that flag here.
isAbort
in interface ICustomAbortableUndoRedoFeature
true
in case you want to cancel the current
operation, false
otherwise.protected Map<IUpdateFeature,IUpdateContext> findFeaturesToUpdateChildren(PictogramElement pe, boolean checkUpdateNeeded)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |