org.eclipse.graphiti.features.impl
Class DefaultUpdateDiagramFeature
java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.AbstractUpdateFeature
org.eclipse.graphiti.features.impl.DefaultUpdateDiagramFeature
- All Implemented Interfaces:
- IFeature, IFeatureProviderHolder, IUpdateFeature, IUpdate, IDescription, IName
public class DefaultUpdateDiagramFeature
- extends AbstractUpdateFeature
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.
Method Summary |
boolean |
canUpdate(IUpdateContext context)
Checks whether the values of the current pictogram element of the given
context can be updated. |
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 |
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.AbstractFeature |
addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getDiagramEditor, getFeatureProvider, getProgressCallback, getUserDecision, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString |
hasDoneChanges
private boolean hasDoneChanges
DefaultUpdateDiagramFeature
public DefaultUpdateDiagramFeature(IFeatureProvider fp)
- Creates a new
DefaultUpdateDiagramFeature
.
- Parameters:
fp
- the feature provider
canUpdate
public boolean canUpdate(IUpdateContext context)
- Description copied from interface:
IUpdate
- Checks whether the values of the current pictogram element of the given
context can be updated.
- Parameters:
context
- the context
- Returns:
- true if update is possible
update
public boolean update(IUpdateContext context)
- Description copied from interface:
IUpdate
- Updates the pictogram element. It copies the latest values from the
business model to the graphics algorithm of this pictogram elements.
- Parameters:
context
- the context
- Returns:
- true, if update process was successfull
updateNeeded
public IReason updateNeeded(IUpdateContext context)
- Description copied from interface:
IUpdate
- 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.
- Parameters:
context
- the context
- Returns:
- true if parts of the pictogram model needs to be updated with the
latest values from the business model
hasDoneChanges
public boolean hasDoneChanges()
- Description copied from interface:
IFeature
- 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. an editor. By
default all features should appear there (see implementation in
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.
- Specified by:
hasDoneChanges
in interface IFeature
- Overrides:
hasDoneChanges
in class AbstractFeature
- Returns:
true
if the feature should appear in the undo stack,
false
otherwise
Copyright (c) SAP AG 2005, 2012.