public class SearchPanel extends SidePanelFactory
SidePanel
that displays search results. This panel may be used instead
of or as well as the SearchField
- if no SearchField is found the panel will have
a field placed at the top automatically (see setCreateSearchField(boolean)
).
createSearchField | true or false for setCreateSearchField(boolean) |
---|---|
regex | true or false for setUseRegex(boolean) |
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.
Modifier and Type | Class and Description |
---|---|
static class |
SearchPanel.Field
A subclass of JTextField customized for searching - it has a
setProgress() method to report the progress of the search,
and an icon in the background
|
static class |
SearchPanel.Results
This class is the SidePanel returned by the parent factory, and represents
the search results panel.
|
Constructor and Description |
---|
SearchPanel()
Create a new SearchPanel
|
Modifier and Type | Method and Description |
---|---|
SidePanel |
createSidePanel()
Create and return a new
SidePanel . |
void |
initialize(PDFViewer viewer)
Called when the feature is first added to a viewer
|
void |
setCreateSearchField(boolean createfield)
Set whether to create a
SearchPanel.Field at the top of the SearchPanel.Results panel. |
void |
setTextTool(TextTool selection)
Set the
TextTool object that will display the selection when an item
in this panel is clicked on. |
void |
setUseRegex(boolean regex)
Set whether searches run through the Search Field created by this class
use a regular-expression instead of a text value.
|
isSidePanelRequired, toString
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
public void initialize(PDFViewer viewer)
ViewerFeature
initialize
in class ViewerFeature
public void setCreateSearchField(boolean createfield)
SearchPanel.Field
at the top of the SearchPanel.Results
panel.
By default this is the case, although if a SearchField
is included in the
feature list this is turned off.createfield
- whether to create a Field object or notpublic void setUseRegex(boolean regex)
regex
- whether to use a regular expression or notpublic void setTextTool(TextTool selection)
TextTool
object that will display the selection when an item
in this panel is clicked on. A value of null
(the default) will cause
the panel to use the first TextTool object it finds in the viewer, or if none
exists a new one will be created.selection
- the selection object that will be used to display the selected resultspublic SidePanel createSidePanel()
SidePanelFactory
SidePanel
.createSidePanel
in class SidePanelFactory
Copyright © 2001-2017 Big Faceless Organization