public class SaveAs extends ViewerWidget implements DocumentPanelListener
Exporter
formats included as features in the Viewer will be presented
as options.
promptOnOverwrite | true to prompt before overwriting files, false otherwise (the default) |
---|---|
disableUnlessDirty | true to disable this feature until the PDF has been marked as "dirty" (ie it has been altered), false to always enable this feature (the defualt) |
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.
Constructor and Description |
---|
SaveAs() |
Modifier and Type | Method and Description |
---|---|
void |
action(ViewerEvent event)
The method that's run when this feature is activated.
|
ActionListener |
createActionListener()
Return an ActionListener that will be called when this Widget 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).
|
boolean |
isPromptOnOverwrite()
Indicates whether this feature should prompt before overwriting a file
|
static void |
saveAs(ViewerEvent event,
Exporter initialexporter,
String initialpath,
boolean overwriteprompt)
/**
Save the Document
|
void |
setPromptOnOverwrite(boolean prompt)
Set whether this feature should prompt before overwriting a file
|
getComponent, getIcon, getViewer, isButtonEnabledByDefault, isDocumentRequired, isMenuEnabledByDefault, setButton, setComponent, setDocumentRequired, setMenu, setMenu, setToolBarEnabled, setToolBarEnabledAlways, setToolBarFloatable, setToolBarFloating, toString
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, setFeatureName, teardown
public void action(ViewerEvent event)
ViewerWidget
ActionListener
returned by the default implementation of
ViewerWidget.createActionListener()
, and by default is a no-op.action
in class ViewerWidget
public ActionListener createActionListener()
ViewerWidget
createActionListener
in class ViewerWidget
Quit.createActionListener()
public boolean isEnabledByDefault()
ViewerFeature
ViewerFeature.getAllEnabledFeatures()
and by the PDFViewerApplet
and PDFTool
isEnabledByDefault
in class ViewerFeature
public void initialize(PDFViewer viewer)
ViewerFeature
initialize
in class ViewerWidget
public void documentUpdated(DocumentPanelEvent event)
DocumentPanelListener
DocumentPanelEvent
is raiseddocumentUpdated
in interface DocumentPanelListener
public void setPromptOnOverwrite(boolean prompt)
prompt
- whether to prompt before overwriting a file (detault is false)public boolean isPromptOnOverwrite()
public static void saveAs(ViewerEvent event, Exporter initialexporter, String initialpath, boolean overwriteprompt)
event
- the ViewerEvent that launched this actioninitialexporter
- 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 fileoverwriteprompt
- whether to prompt the user if we are about to overwrite a filename.Copyright © 2001-2017 Big Faceless Organization