public class CreateFeatureForPattern extends AbstractCreateFeature implements ICustomAbortableUndoRedoFeature
Constructor and Description |
---|
CreateFeatureForPattern(IFeatureProvider featureProvider,
IPattern pattern)
Creates a new
CreateFeatureForPattern . |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreate(ICreateContext context)
Checks if business object can be created for the given context.
|
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.
|
java.lang.Object[] |
create(ICreateContext context)
Creates the business object for the given context.
|
java.lang.String |
getCreateImageId()
Gets the create image id.
|
java.lang.String |
getCreateLargeImageId()
Gets the create large image id.
|
IPattern |
getPattern()
Gets the pattern.
|
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.
|
canExecute, execute, getCreateDescription, getCreateName, getDescription, getName
getFeatureProvider, hasDoneChanges, isAvailable, manageFont, manageFont, setProgressCallback, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
hasDoneChanges, isAvailable
getFeatureProvider
public CreateFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)
CreateFeatureForPattern
.featureProvider
- the feature providerpattern
- the patternpublic boolean canCreate(ICreateContext context)
ICreate
public java.lang.Object[] create(ICreateContext context)
ICreate
public java.lang.String getCreateImageId()
ICreateInfo
getCreateImageId
in interface ICreateInfo
getCreateImageId
in class AbstractCreateFeature
public java.lang.String getCreateLargeImageId()
ICreateInfo
getCreateLargeImageId
in interface ICreateInfo
getCreateLargeImageId
in class AbstractCreateFeature
public IPattern getPattern()
public 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.public 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 methodIContext
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 featurepublic 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 feature