org.eclipse.graphiti.pattern
Class CreateConnectionFeatureForPattern

java.lang.Object
  extended by org.eclipse.graphiti.features.impl.AbstractFeature
      extended by org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature
          extended by org.eclipse.graphiti.pattern.CreateConnectionFeatureForPattern
All Implemented Interfaces:
ICreateConnectionFeature, ICustomUndoableFeature, IFeature, IFeatureProviderHolder, ICreateConnection, ICreateInfo, IDescription, IName

public class CreateConnectionFeatureForPattern
extends AbstractCreateConnectionFeature
implements ICustomUndoableFeature

The Class CreateConnectionFeatureForPattern.


Field Summary
private  IConnectionPattern delegate
           
 
Constructor Summary
CreateConnectionFeatureForPattern(IFeatureProvider featureProvider, IConnectionPattern pattern)
          Creates a new CreateConnectionFeatureForPattern.
 
Method Summary
 boolean canCreate(ICreateConnectionContext context)
          Can create.
 boolean canRedo(IContext context)
          Decides if the processed feature can be re-done.
 boolean canStartConnection(ICreateConnectionContext context)
          Can start connection.
 boolean canUndo(IContext context)
          Decides if the current feature can be undone - this is the undo of the execute operation.
 Connection create(ICreateConnectionContext context)
          Creates the.
 String getCreateImageId()
          Gets the create image id.
 String getCreateLargeImageId()
          Gets the create large image id.
 void redo(IContext context)
          This method will be called to actually do the work needed for redo.
 void undo(IContext context)
          This method will be called to actually do the work needed for undo.
 
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature
canExecute, execute, getCreateDescription, getCreateName, getName
 
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDescription, getDiagram, getDiagramEditor, getFeatureProvider, getProgressCallback, getUserDecision, hasDoneChanges, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, setProgressCallback, toString, updatePictogramElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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
 

Field Detail

delegate

private IConnectionPattern delegate
Constructor Detail

CreateConnectionFeatureForPattern

public CreateConnectionFeatureForPattern(IFeatureProvider featureProvider,
                                         IConnectionPattern pattern)
Creates a new CreateConnectionFeatureForPattern.

Parameters:
featureProvider - the feature provider
pattern - the connection pattern
Method Detail

canCreate

public boolean canCreate(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Can create.

Specified by:
canCreate in interface ICreateConnection
Parameters:
context - the context
Returns:
true, if successful

canStartConnection

public boolean canStartConnection(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Can start connection.

Specified by:
canStartConnection in interface ICreateConnection
Parameters:
context - the context
Returns:
true, if successful

create

public Connection create(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Creates the.

Specified by:
create in interface ICreateConnection
Parameters:
context - the context
Returns:
the connection

getCreateImageId

public String getCreateImageId()
Description copied from interface: ICreateInfo
Gets the create image id.

Specified by:
getCreateImageId in interface ICreateInfo
Overrides:
getCreateImageId in class AbstractCreateConnectionFeature
Returns:
image for UI representation

getCreateLargeImageId

public String getCreateLargeImageId()
Description copied from interface: ICreateInfo
Gets the create large image id.

Specified by:
getCreateLargeImageId in interface ICreateInfo
Overrides:
getCreateLargeImageId in class AbstractCreateConnectionFeature
Returns:
large image for UI representation

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 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

undo

public void undo(IContext context)
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
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

redo

public void redo(IContext context)
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


Copyright (c) SAP AG 2005, 2010.