org.eclipse.graphiti.pattern

## Interface ICustomUndoablePattern

    public interface ICustomUndoablePattern

This interface can by used by customers and implemented within any pattern to signal the need for additional undo or redo work. When a pattern implements this interface, and the framework performs an undo or a redo, the framework will call the contained methods.

Implementing this interface is especially helpful if customers want to implement undo/redo functionality for non-EMF changes, e.g. for non-EMF domain models. Note that any EMF-model changes (including the changes done to the graphical representation (Graphiti `PictogramElement`s and `GraphicsAlgorithm`s will by handled automatically by the Graphiti framework no matter if this interface is implemented by a pattern or not.

Since:
  0.8.0

### Method Summary

All Methods Instance Methods Abstract Methods
`boolean` `canRedo(IFeature feature, IContext context)` Decides if the processed pattern functionality can be re-done.
`boolean` `canUndo(IFeature feature, IContext context)` Decides if the processed pattern functionality can be undone.
`void` `redo(IFeature feature, IContext context)` This method will be called to actually do the work needed for redo.
`void` `undo(IFeature feature, IContext context)` This method will be called to actually do the work needed for undo.

### Method Detail

#### canUndo

    boolean canUndo(IFeature feature,
                    IContext context)

Decides if the processed pattern functionality can be undone.

Parameters:
  `feature` - this is the instance of the `IFeature` object that was in use when executing the pattern functionality
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Returns:
  true if the feature can be undone, false if not

#### undo

    void undo(IFeature feature,
              IContext context)

This method will be called to actually do the work needed for undo. Customers may revert their non-EMF changes done by the pattern functionality here.

Parameters:
  `feature` - this is the instance of the `IFeature` object that was in use when executing the pattern functionality
  `context` - this is the instance of the `IContext` object that was in use when executing the feature

#### canRedo

    boolean canRedo(IFeature feature,
                    IContext context)

Decides if the processed pattern functionality can be re-done.

Parameters:
  `feature` - this is the instance of the `IFeature` object that was in use when executing the pattern functionality
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Returns:
  true if the feature can be re-done, false if not

#### redo

    void redo(IFeature feature,
              IContext context)

This method will be called to actually do the work needed for redo. Customers may re-apply their non-EMF changes done by the pattern functionality here. (Usually it might be sufficient to delegate to the execution method of the pattern functionality.)

Parameters:
  `feature` - this is the instance of the `IFeature` object that was in use when executing the pattern functionality
  `context` - this is the instance of the `IContext` object that was in use when executing the feature