|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFeature
The Interface IFeature provides the common API for all kinds of features in
Graphiti. Features implement a piece of functionality for a Graphiti editor.
Usually they implement one aspect in the lifecycle of one domain object, e.g.
creating a new domain object of a specific type or adding an existing domain
object to the diagram.
There are various more specific sub interfaces that define the specific API
for the different kinds of feature like IAddFeature
or
ICreateFeature
.
IFeature offers similar functionality as actions and commands and contains
methods that enable the Graphiti framework to check if a feature is available
and enabled in the current situation and a method to execute it.
Classes that implement this interface may also implement
ICustomUndoableFeature
to provide enhanced undo/redo functionality.
This might be of interest for non-EMF domain objects but also in general if
you need to trigger additional operations when an undo or redo of the feature
is done.
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 of e.g. |
boolean |
isAvailable(IContext context)
Decides if the current feature is available with the given context. |
Methods inherited from interface org.eclipse.graphiti.IName |
---|
getName |
Methods inherited from interface org.eclipse.graphiti.IDescription |
---|
getDescription |
Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder |
---|
getFeatureProvider |
Method Detail |
---|
boolean isAvailable(IContext context)
context
- this is the general input for this method
IContext
boolean canExecute(IContext context)
context
- this is the general input for this method
IContext
void execute(IContext context)
context
- this is the general input for this methodIContext
boolean canUndo(IContext context)
context
- this is the general input for this method
IContext
boolean hasDoneChanges()
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.
true
if the feature should appear in the undo stack,
false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |