|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.viewer2.ViewerFeature
org.faceless.pdf2.viewer2.feature.BackgroundTextExtractor
public class BackgroundTextExtractor
This feature will cause text to be extracted automatically when a PDF is loaded by the viewer.
A background thread will be started and run at low priority - early extraction like this means
that other features that depend on text extraction (searching, selecting text matching a certain
pattern and a "select all" on text - ie SearchPanel
and TextTool
) will not have
to run the extraction on demand and so should feel noticably faster to the user.
Note this feature is not enabled by default - it must be explicitly selected
The name of this feature is BackgroundTextExtractorThis 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 Summary | |
---|---|
BackgroundTextExtractor()
|
Method Summary | |
---|---|
void |
documentUpdated(DocumentPanelEvent event)
Called when an DocumentPanelEvent is raised |
void |
extract(DocumentPanel docpanel)
This method is run by this feature when a new DocumentPanel is loaded. |
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 |
isPaused()
Return true if the task has been paused with the PDFBackgroundTask.pause() method |
boolean |
isRunning()
Returns true if the task is still running |
void |
pause()
Pause the task until the PDFBackgroundTask.unpause() method is called. |
void |
startExtraction(DocumentPanel docpanel)
Start a background thread to run the extract(org.faceless.pdf2.viewer2.DocumentPanel) method |
void |
unpause()
Unpause the task after a call to PDFBackgroundTask.pause() |
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature |
---|
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, setFeatureName, teardown, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BackgroundTextExtractor()
Method Detail |
---|
public void initialize(PDFViewer viewer)
ViewerFeature
initialize
in class ViewerFeature
public boolean isEnabledByDefault()
ViewerFeature
ViewerFeature.getAllEnabledFeatures()
and by the PDFViewerApplet
and PDFTool
isEnabledByDefault
in class ViewerFeature
public void documentUpdated(DocumentPanelEvent event)
DocumentPanelListener
DocumentPanelEvent
is raised
documentUpdated
in interface DocumentPanelListener
public boolean isPaused()
PDFBackgroundTask
PDFBackgroundTask.pause()
method
isPaused
in interface PDFBackgroundTask
public boolean isRunning()
PDFBackgroundTask
isRunning
in interface PDFBackgroundTask
public void pause()
PDFBackgroundTask
PDFBackgroundTask.unpause()
method is called.
This method waits until the task has actually paused.
pause
in interface PDFBackgroundTask
public void unpause()
PDFBackgroundTask
PDFBackgroundTask.pause()
unpause
in interface PDFBackgroundTask
public void startExtraction(DocumentPanel docpanel)
extract(org.faceless.pdf2.viewer2.DocumentPanel)
method
docpanel
- the DocumentPanelpublic void extract(DocumentPanel docpanel)
docpanel
- the DocumentPanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |