org.eclipse.graphiti.pattern

## Class ReconnectionFeatureForPattern

- java.lang.Object
- - org.eclipse.graphiti.features.impl.AbstractFeature
  - - org.eclipse.graphiti.pattern.ReconnectionFeatureForPattern

All Implemented Interfaces:
  ICustomAbortableUndoRedoFeature, ICustomUndoableFeature, ICustomUndoRedoFeature, IFeature, IFeatureProviderHolder, IReconnectionFeature, IReconnection, IDescription, IName

    public class ReconnectionFeatureForPattern
    extends AbstractFeature
    implements IReconnectionFeature, ICustomUndoableFeature, ICustomAbortableUndoRedoFeature

This feature wraps the reconnection functionality of a pattern for calls of the Graphiti framework. Clients should not need to use this class directly.

### Constructor Summary

Constructors
Constructor and Description
`ReconnectionFeatureForPattern(IFeatureProvider fp, IReconnection pattern)` Creates a new `ReconnectionFeatureForPattern`.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `canceledReconnect(IReconnectionContext context)` Will called if the connection reconnect process was canceled after dragging the start or end of the connection.
`boolean` `canExecute(IContext context)` Decides if the current feature can execute with the given context.
`boolean` `canReconnect(IReconnectionContext context)` Can reconnect.
`boolean` `canRedo(IContext context)` Decides if the processed feature can be re-done.
`boolean` `canStartReconnect(IReconnectionContext context)` Can start reconnect.
`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.
`java.lang.String` `getName()` Gets the name.
`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` `postReconnect(IReconnectionContext context)` Post reconnnect.
`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` `preReconnect(IReconnectionContext context)` Pre reconnnect.
`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.
`void` `reconnect(IReconnectionContext context)` Reconnnect.
`void` `redo(IContext context)` Deprecated. use `postRedo(IContext)` instead
`void` `undo(IContext context)` Deprecated. use `postUndo(IContext)` instead

### Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature

`getDescription, getFeatureProvider, hasDoneChanges, isAvailable, manageFont, manageFont, setProgressCallback, toString`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.graphiti.features.IFeature

`hasDoneChanges, isAvailable`

### Methods inherited from interface org.eclipse.graphiti.IDescription

`getDescription`

### Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder

`getFeatureProvider`

### Constructor Detail

#### ReconnectionFeatureForPattern

    public ReconnectionFeatureForPattern(IFeatureProvider fp,
                                         IReconnection pattern)

Creates a new `ReconnectionFeatureForPattern`.

Parameters:
  `fp` - the feature provider
  `pattern` - the pattern

### Method Detail

#### canReconnect

    public boolean canReconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Can reconnect.

Specified by:
  `canReconnect` in interface `IReconnection`
Parameters:
  `context` - the context
Returns:
  true, if successful

#### postReconnect

    public void postReconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Post reconnnect.

Specified by:
  `postReconnect` in interface `IReconnection`
Parameters:
  `context` - the context

#### preReconnect

    public void preReconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Pre reconnnect.

Specified by:
  `preReconnect` in interface `IReconnection`
Parameters:
  `context` - the context

#### reconnect

    public void reconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Reconnnect.

Specified by:
  `reconnect` in interface `IReconnection`
Parameters:
  `context` - the context

#### canceledReconnect

    public void canceledReconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Will called if the connection reconnect process was canceled after dragging the start or end of the connection. E.g. user pressed ESC, user clicked on an invalid target, focus was lost, ...

Specified by:
  `canceledReconnect` in interface `IReconnection`
Parameters:
  `context` - the context
Since:
  0.9

#### canExecute

    public boolean canExecute(IContext context)

Description copied from interface: `IFeature`
Decides if the current feature can execute with the given context.

Specified by:
  `canExecute` in interface `IFeature`
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

    public void execute(IContext context)

Description copied from interface: `IFeature`
Executes the current feature with the given context.

Specified by:
  `execute` in interface `IFeature`
Parameters:
  `context` - this is the general input for this method
See Also:
  `IContext`

#### getName

    public java.lang.String getName()

Description copied from interface: `IName`
Gets the name.

Specified by:
  `getName` in interface `IName`
Overrides:
  `getName` in class `AbstractFeature`
Returns:
  the name

#### isAbort

    public boolean isAbort()

Description copied from interface: `ICustomAbortableUndoRedoFeature`
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. 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.

Specified by:
  `isAbort` in interface `ICustomAbortableUndoRedoFeature`
Returns:
  `true` in case you want to cancel the current operation, `false` otherwise.
Since:
  0.12

#### canUndo

    public boolean canUndo(IContext context)

Description copied from interface: `IFeature`
Decides if the current feature can be undone - this is the undo of the execute operation.

Specified by:
  `canUndo` in interface `ICustomUndoableFeature`
Specified by:
  `canUndo` in interface `ICustomUndoRedoFeature`
Specified by:
  `canUndo` in interface `IFeature`
Overrides:
  `canUndo` in class `AbstractFeature`
Parameters:
  `context` - this is the general input for this method
Returns:
  true if the feature can be undone, false if not
See Also:
  `IContext`

#### preUndo

    public void preUndo(IContext context)

Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework before the EMF undo is triggered. Customers may revert their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.postUndo(IContext)`.

Specified by:
  `preUndo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

#### postUndo

    public void postUndo(IContext context)

Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework after the EMF undo is finished. Customers may revert their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.preUndo(IContext)`.

Specified by:
  `postUndo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

#### undo

    public void undo(IContext context)

Deprecated. use `postUndo(IContext)` instead
Description copied from interface: `ICustomUndoableFeature`
This method will be called to actually do the work needed for undo. Customers may revert their non-EMF changes done by the feature here.

Specified by:
  `undo` in interface `ICustomUndoableFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.8

#### canRedo

    public boolean canRedo(IContext context)

Description copied from interface: `ICustomUndoableFeature`
Decides if the processed feature can be re-done.

Note that as soon as any feature reports `false` here, also all consecutive entries in the command stack are no longer reachable for redo.

Specified by:
  `canRedo` in interface `ICustomUndoableFeature`
Specified by:
  `canRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `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
Since:
  0.8

#### preRedo

    public void preRedo(IContext context)

Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework before the EMF undo has triggered. Customers may re-apply their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.postRedo(IContext)`. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
  `preRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

#### postRedo

    public void postRedo(IContext context)

Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework after the EMF undo has finished. Customers may re-apply their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.preRedo(IContext)`. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
  `postRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

#### redo

    public void redo(IContext context)

Deprecated. use `postRedo(IContext)` instead
Description copied from interface: `ICustomUndoableFeature`
This method will be called to actually do the work needed for redo. Customers may re-apply their non-EMF changes done by the feature here. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
  `redo` in interface `ICustomUndoableFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.8

#### canStartReconnect

    public boolean canStartReconnect(IReconnectionContext context)

Description copied from interface: `IReconnection`
Can start reconnect.

Specified by:
  `canStartReconnect` in interface `IReconnection`
Parameters:
  `context` - the context
Returns:
  true, if successful
Since:
  0.11