Class AbstractSaveImageFeature
java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.AbstractSaveImageFeature
- All Implemented Interfaces:
IFeature,IFeatureProviderHolder,ISaveImageFeature,IDescription,IName
- Direct Known Subclasses:
DefaultSaveImageFeature
Abstract base implementation of a save as image feature.
- Since:
- 0.10
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor that is to be called by any subclass. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecute(IContext context) Checks if this feature can be executed by delegating to the methodcanSave(ISaveImageContext).booleancanSave(ISaveImageContext context) Checks if this feature can execute.final voidExecutes this save image feature by sequentially callingpreSave(ISaveImageContext),ISaveImageFeature.save(ISaveImageContext)andpostSave(ISaveImageContext).getName()Returns the name of the save as image feature, by default "Save As Image"booleanHook method that reports if changes have been done while executing this feature.voidpostSave(ISaveImageContext context) Hook method for executing stuff that needs to be done after actually saving a diagram as an image.voidpreSave(ISaveImageContext context) Hook method for executing stuff that needs to be done before actually saving a diagram as an image.Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDescription, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.IDescription
getDescriptionMethods inherited from interface org.eclipse.graphiti.features.IFeature
canUndo, isAvailableMethods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProviderMethods inherited from interface org.eclipse.graphiti.features.ISaveImageFeature
save
-
Constructor Details
-
AbstractSaveImageFeature
Constructor that is to be called by any subclass.- Parameters:
fp- The feature provider that created the feature
-
-
Method Details
-
getName
Returns the name of the save as image feature, by default "Save As Image"- Specified by:
getNamein interfaceIName- Overrides:
getNamein classAbstractFeature- Returns:
- the name
-
canExecute
Checks if this feature can be executed by delegating to the methodcanSave(ISaveImageContext).- Specified by:
canExecutein interfaceIFeature- Parameters:
context- Context information for printing.- Returns:
truein case this save image feature can be executed,falseotherwise.- See Also:
-
canSave
Checks if this feature can execute. The default implementation simply returnstrue.- Specified by:
canSavein interfaceISaveImageFeature- Parameters:
context- Context information for saving an image.- Returns:
truein case this save image feature can be executed,falseotherwise.
-
preSave
Hook method for executing stuff that needs to be done before actually saving a diagram as an image. The default implementation does nothing.- Specified by:
preSavein interfaceISaveImageFeature- Parameters:
context- Context information for saving.
-
execute
Executes this save image feature by sequentially callingpreSave(ISaveImageContext),ISaveImageFeature.save(ISaveImageContext)andpostSave(ISaveImageContext). This method will fail in case the passed context is noISaveImageContext. -
postSave
Hook method for executing stuff that needs to be done after actually saving a diagram as an image. The default implementation does nothing.- Specified by:
postSavein interfaceISaveImageFeature- Parameters:
context- Context information for saving.
-
hasDoneChanges
public boolean hasDoneChanges()Hook method that reports if changes have been done while executing this feature. In casefalseis returned the feature will not appear in the undo stack. The default implementation simply returnsfalse.- Specified by:
hasDoneChangesin interfaceIFeature- Overrides:
hasDoneChangesin classAbstractFeature- Returns:
truein case changes have been made,falseotherwise.
-