|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.faceless.pdf2.viewer2.feature.SearchPanel.Results
public static class SearchPanel.Results
This class is the SidePanel returned by the parent factory, and represents the search results panel. It may be created by the parent factory, or may be instantiated on it's own.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
SearchPanel.Results()
Create a new Results object. |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener listener)
Add a ChangeListener to this panel. |
void |
addResult(PageExtractor.Text text)
Add the specified PageExtractor.Text to the list of results |
void |
cancel()
Cancel any currently running search |
void |
clearResults()
Clear the list of results |
void |
documentUpdated(DocumentPanelEvent event)
Called when an DocumentPanelEvent is raised |
Icon |
getIcon()
Return the Icon to use when displaying this SidePanel |
String |
getName()
Return the name of this tab - "Find" |
float |
getSearchProgress()
Return the progress of the current search. |
protected void |
indexPage(int pagenumber,
PageExtractor extractor)
Index the page. |
protected boolean |
mayContain(int pagenumber,
String value)
Return whether the specified text may be found on the specified pagenumber. |
void |
panelHidden()
Called when the panel is made hidden |
void |
panelVisible()
Called when the panel is made visible |
void |
propertyChange(PropertyChangeEvent event)
|
void |
removeChangeListener(ChangeListener listener)
Remove a ChangeListener from this panel. |
void |
search(String text)
Search for an item of text in the PDF currently displayed in this DocumentPanel . |
void |
setDocumentPanel(DocumentPanel docpanel)
Set the DocumentPanel this SidePanel is a member of. |
void |
setTextTool(TextTool selection)
Set the TextTool object this object will highlight its results
on. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SearchPanel.Results()
Method Detail |
---|
public String getName()
getName
in interface SidePanel
getName
in class Component
public Icon getIcon()
SidePanel
getIcon
in interface SidePanel
public void setTextTool(TextTool selection)
TextTool
object this object will highlight its results
on.
public void addResult(PageExtractor.Text text)
PageExtractor.Text
to the list of results
public void clearResults()
public void addChangeListener(ChangeListener listener)
ChangeListener
to this panel. A ChangeEvent
will be raised when the status of the search is updated.
public void removeChangeListener(ChangeListener listener)
ChangeListener
from this panel.
public void search(String text)
DocumentPanel
.
If a search is currently running it is interrupted, and any previously found results
are cleared.
text
- the text to search forpublic void cancel()
public float getSearchProgress()
protected void indexPage(int pagenumber, PageExtractor extractor)
mayContain(int, java.lang.String)
pagenumber
- the page numberextractor
- the extractor for that pageprotected boolean mayContain(int pagenumber, String value)
PageExtractor.getMatchingText(java.lang.String)
run on it to find and (possibly) return matching values. Although this method
could theoretically use some sort of index created in indexPage(int, org.faceless.pdf2.PageExtractor)
to narrow down
which pages to search, but the default implementation always returns true.
pagenumber
- the pagenumber to searchvalue
- the text to search forpublic void setDocumentPanel(DocumentPanel docpanel)
SidePanel
DocumentPanel
this SidePanel is a member of. This method
is called every time the DocumentPanel has it's document changed - the
SidePanel should be reinitialized in this call. If the SidePanel
is removed, this method will be called with null
as it's
argument.
setDocumentPanel
in interface SidePanel
public void documentUpdated(DocumentPanelEvent event)
DocumentPanelListener
DocumentPanelEvent
is raised
documentUpdated
in interface DocumentPanelListener
public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
public void panelVisible()
SidePanel
panelVisible
in interface SidePanel
public void panelHidden()
SidePanel
panelHidden
in interface SidePanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |