org.icepdf.ri.util
Class SearchTextTask

java.lang.Object
  extended by org.icepdf.ri.util.SearchTextTask

public class SearchTextTask
extends java.lang.Object

This class is a utility for searching text in a PDF document. This is only a reference implementation; there is currently no support for regular expression and other advanced search features.

Since:
1.1

Constructor Summary
SearchTextTask(SearchPanel searchPanel, SwingController controller, java.lang.String pattern, boolean wholeWord, boolean caseSensitive, boolean cumulative, boolean showPages, boolean r2L, java.util.ResourceBundle messageBundle)
          Creates a new instance of the SearchTextTask.
 
Method Summary
 int getCurrent()
          Gets the page that is currently being searched by this task.
 java.lang.String getFinalMessage()
          Gets the message that should be displayed when the task has completed.
 int getLengthOfTask()
          Number pages that search task has to iterate over.
 java.lang.String getMessage()
          Returns the most recent dialog message, or null if there is no current dialog message.
 void go()
          Start the task, start searching the document for the pattern.
 boolean isCurrentlySearching()
           
 boolean isDone()
          Find out if the task has completed.
 void stop()
          Stop the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchTextTask

public SearchTextTask(SearchPanel searchPanel,
                      SwingController controller,
                      java.lang.String pattern,
                      boolean wholeWord,
                      boolean caseSensitive,
                      boolean cumulative,
                      boolean showPages,
                      boolean r2L,
                      java.util.ResourceBundle messageBundle)
Creates a new instance of the SearchTextTask.

Parameters:
searchPanel - parent search panel that start this task via an action
controller - root controller object
pattern - pattern to search for
wholeWord - ture inticates whole word search
caseSensitive - case sensitive indicates cases sensitive search
r2L - right left earch, not currently implemented.
messageBundle - message bundle used for dialog text.
Method Detail

go

public void go()
Start the task, start searching the document for the pattern.


getLengthOfTask

public int getLengthOfTask()
Number pages that search task has to iterate over.

Returns:
returns max number of pages in document being search.

getCurrent

public int getCurrent()
Gets the page that is currently being searched by this task.

Returns:
current page being processed.

stop

public void stop()
Stop the task.


isDone

public boolean isDone()
Find out if the task has completed.

Returns:
true if task is done, false otherwise.

isCurrentlySearching

public boolean isCurrentlySearching()

getMessage

public java.lang.String getMessage()
Returns the most recent dialog message, or null if there is no current dialog message.

Returns:
current message dialog text.

getFinalMessage

public java.lang.String getFinalMessage()
Gets the message that should be displayed when the task has completed.

Returns:
search completed or stoped final message.