gov.nih.nlm.mms.browser
Class JEditorPaneFinderHandler

java.lang.Object
  extended bygov.nih.nlm.mms.browser.JEditorPaneFinderHandler
All Implemented Interfaces:
FinderHandler

public class JEditorPaneFinderHandler
extends Object
implements FinderHandler

Handles a find operation on a JEditorPane.


Constructor Summary
JEditorPaneFinderHandler(JEditorPane editor_pane)
          Constructor.
 
Method Summary
 void cancel()
          Indicates the find operation has been cancelled on the gui.
 boolean doFind()
          Look for the next occurrence of the search phrase either as whole word or as part of a word, depending on the current dialog setting.
 void find()
          Initiate a find or find next operation, whatever applies.
 void init()
          Initialize a find operation by reading all relevant settings and locking the dialog window.
 void setDialog(FindDialog find_dialog)
          Sets the JDialog for the handler.
 void setEditor(JEditorPane editor)
          Set the JEditorPane holding the document to be searched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEditorPaneFinderHandler

public JEditorPaneFinderHandler(JEditorPane editor_pane)
Constructor.

Parameters:
editor_pane - JEditorPane
Method Detail

setDialog

public void setDialog(FindDialog find_dialog)
Sets the JDialog for the handler.

Specified by:
setDialog in interface FinderHandler
Parameters:
find_dialog - JDialog

setEditor

public void setEditor(JEditorPane editor)
Set the JEditorPane holding the document to be searched

Parameters:
editor - the JEditorPane holding the document to be searched

cancel

public void cancel()
Indicates the find operation has been cancelled on the gui.

Specified by:
cancel in interface FinderHandler

init

public void init()
          throws Exception
Initialize a find operation by reading all relevant settings and locking the dialog window.

Specified by:
init in interface FinderHandler
Throws:
Exception

find

public void find()
          throws Exception
Initiate a find or find next operation, whatever applies. If no (more) hits are found, a message is displayed and the dialog is unlocked for a new search operation.

Specified by:
find in interface FinderHandler
Throws:
Exception

doFind

public boolean doFind()
Look for the next occurrence of the search phrase either as whole word or as part of a word, depending on the current dialog setting.

If the phrase is found (again), its position is 'remembered' for a possible findNext and its postion is highlighted in the underlying JEditorPane.

Returns:
true, if the phrase was found (again), false if not
See Also:
JEditorPane


Copyright ©2005