Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.ui.search
Class SearchProgress

java.lang.Object
  extended by oracle.javatools.ui.search.SearchProgress

public abstract class SearchProgress
extends java.lang.Object

Callback mechanism used by a SearchListener to notify the SearchField of search progress. This is only used when the style of the SearchField is SearchField.Style.SEARCH.

Obtain an object implementing this interface using SearchEvent.getSearchProgress().

API users should not extend this class directly. It is implemented internally by the SearchField.

It is safe to call all methods defined in this class on instances returned from SearchEvent.getSearchProgress() from any thread.

Since:
11.0

Constructor Summary
SearchProgress()
           
 
Method Summary
abstract  void finish()
          Notifies the SearchField that the search is complete.
 boolean isStopped()
          Indicates whether the user requested that the search be stopped.
 void setDeterminate(int totalSteps)
          Indicates that searching will take a determinate number of steps to complete.
 void setProgress(int progress)
          Sets the current progress of the search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchProgress

public SearchProgress()
Method Detail

isStopped

public final boolean isStopped()
Indicates whether the user requested that the search be stopped. You should respond to this as soon as possible by terminating the current search. You must call the finish() method when the search is complete, whether or not it was stopped.

Returns:
true if the user has requested that the search is stopped.

setDeterminate

public void setDeterminate(int totalSteps)
Indicates that searching will take a determinate number of steps to complete. This provides a hint to the SearchField that it can use determinate progress UI. By default, the field will use indeterminate progress.

You should call setProgress( int ) as each step is complete to notify the SearchField to update its progress UI.

You should not call this method twice on the same instance of SearchProgress. Once you have established the total number of steps, it should not change during the progress of a search

Parameters:
totalSteps - specifies the number of distinct steps that this search will take. Must be greater than 0.
Throws:
java.lang.IllegalArgumentException - if totalSteps is less than or equal to zero.
java.lang.IllegalStateException - if you call this method twice on the same instance.

setProgress

public void setProgress(int progress)
Sets the current progress of the search. You should call this method as each step is complete if you have previously specified the number of steps using setDeterminate(int).

You should only call this method if the setDeterminate(int) method has previously been called to establish that this search will take a specific number of steps.

Parameters:
progress - the number of completed steps. Must be greater than the zero and less than or equal to the number of total steps. If you specify a value that is less than the current progress, it will be ignored.
Throws:
java.lang.IllegalArgumentException - if progress is less than or equal to zero, or greater than the number of steps specified by setDeterminate(int).
java.lang.IllegalStateException - if setDeterminate(int) was never called to establish the total number of steps.

finish

public abstract void finish()
Notifies the SearchField that the search is complete. You must always call this when the search completes (whether it was successful or not, and even if the user canceled the search) to reset the search field.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.