org.faceless.pdf2.viewer2.feature
Class SearchPanel

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.SidePanelFactory
          extended by org.faceless.pdf2.viewer2.feature.SearchPanel

public class SearchPanel
extends SidePanelFactory

Creates a 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)).

The following initialization parameters can be specified to configure this feature.
createSearchFieldtrue or false for setCreateSearchField(boolean)
The name of this feature is SearchPanel

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

Nested Class Summary
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 Summary
SearchPanel()
          Create a new SearchPanel
 
Method Summary
 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.
 
Methods inherited from class org.faceless.pdf2.viewer2.SidePanelFactory
isSidePanelRequired, toString
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchPanel

public SearchPanel()
Create a new SearchPanel

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 class ViewerFeature

setCreateSearchField

public void setCreateSearchField(boolean createfield)
Set whether to create a 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.

Parameters:
createfield - whether to create a Field object or not

setTextTool

public void setTextTool(TextTool selection)
Set the 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.

Parameters:
selection - the selection object that will be used to display the selected results

createSidePanel

public SidePanel createSidePanel()
Description copied from class: SidePanelFactory
Create and return a new SidePanel.

Specified by:
createSidePanel in class SidePanelFactory


Copyright © 2001-2013 Big Faceless Organization