|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.features.impl.AbstractFeature
public abstract class AbstractFeature
Abstract base class for all features. Prefer extending this class over
inheriting interface IFeature
.
Field Summary | |
---|---|
private IFeatureProvider |
fp
|
private IProgress |
progressCallback
|
Constructor Summary | |
---|---|
AbstractFeature(IFeatureProvider fp)
Creates a new AbstractFeature . |
Method Summary | |
---|---|
protected PictogramElement |
addGraphicalRepresentation(IAreaContext context,
Object newObject)
Adds the graphical representation. |
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the execute operation. |
protected Object[] |
getAllBusinessObjectsForPictogramElement(PictogramElement pe)
Gets the all business objects for pictogram element. |
protected Object |
getBusinessObjectForPictogramElement(PictogramElement pe)
Gets the business object for pictogram element. |
String |
getDescription()
Gets the description. |
protected Diagram |
getDiagram()
Gets the diagram. |
protected IDiagramEditor |
getDiagramEditor()
Gets the diagram editor. |
IFeatureProvider |
getFeatureProvider()
Gets the feature provider. |
String |
getName()
Gets the name. |
protected IProgress |
getProgressCallback()
Gets the progress callback. |
protected boolean |
getUserDecision()
Gets the user decision. |
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. |
boolean |
isAvailable(IContext context)
Decides if the current feature is available with the given context. |
protected void |
layoutPictogramElement(PictogramElement pe)
Layoutes the given pictogram element. |
protected void |
link(PictogramElement pe,
Object businessObject)
Link. |
protected void |
link(PictogramElement pe,
Object[] businessObjects)
Link. |
protected Color |
manageColor(IColorConstant colorConstant)
Manage color. |
protected Color |
manageColor(int red,
int green,
int blue)
Manage color. |
void |
setProgressCallback(IProgress progress)
Sets the progress callback. |
String |
toString()
|
protected void |
updatePictogramElement(PictogramElement pe)
Updates the given pictogram element. |
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 |
---|
canExecute, execute |
Field Detail |
---|
private IFeatureProvider fp
private IProgress progressCallback
Constructor Detail |
---|
public AbstractFeature(IFeatureProvider fp)
AbstractFeature
.
fp
- the fpMethod Detail |
---|
public boolean canUndo(IContext context)
IFeature
canUndo
in interface IFeature
context
- this is the general input for this method
IContext
public boolean hasDoneChanges()
IFeature
IMPORTANT NOTE: The implementor of the feature is responsible for
correctly implementing this method! It will lead to inconsistencies if
this method returns false
although the feature did changes.
hasDoneChanges
in interface IFeature
true
if the feature should appear in the undo stack,
false
otherwisepublic String getDescription()
IDescription
getDescription
in interface IDescription
public IFeatureProvider getFeatureProvider()
IFeatureProviderHolder
getFeatureProvider
in interface IFeatureProviderHolder
public String getName()
IName
getName
in interface IName
public boolean isAvailable(IContext context)
IFeature
isAvailable
in interface IFeature
context
- this is the general input for this method
IContext
public void setProgressCallback(IProgress progress)
progress
- the new progress callbackpublic String toString()
toString
in class Object
protected PictogramElement addGraphicalRepresentation(IAreaContext context, Object newObject)
context
- the contextnewObject
- the new object
protected Object[] getAllBusinessObjectsForPictogramElement(PictogramElement pe)
pe
- the pe
protected Object getBusinessObjectForPictogramElement(PictogramElement pe)
pe
- the pe
protected Diagram getDiagram()
protected IDiagramEditor getDiagramEditor()
protected IProgress getProgressCallback()
protected boolean getUserDecision()
protected void layoutPictogramElement(PictogramElement pe)
pe
- the peprotected void link(PictogramElement pe, Object businessObject)
pe
- the pebusinessObject
- the business objectprotected void link(PictogramElement pe, Object[] businessObjects)
pe
- the pebusinessObjects
- the business objectsprotected Color manageColor(IColorConstant colorConstant)
colorConstant
- the color constant
protected Color manageColor(int red, int green, int blue)
red
- the redgreen
- the greenblue
- the blue
protected void updatePictogramElement(PictogramElement pe)
pe
- the pe
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |