Class PrintAction
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
de.cau.cs.kieler.klighd.ui.printing.PrintAction
- All Implemented Interfaces:
org.eclipse.jface.action.IAction
public class PrintAction
extends org.eclipse.jface.action.Action
An
This class can be subclass in order to contribute a specialized version of the
In order to register the print support for editor parts a corresponding
In order to enable printing for self implemented view parts, this print action must be registered in the view site's action base as done in
Note: A
Action contributing print support to KLighD diagram viewers including a system
independent printout configuration dialog a with print preview. The printer selection is
delegated to the native 'printer selection' dialog.This class can be subclass in order to contribute a specialized version of the
KlighdPrintDialog by overriding getPrintDialog(Shell, PrintOptions).In order to register the print support for editor parts a corresponding
EditorActionBarContributor must be created
and registered. Our default one is
DiagramEditorPart.PrintActionContributor, it is registered in the plugin.xml as a contributor of
the DiagramEditorPart.In order to enable printing for self implemented view parts, this print action must be registered in the view site's action base as done in
DiagramViewPart#registerPrintSupport.Note: A
PiccoloViewer must be set to successfully perform the printing.- Author:
- csp, chsch
-
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
ConstructorsConstructorDescriptionCreate a new PrintAction.PrintAction(IViewer viewer) Creates a new PrintAction using the given viewer while printing. -
Method Summary
Modifier and TypeMethodDescriptionprotected KlighdPrintDialoggetPrintDialog(org.eclipse.swt.widgets.Shell parentShell, PrintOptions options) Factor method contributing the employedKlighdPrintDialog, may be overridden if a customized dialog shall be injected.final voidrun()Show the print dialog and print.voidSet a new viewer to use while printing.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, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipTextMethods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListenerMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
PrintAction
public PrintAction()Create a new PrintAction. A viewer must be set separately. -
PrintAction
Creates a new PrintAction using the given viewer while printing.- Parameters:
viewer- the viewer to print.
-
-
Method Details
-
setViewer
Set a new viewer to use while printing.- Parameters:
viewer- the new viewer to print
-
getPrintDialog
protected KlighdPrintDialog getPrintDialog(org.eclipse.swt.widgets.Shell parentShell, PrintOptions options) Factor method contributing the employedKlighdPrintDialog, may be overridden if a customized dialog shall be injected.- Parameters:
parentShell- the parentShellrequired by the dialogoptions- thePrintOptionsinstance to work with- Returns:
- the
KlighdPrintDialogto be used
-
run
public final void run()Show the print dialog and print.- Specified by:
runin interfaceorg.eclipse.jface.action.IAction- Overrides:
runin classorg.eclipse.jface.action.Action
-