com.jasperassistant.designer.viewer.actions
Class NativePrintAction

java.lang.Object
  extended byorg.eclipse.jface.action.Action
      extended bycom.jasperassistant.designer.viewer.actions.AbstractReportViewerAction
          extended bycom.jasperassistant.designer.viewer.actions.NativePrintAction
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.action.IAction, IReportViewerListener

public class NativePrintAction
extends AbstractReportViewerAction

Print action. Unlike the PrintActionwhich uses the AWT print dialog, this action uses a native SWT print dialog.

Note that the actual printing is performed using the standard Java printing support and not the one provided by SWT. The downside of this is that not all of the printing settings, made in the PrintDialog, can be taken in account. The settings taken in account are:

  • The printer
  • Page selection
  • The number of copies

    WARNING: this code is still experimental. So far it was only tested on Windows XP.

    Author:
    Peter Severin (peter_p_s@users.sourceforge.net)

    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, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
     
    Constructor Summary
    NativePrintAction(IReportViewer viewer)
               
     
    Method Summary
    protected  boolean calculateEnabled()
              Calculates the enablement condition
     void run()
               
     
    Methods inherited from class com.jasperassistant.designer.viewer.actions.AbstractReportViewerAction
    dispose, getReportViewer, runBusy, viewerStateChanged
     
    Methods inherited from class org.eclipse.jface.action.Action
    addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, notifyResult, removeAcceleratorText, removeMnemonics, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    NativePrintAction

    public NativePrintAction(IReportViewer viewer)
    See Also:
    AbstractReportViewerAction.AbstractReportViewerAction(IReportViewer)
    Method Detail

    calculateEnabled

    protected boolean calculateEnabled()
    Description copied from class: AbstractReportViewerAction
    Calculates the enablement condition

    Specified by:
    calculateEnabled in class AbstractReportViewerAction
    Returns:
    true if the action should be enabled
    See Also:
    AbstractReportViewerAction.calculateEnabled()

    run

    public void run()
    Specified by:
    run in interface org.eclipse.jface.action.IAction
    Overrides:
    run in class AbstractReportViewerAction
    See Also:
    AbstractReportViewerAction.run()