org.eclipse.graphiti.ui.features

## Class DefaultPrintFeature

- java.lang.Object
- - org.eclipse.graphiti.features.impl.AbstractFeature
  - - org.eclipse.graphiti.features.impl.AbstractPrintFeature
    - - org.eclipse.graphiti.ui.features.DefaultPrintFeature

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

    public class DefaultPrintFeature
    extends AbstractPrintFeature
    implements IPrintFeature

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

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

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `print(IPrintContext context)` Performs the print operation.

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

`canExecute, canPrint, execute, getName, hasDoneChanges, postPrint, prePrint`

### 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.IPrintFeature

`canPrint, postPrint, prePrint`

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

#### DefaultPrintFeature

    public DefaultPrintFeature(IFeatureProvider fp)

Creates a new `DefaultPrintFeature`.

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

### Method Detail

#### print

    public void print(IPrintContext context)

Performs the print operation. The default implementation delegates to `getGraphicalViewer(IPrintContext)` to retrieve the `GraphicalViewer` that already displays the diagram, queries for `PrinterData` to use by calling `getPrinterData(IPrintContext)` and finally uses `#getPrintOperation(Printer, IPrintConfiguration)` to create an operation to perform the printing. 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 printing is performed in a completely different scenario.

Specified by:
  `print` in interface `IPrintFeature`
Parameters:
  `context` - Context information for printing.