|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.ceryle.ui.search.FindReplaceDialog
public class FindReplaceDialog
A class that creates a dialog box used for searching and replacing
within the editor text area. The dialog is used for either Find or
Replace operations, depending on how it is called.
This uses the gnu.regexp regular expression (RE)
package, which allows for sixteen different (!) RE syntax variations,
which should pretty much satisfy anyone's preferences.
| Nested Class Summary | |
|---|---|
class |
FindReplaceDialog.KeyHandler
|
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected String |
ACTION_graph
|
protected String |
ACTION_keyword
|
protected String |
ACTION_regexp
|
protected String |
ACTION_string
|
protected String |
ACTION_xpath
|
static int |
BIT_asyoutype
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_caseSens
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_gettopic
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_graph
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_keyword
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_modal
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_multiline
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_regexp
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_replace
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_searchId
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_string
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_synonyms
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_vizOnly
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
BIT_xpath
Indices for BitSet settings used for searching and replacing (see code for docs). |
static int |
bitcount
This number should match the number of BitSet settings (the maximum count + 1). |
static int |
defaultLength
Default length (in characters) for the Find and Replace fields. |
static String |
graphNid
The node ID within the 'help' Collection for the graph search Help topic. |
static String |
graphResultsHeight
The identifier of the property containing the height of the find dialog box when the graph results are visible. |
protected FindReplaceDialog.KeyHandler |
key_handler
|
static String |
keywordNid
The node ID within the 'help' Collection for the keyword search Help topic. |
static String |
keywordResultsHeight
The identifier of the property containing the height of the find dialog box when the keyword results are visible. |
static int |
maxHistory
Default number of Find and Replace history items to store (must be greater than zero). |
static String |
regexpNid
The node ID within the 'help' Collection for the regular expression search Help topic. |
static RESyntax[] |
resyntax
An array of RESyntax types (0-15). |
static String[] |
resyntaxDesc
An array containing the names of the available types of regular expression syntaxes. |
static String |
searchNid
The node ID within the 'help' Collection for the introduction to searching Help topic. |
static String |
stringNid
The node ID within the 'help' Collection for the string match search Help topic. |
static String |
xpathNid
The node ID within the 'help' Collection for the XPath search Help topic. |
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
FindReplaceDialog(Desktop desktop,
GraphView graphview,
String title)
Constructor for a FindReplace dialog in 'return Topic' mode. |
|
FindReplaceDialog(Desktop desktop,
String defaultString,
BitSet settings)
Constructor for a FindReplace dialog, including find and replace histories as Vectors, an optional default search String defaultString (which can be null), and a BitSet settings to provide various search and replacement settings. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Responds to the radio buttons. |
void |
clearResults()
Clears the results list. |
void |
closeDialog()
Closes the FindReplace dialog (disposing of it). |
void |
configure(BitSet bits)
Shows or hides the replace field and enables or disables buttons according to the provided bitwise settings. |
void |
doFind(boolean next)
Performs the Find function, Find Next if next is true. |
protected void |
doReplace(boolean all)
Performs the replace function, on the entire document if the boolean all is true. |
protected boolean |
find(JTextArea textarea,
String searchString,
boolean next)
Performs the find function using the search string searchString, starting at the beginning of the text if next is false, or at the end of the last search if true. |
void |
findNext()
Performs the find function using the existing search string, from the end of the last search location in the text. |
protected DocumentView |
getDocumentView()
Returns the current DocumentView. |
protected GraphView |
getGraphView()
Returns the current GraphView. |
KeywordPanel |
getKeywordPanel()
Lazily instantiates the keyword search panel. |
Lexicon |
getLexicon()
Returns a lazily-instantiated lexicon utility. |
boolean |
getReplaceMode()
Returns true if the dialog is currently in replace mode. |
protected RESyntax |
getRESyntax(int index)
Returns an RESyntax object when provided an index index synchronous with the RE syntax JComboBox. |
TNode |
getSelectedTNode()
Returns the TNode selected in 'return Topic' mode, or null if there was no selected Topic. |
Topic |
getSelectedTopic()
Returns the Topic selected in 'return Topic' mode, or null if there was no selected Topic. |
BitSet |
getSettings()
Returns the current dialog settings as a BitSet. |
boolean |
harmonizeWithView()
Configure the dialog's search type to be compatible with the current view. |
protected void |
hideDialog()
Hides the FindReplace dialog. |
void |
keyInSource()
Called when any key is typed into the search entry. |
boolean |
lexiconAvailable()
Returns true if lexicon/synonym support is available. |
void |
setCLUT(ColorLookupTable clut)
Sets the ColorLookupTable (CLUT) to clut. |
void |
setReplaceMode(boolean replace)
Depending on the parameter, sets the dialog mode to either find (false) or replace (true) mode. |
static void |
setSearchMode(BitSet bs,
int mode)
Sets the search mode of the provided BitSet to one of the available modes. |
void |
setSearchMode(int mode)
Sets the search mode to one of the available modes, then calls configure(BitSet) to update the UI. |
void |
setSearchString(String s)
Sets the search string to s. |
void |
setVisible(boolean visible)
Overrides the dialog's method to put the insertion caret into the search field. |
void |
updateSelectionInfo(int[] stats)
Updates the display of search domain selection information. |
String |
writeMessage(int status,
String message)
Writes the message to the existing MessageHandler service, prepending a status indicator for errors and warnings. |
void |
writeMessage(String message)
Writes the message to the existing MessageHandler service. |
void |
writeStatus(String message)
Sets the content of the status line to the String message. |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static String searchNid
public static String stringNid
public static String regexpNid
public static String keywordNid
public static String xpathNid
public static String graphNid
public static final String keywordResultsHeight
public static final String graphResultsHeight
public static int defaultLength
public static int maxHistory
public static final int bitcount
public static final int BIT_replace
public static final int BIT_string
public static final int BIT_regexp
public static final int BIT_keyword
public static final int BIT_xpath
public static final int BIT_graph
public static final int BIT_caseSens
public static final int BIT_multiline
public static final int BIT_vizOnly
public static final int BIT_searchId
public static final int BIT_modal
public static final int BIT_asyoutype
public static final int BIT_synonyms
public static final int BIT_gettopic
public static final RESyntax[] resyntax
RESyntaxpublic static final String[] resyntaxDesc
protected FindReplaceDialog.KeyHandler key_handler
protected final String ACTION_string
protected final String ACTION_regexp
protected final String ACTION_keyword
protected final String ACTION_graph
protected final String ACTION_xpath
| Constructor Detail |
|---|
public FindReplaceDialog(Desktop desktop,
GraphView graphview,
String title)
public FindReplaceDialog(Desktop desktop,
String defaultString,
BitSet settings)
| Method Detail |
|---|
public void setVisible(boolean visible)
setVisible in class Componentpublic boolean harmonizeWithView()
public void setSearchString(String s)
public void setCLUT(ColorLookupTable clut)
public void setSearchMode(int mode)
configure(BitSet) to update the UI. The modes include:
public static void setSearchMode(BitSet bs,
int mode)
public void configure(BitSet bits)
public boolean getReplaceMode()
public void setReplaceMode(boolean replace)
public BitSet getSettings()
public KeywordPanel getKeywordPanel()
public void updateSelectionInfo(int[] stats)
SearchTree.getSelectionInfo()protected GraphView getGraphView()
protected DocumentView getDocumentView()
public void findNext()
public void doFind(boolean next)
public void keyInSource()
public void clearResults()
protected boolean find(JTextArea textarea,
String searchString,
boolean next)
public TNode getSelectedTNode()
public Topic getSelectedTopic()
protected void doReplace(boolean all)
protected RESyntax getRESyntax(int index)
public void writeStatus(String message)
MessageWriter API.
writeStatus in interface MessageWriter