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
ConstructorDescriptionPrintGraphicalViewerAction
(IDiagramBehavior diagramBehavior, IConfigurationProvider configurationProvider) Creates a new PrintGraphicalViewerAction. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
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
-
Constructor Details
-
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 Details
-
calculateEnabled
protected boolean calculateEnabled()Same as super.calculateEnabled(), except that it also checks, if the current WorkbenchPart has a GraphicalViewer.- Overrides:
calculateEnabled
in classorg.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 interfaceorg.eclipse.jface.action.IAction
- Overrides:
run
in classorg.eclipse.gef.ui.actions.PrintAction
-