Class EmbeddedFilePanel
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.SidePanelFactory
-
- org.faceless.pdf2.viewer2.feature.EmbeddedFilePanel
-
public class EmbeddedFilePanel extends SidePanelFactory
Create aSidePanel
that will display a list of embedded files in the PDF.The following initialization parameters can be specified to configure this feature.The name of this feature is ShowHideEmbeddedFilessave true
,false
ordesktop
, forsetSaveEnabled()
. Default is trueThis 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.18
-
-
Constructor Summary
Constructors Constructor Description EmbeddedFilePanel()
Create a new EmbeddedFilePanel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SidePanel
createSidePanel()
Create and return a newSidePanel
.void
initialize(PDFViewer viewer)
Called when the feature is first added to a viewerboolean
isSaveEnabled()
Return whether files can be saved to the filesystem, as set bysetSaveEnabled(boolean)
boolean
isSaveToDesktop()
boolean
isSidePanelRequired(DocumentPanel docpanel)
Determines whether this side panel is required for this PDF.void
setSaveEnabled(boolean enabled)
Set whether to allow embedded files to be saved to the filesystemvoid
setSaveToDesktop(boolean desktop)
If save is enabled, implement this by creating a temporary file and openinng it with theDesktop.open(java.io.File)
method.-
Methods inherited from class org.faceless.pdf2.viewer2.SidePanelFactory
toString
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
-
-
-
-
Method Detail
-
initialize
public void initialize(PDFViewer viewer)
Description copied from class:ViewerFeature
Called when the feature is first added to a viewer- Overrides:
initialize
in classViewerFeature
-
isSidePanelRequired
public boolean isSidePanelRequired(DocumentPanel docpanel)
Description copied from class:SidePanelFactory
Determines whether this side panel is required for this PDF. By default this method returns true, but an example of where this wouldn't apply is for the Bookmarks panel on a PDF with no bookmarks. Note prior to 2.26, this method took a PDF instead of a DocumentPanel- Overrides:
isSidePanelRequired
in classSidePanelFactory
-
setSaveEnabled
public void setSaveEnabled(boolean enabled)
Set whether to allow embedded files to be saved to the filesystem- Parameters:
enabled
- if true, embedded files can be saved to the filesystem
-
setSaveToDesktop
public void setSaveToDesktop(boolean desktop)
If save is enabled, implement this by creating a temporary file and openinng it with theDesktop.open(java.io.File)
method. This defaults to false.
-
isSaveEnabled
public boolean isSaveEnabled()
Return whether files can be saved to the filesystem, as set bysetSaveEnabled(boolean)
- Returns:
- if true, embedded files can be saved to the filesystem
-
isSaveToDesktop
public boolean isSaveToDesktop()
-
createSidePanel
public SidePanel createSidePanel()
Description copied from class:SidePanelFactory
Create and return a newSidePanel
.- Specified by:
createSidePanel
in classSidePanelFactory
-
-