org.faceless.pdf2.viewer2.feature
Class Save

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.ViewerWidget
          extended by org.faceless.pdf2.viewer2.feature.Save
All Implemented Interfaces:
DocumentPanelListener

public class Save
extends ViewerWidget
implements DocumentPanelListener

Create a button that will open a dialog allowing the PDF to be saved to disk. Any Exporter formats included as features in the Viewer will be presented as options.

The following initialization parameters can be specified to configure this feature.
promptOnOverwritetrue to prompt before overwriting files, false otherwise (the default)
The name of this feature is Save

This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

Since:
2.8

Constructor Summary
Save()
           
 
Method Summary
 void action(ViewerEvent event)
          The method that's run when this feature is activated
 void documentUpdated(DocumentPanelEvent event)
          Called when an DocumentPanelEvent is raised
 void initialize(PDFViewer viewer)
          Called when the feature is first added to a viewer
 boolean isEnabledByDefault()
          Return true if this feature is enabled by default (the default).
static void save(ViewerEvent event, Exporter initialexporter, String initialpath, boolean displayprompt, boolean overwriteprompt)
          Save the Document
 void setPromptOnOverwrite(boolean prompt)
          Set whether this feature should prompt before overwriting a file
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerWidget
createActionListener, getComponent, getViewer, isButtonEnabledByDefault, isDocumentRequired, isMenuEnabledByDefault, setButton, setComponent, setDocumentRequired, setMenu, setMenu, setToolBarEnabled, setToolBarEnabledAlways, setToolBarFloatable, setToolBarFloating, toString
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, setFeatureName, teardown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Save

public Save()
Method Detail

isEnabledByDefault

public boolean isEnabledByDefault()
Description copied from class: ViewerFeature
Return true if this feature is enabled by default (the default). Disabled features are excluded from the list returned by ViewerFeature.getAllEnabledFeatures() and by the PDFViewerApplet and PDFTool

Overrides:
isEnabledByDefault in class ViewerFeature

initialize

public void initialize(PDFViewer viewer)
Description copied from class: ViewerFeature
Called when the feature is first added to a viewer

Overrides:
initialize in class ViewerWidget

documentUpdated

public void documentUpdated(DocumentPanelEvent event)
Description copied from interface: DocumentPanelListener
Called when an DocumentPanelEvent is raised

Specified by:
documentUpdated in interface DocumentPanelListener

setPromptOnOverwrite

public void setPromptOnOverwrite(boolean prompt)
Set whether this feature should prompt before overwriting a file

Parameters:
prompt - whether to prompt before overwriting a file (detault is false)
Since:
2.11.25

action

public void action(ViewerEvent event)
Description copied from class: ViewerWidget
The method that's run when this feature is activated

Overrides:
action in class ViewerWidget

save

public static void save(ViewerEvent event,
                        Exporter initialexporter,
                        String initialpath,
                        boolean displayprompt,
                        boolean overwriteprompt)
Save the Document

Parameters:
event - the ViewerEvent that launched this action
initialexporter - the Exporter to choose by default, or null to default to a PDFExporter
initialpath - the Path to display by default, or null to use the same path as the source file
displayprompt - whether to prompt the user for a filename. Currently ignored.
overwriteprompt - whether to prompt the user if we are about to overwrite a filename.
Since:
2.11.10


Copyright © 2001-2010 Big Faceless Organization