|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.ri.common.search.SearchHelper
This class provides search support for html document
with or without multiple frames based on Search class,
which provides Viewport based search support.
This class is compatible with Java 1.1.8 and higher and can be used with AWT based and Swing based applications. This class supports modal (modal dialog) and non-model (non-modal dialog or panel) operation.
SearchDialog in sample browser application shows how to use this
class in a modal dialog. SearchPanel shows how to use this class
in a non-modal form.
SearchStatusEventListener or
extend SearchStatusEventAdapter and register it to
SearchHelper by calling addSearchStatusEventListener
dispose() when no more search action is performed.
SearchStatusEventListener,
SearchStatusEventAdapter,
SearchPanel,
ice.browser.SearchDialog,
Search,
Viewport| Field Summary | |
static int |
END_OF_SEARCH
End of search indicator. |
static int |
MATCH_FOUND
Match found indicator. |
static int |
NO_MATCH_FOUND
No match found indicator. |
static int |
RESET_ALL
Reset all search parameters indicator. |
static int |
RESET_HIGHLIGHT
Reset parameter highlight indicator. |
| Constructor Summary | |
SearchHelper(Viewport viewport)
Construct a new SearchHelper object. |
|
| Method Summary | |
void |
addSearchStatusEventListener(SearchStatusEventListener l)
|
void |
dispose()
Removes all added SearchStatusEventListener. |
void |
findNext()
Find and select next search match. |
void |
findPrevious()
Find and select previous occurance of search match. |
String |
getSearchText()
Retrieves search text set previously |
void |
init()
Checks for child viewports and initilizes a list of (viewport, search) pair. |
boolean |
isCaseSensitiveEnabled()
Test to see if case sensitive search mode has been enabled. |
boolean |
isHighlighed()
Test to see if highlighted mode has been set |
boolean |
isSearchReady()
Test to see if searching operation can be performed because searching operation is only allowed when browser has finished loading, parsing, and rendering. |
boolean |
isWordSearchEnabled()
Test to see if whole-word searching mode has been enabled. |
void |
propertyChange(PropertyChangeEvent e)
|
void |
removeAllSearchStatusEventListeners()
|
void |
removeSearchStatusEventListener(SearchStatusEventListener l)
|
void |
setCaseSensitiveEnabled(boolean b)
Set case-sensetivity. |
void |
setHighlighted(boolean b)
Highlight or de-highlight all of search matches. |
void |
setSearchText(String text)
Set new search text |
void |
setWordSearchEnabled(boolean b)
Sets whole-word search setting. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int NO_MATCH_FOUND
public static int END_OF_SEARCH
public static int MATCH_FOUND
public static int RESET_ALL
searchText
have been reset. Upon receiving reset call with this indicator,
SearchStatusEventListener should reset the state
of widgets for enabling/disabling match case search, highlight
search, and whole word search.
SearchPanel.reset(int)public static int RESET_HIGHLIGHT
SearchStatusEventListener should reset the state
of the widget for enabling/disabling highlight search.
SearchPanel.reset(int)| Constructor Detail |
public SearchHelper(Viewport viewport)
viewport - a top level viewport| Method Detail |
public void init()
public void dispose()
SearchStatusEventListener. Dispose
of all related search object and registered This method should be called
when browser window is closing.
public void findNext()
public void findPrevious()
public void setHighlighted(boolean b)
b - true to highlight all search matches, false to
clear all highlighted search matches.public boolean isHighlighed()
public void setCaseSensitiveEnabled(boolean b)
b - true to enabled case sensitive search.public String getSearchText()
public boolean isCaseSensitiveEnabled()
public void setWordSearchEnabled(boolean b)
By default the whole-word searching is disabled.
b - true to enable whole-word based searching, false otherwise.public boolean isWordSearchEnabled()
public void setSearchText(String text)
text - to search forpublic boolean isSearchReady()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void addSearchStatusEventListener(SearchStatusEventListener l)
public void removeSearchStatusEventListener(SearchStatusEventListener l)
public void removeAllSearchStatusEventListeners()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||