org.eclipse.graphiti.features
Interface IFeature
- All Superinterfaces:
- IDescription, IFeatureProviderHolder, IName
- All Known Subinterfaces:
- IAddBendpointFeature, IAddFeature, ICopyFeature, ICreateConnectionFeature, ICreateFeature, ICustomFeature, IDeleteFeature, IDirectEditingFeature, ILayoutFeature, IMoveAnchorFeature, IMoveBendpointFeature, IMoveConnectionDecoratorFeature, IMoveFeature, IMoveShapeFeature, IPasteFeature, IPrintFeature, IReconnectionFeature, IRemoveBendpointFeature, IRemoveFeature, IResizeFeature, IResizeShapeFeature, ISaveImageFeature, IUpdateFeature
- All Known Implementing Classes:
- AbstractAddFeature, AbstractAddPictogramElementFeature, AbstractAddShapeFeature, AbstractCopyFeature, AbstractCreateConnectionFeature, AbstractCreateFeature, AbstractCustomFeature, AbstractDirectEditingFeature, AbstractDrillDownFeature, AbstractFeature, AbstractLayoutFeature, AbstractMoveShapeFeature, AbstractPasteFeature, AbstractUpdateFeature, AddFeatureForPattern, CreateConnectionFeatureForPattern, CreateFeatureForPattern, DefaultAddBendpointFeature, DefaultDeleteFeature, DefaultMoveAnchorFeature, DefaultMoveBendpointFeature, DefaultMoveConnectionDecoratorFeature, DefaultMoveShapeFeature, DefaultPrintFeature, DefaultReconnectionFeature, DefaultRemoveBendpointFeature, DefaultRemoveFeature, DefaultResizeShapeFeature, DefaultSaveImageFeature, DefaultUpdateDiagramFeature, DirectEditingFeatureForPattern, LayoutFeatureForPattern, MoveShapeFeatureForPattern, ReconnectionFeatureForPattern, ResizeShapeFeatureForPattern, UpdateFeatureForPattern, UpdateNoBoFeature
public interface IFeature
- extends IName, IDescription, IFeatureProviderHolder
The Interface IDirectEditingInfo.
Similar to actions and commands. Contains check/can methods and (in the
future) methods for undo and redo functionality.
- See Also:
IContext
Method Summary |
boolean |
canExecute(IContext context)
Decides if the current feature can execute with the given context. |
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the
execute operation. |
void |
execute(IContext context)
Executes the current feature with the given context. |
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. |
boolean |
isAvailable(IContext context)
Decides if the current feature is available with the given context. |
Methods inherited from interface org.eclipse.graphiti.IName |
getName |
isAvailable
boolean isAvailable(IContext context)
- Decides if the current feature is available with the given context.
- Parameters:
context
- this is the general input for this method
- Returns:
- true if it is available, false if not
- See Also:
IContext
canExecute
boolean canExecute(IContext context)
- Decides if the current feature can execute with the given context.
- Parameters:
context
- this is the general input for this method
- Returns:
- true if the feature can be executed, false if not
- See Also:
IContext
execute
void execute(IContext context)
- Executes the current feature with the given context.
- Parameters:
context
- this is the general input for this method- See Also:
IContext
canUndo
boolean canUndo(IContext context)
- Decides if the current feature can be undone - this is the undo of the
execute operation.
- Parameters:
context
- this is the general input for this method
- Returns:
- true if the feature can be undone, false if not
- See Also:
IContext
hasDoneChanges
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. By default all features
should appear there (see implementation in AbstractFeature), but single
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 will lead to inconsistencies if
this method returns false
although the feature did changes.
- Returns:
true
if the feature should appear in the undo stack,
false
otherwise
Copyright (c) SAP AG 2005, 2010.