Top Fields Constructors Methods
org.apache.pdfbox.debugger.ui.textsearcher

public Class Searcher

extends Object
implements DocumentListener, ChangeListener, ComponentListener
Class Inheritance
All Implemented Interfaces
java.awt.event.ComponentListener, java.util.EventListener, javax.swing.event.ChangeListener, javax.swing.event.DocumentListener
Imports
java.awt.Color, java.awt.event.ActionEvent, .ComponentEvent, .ComponentListener, java.util.List, javax.swing.AbstractAction, .Action, .JCheckBox, .JPanel, javax.swing.event.ChangeEvent, .ChangeListener, .DocumentEvent, .DocumentListener, javax.swing.text.BadLocationException, .DefaultHighlighter, .Highlighter, .JTextComponent, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.debugger.PDFDebugger

Author
Khyrul Bashar

Field Summary

Modifier and TypeField and Description
private int
private List<Highlighter.Highlight>
private static final Log
private final Action
private static final Highlighter.HighlightPainter
private final Action
private final SearchEngine
private final SearchPanel
private static final Highlighter.HighlightPainter
private final JTextComponent
private int

Constructor Summary

AccessConstructor and Description
public
Searcher(JTextComponent
JTextComponent instance.
textComponent
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
public void
changedUpdate(DocumentEvent
the document event
documentEvent
)

Implements javax.swing.event.DocumentListener.changedUpdate.

Gives notification that an attribute or set of attributes changed.

private void
public void
componentHidden(ComponentEvent
the event to be processed
componentEvent
)

Implements java.awt.event.ComponentListener.componentHidden.

Invoked when the component has been made invisible.

public void
componentMoved(ComponentEvent
the event to be processed
componentEvent
)

Implements java.awt.event.ComponentListener.componentMoved.

Invoked when the component's position changes.

public void
componentResized(ComponentEvent
the event to be processed
componentEvent
)

Implements java.awt.event.ComponentListener.componentResized.

Invoked when the component's size changes.

public void
componentShown(ComponentEvent
the event to be processed
componentEvent
)

Implements java.awt.event.ComponentListener.componentShown.

Invoked when the component has been made visible.

public JPanel
public void
insertUpdate(DocumentEvent
the document event
documentEvent
)

Implements javax.swing.event.DocumentListener.insertUpdate.

Gives notification that there was an insert into the document.

public void
public void
removeUpdate(DocumentEvent
the document event
documentEvent
)

Implements javax.swing.event.DocumentListener.removeUpdate.

Gives notification that a portion of the document has been removed.

private void
scrollToWord(int offset)

private void
search(DocumentEvent documentEvent)

private void
search(String word)

public void
stateChanged(ChangeEvent
a ChangeEvent object
changeEvent
)

Implements javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.

private void
updateHighLighter(final int presentIndex, final int previousIndex)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentMatchback to summary
private int currentMatch
highlightsback to summary
private List<Highlighter.Highlight> highlights
LOGback to summary
private static final Log LOG
nextActionback to summary
private final Action nextAction
PAINTERback to summary
private static final Highlighter.HighlightPainter PAINTER
previousActionback to summary
private final Action previousAction
searchEngineback to summary
private final SearchEngine searchEngine
searchPanelback to summary
private final SearchPanel searchPanel
SELECTION_PAINTERback to summary
private static final Highlighter.HighlightPainter SELECTION_PAINTER
textComponentback to summary
private final JTextComponent textComponent
totalMatchback to summary
private int totalMatch

Constructor Detail

Searcherback to summary
public Searcher(JTextComponent textComponent)

Constructor.

Parameters
textComponent:JTextComponent

JTextComponent instance.

Method Detail

addMenuListenersback to summary
public void addMenuListeners(PDFDebugger frame)
changedUpdateback to summary
public void changedUpdate(DocumentEvent documentEvent)

Implements javax.swing.event.DocumentListener.changedUpdate.

Doc from javax.swing.event.DocumentListener.changedUpdate.

Gives notification that an attribute or set of attributes changed.

Parameters
documentEvent:DocumentEvent

the document event

Annotations
@Override
changeHighlighterback to summary
private void changeHighlighter(int index, Highlighter.HighlightPainter newPainter)
componentHiddenback to summary
public void componentHidden(ComponentEvent componentEvent)

Implements java.awt.event.ComponentListener.componentHidden.

Doc from java.awt.event.ComponentListener.componentHidden.

Invoked when the component has been made invisible.

Parameters
componentEvent:ComponentEvent

the event to be processed

Annotations
@Override
componentMovedback to summary
public void componentMoved(ComponentEvent componentEvent)

Implements java.awt.event.ComponentListener.componentMoved.

Doc from java.awt.event.ComponentListener.componentMoved.

Invoked when the component's position changes.

Parameters
componentEvent:ComponentEvent

the event to be processed

Annotations
@Override
componentResizedback to summary
public void componentResized(ComponentEvent componentEvent)

Implements java.awt.event.ComponentListener.componentResized.

Doc from java.awt.event.ComponentListener.componentResized.

Invoked when the component's size changes.

Parameters
componentEvent:ComponentEvent

the event to be processed

Annotations
@Override
componentShownback to summary
public void componentShown(ComponentEvent componentEvent)

Implements java.awt.event.ComponentListener.componentShown.

Doc from java.awt.event.ComponentListener.componentShown.

Invoked when the component has been made visible.

Parameters
componentEvent:ComponentEvent

the event to be processed

Annotations
@Override
getSearchPanelback to summary
public JPanel getSearchPanel()
insertUpdateback to summary
public void insertUpdate(DocumentEvent documentEvent)

Implements javax.swing.event.DocumentListener.insertUpdate.

Doc from javax.swing.event.DocumentListener.insertUpdate.

Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region.

Parameters
documentEvent:DocumentEvent

the document event

Annotations
@Override
removeMenuListenersback to summary
public void removeMenuListeners(PDFDebugger frame)
removeUpdateback to summary
public void removeUpdate(DocumentEvent documentEvent)

Implements javax.swing.event.DocumentListener.removeUpdate.

Doc from javax.swing.event.DocumentListener.removeUpdate.

Gives notification that a portion of the document has been removed. The range is given in terms of what the view last saw (that is, before updating sticky positions).

Parameters
documentEvent:DocumentEvent

the document event

Annotations
@Override
scrollToWordback to summary
private void scrollToWord(int offset)
searchback to summary
private void search(DocumentEvent documentEvent)
searchback to summary
private void search(String word)
stateChangedback to summary
public void stateChanged(ChangeEvent changeEvent)

Implements javax.swing.event.ChangeListener.stateChanged.

Doc from javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.

Parameters
changeEvent:ChangeEvent

a ChangeEvent object

Annotations
@Override
updateHighLighterback to summary
private void updateHighLighter(final int presentIndex, final int previousIndex)
updateNavigationButtonsback to summary
private void updateNavigationButtons()