org.eclipse.graphiti.ui.features

## Class DefaultSaveImageFeature

- java.lang.Object
- - org.eclipse.graphiti.features.impl.AbstractFeature
  - - org.eclipse.graphiti.features.impl.AbstractSaveImageFeature
    - - org.eclipse.graphiti.ui.features.DefaultSaveImageFeature

All Implemented Interfaces:
  IFeature, IFeatureProviderHolder, ISaveImageFeature, IDescription, IName

    public class DefaultSaveImageFeature
    extends AbstractSaveImageFeature
    implements ISaveImageFeature

The default feature implementation for saving a diagram as an image. This feature is used to trigger saving from inside an open and initialized `DiagramEditor`. It relies on an existing `GraphicalViewer` showing the diagram to save.

Since:
  0.10 Has been moved from plug-in org.eclipse.graphiti package org.eclipse.graphiti.features

### Constructor Summary

Constructors
Constructor and Description
`DefaultSaveImageFeature(IFeatureProvider fp)` Creates a new `DefaultSaveImageFeature`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `save(ISaveImageContext context)` Performs the save as image operation.

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

`canExecute, canSave, execute, getName, hasDoneChanges, postSave, preSave`

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

`canUndo, getDescription, getFeatureProvider, 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.ISaveImageFeature

`canSave, postSave, preSave`

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

`canExecute, canUndo, execute, hasDoneChanges, isAvailable`

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

`getName`

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

`getDescription`

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

`getFeatureProvider`

### Constructor Detail

#### DefaultSaveImageFeature

    public DefaultSaveImageFeature(IFeatureProvider fp)

Creates a new `DefaultSaveImageFeature`.

Parameters:
  `fp` - The feature provider providing this feature

### Method Detail

#### save

    public void save(ISaveImageContext context)

Performs the save as image operation. The default implementation delegates to `#getGraphicalViewer(IPrintContext)` to retrieve the `GraphicalViewer` that already displays the diagram, queries for `ISaveAsImageConfiguration` to use by calling `getSaveAsImageConfiguration(GraphicalViewer)`, queries for the filename by delegating to `getFilename(GraphicalViewer, ISaveAsImageConfiguration)` and finally uses `getSaveAsImageOperation(ISaveAsImageConfiguration, String)` to create an operation to perform the save as image operation. All those methods may be overridden to change the default behavior, so normally one would not need to override this method unless the complete sequence needs to changed or the save as image is performed in a completely different scenario.

Specified by:
  `save` in interface `ISaveImageFeature`
Parameters:
  `context` - Context information for saving as an image.