Package org.eclipse.graphiti.ui.internal.action

## Class PrintGraphicalViewerAction

- java.lang.Object
- - org.eclipse.core.commands.common.EventManager
  - - org.eclipse.jface.action.AbstractAction
    - - org.eclipse.jface.action.Action
      - - org.eclipse.gef.ui.actions.WorkbenchPartAction
        - - org.eclipse.gef.ui.actions.PrintAction
          - - org.eclipse.graphiti.ui.internal.action.PrintGraphicalViewerAction

All Implemented Interfaces:
  `org.eclipse.gef.Disposable`, `org.eclipse.gef.ui.actions.UpdateAction`, `org.eclipse.jface.action.IAction`

    public class PrintGraphicalViewerAction
    extends org.eclipse.gef.ui.actions.PrintAction

An Action, which is used to print the contents of the GraphicalViewer.

Additional to the usual printing behaviour (the dialog, where the printer can be selected), this Action also adds another dialog, where the size and position of the graphics on the paper can be specified.

### Field Summary

### Fields inherited from interface org.eclipse.jface.action.IAction

`AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT`

### Constructor Summary

Constructors
`PrintGraphicalViewerAction​(IDiagramBehavior diagramBehavior, IConfigurationProvider configurationProvider)` Creates a new PrintGraphicalViewerAction.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `calculateEnabled()` Same as super.calculateEnabled(), except that it also checks, if the current WorkbenchPart has a GraphicalViewer.
`void` `run()` Prints the GraphicalViewer of the WorkbenchPart.

### Methods inherited from class org.eclipse.gef.ui.actions.PrintAction

`init`

### Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartAction

`dispose, execute, getCommandStack, getWorkbenchPart, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart, update`

### Methods inherited from class org.eclipse.jface.action.Action

`convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText`

### Methods inherited from class org.eclipse.jface.action.AbstractAction

`addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener`

### Methods inherited from class org.eclipse.core.commands.common.EventManager

`addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PrintGraphicalViewerAction

    public PrintGraphicalViewerAction​(IDiagramBehavior diagramBehavior,
                                      IConfigurationProvider configurationProvider)

Creates a new PrintGraphicalViewerAction. It initializes it with the proper ID, label and image.

Parameters:
  `configurationProvider` - The IConfigurationProviderInternal.
  `part` - The WorkbenchPart (e.g. the editor), to which this Action belongs. From the WorkbenchPart the GraphicalViewer will be determined.

### Method Detail

#### calculateEnabled

    protected boolean calculateEnabled()

Same as super.calculateEnabled(), except that it also checks, if the current WorkbenchPart has a GraphicalViewer.

Overrides:
  `calculateEnabled` in class `org.eclipse.gef.ui.actions.PrintAction`

#### run

    public void run()

Prints the GraphicalViewer of the WorkbenchPart. It is the same as super.run(), except that it opens the PrintModeDialog before printing. In this dialog the size of the graphics (fit-width, fit-height, ...) can be specified.

Specified by:
  `run` in interface `org.eclipse.jface.action.IAction`
Overrides:
  `run` in class `org.eclipse.gef.ui.actions.PrintAction`