groovy.ui.text
Class FindReplaceUtility

java.lang.Object
  extended by groovy.ui.text.FindReplaceUtility

public final class FindReplaceUtility
extends java.lang.Object

Author:
Evan "Hippy" Slatis

Nested Class Summary
private static class FindReplaceUtility.CloseAction
           
private static class FindReplaceUtility.FindAction
           
private static class FindReplaceUtility.ReplaceAction
           
private static class FindReplaceUtility.ReplaceAllAction
           
 
Field Summary
private static javax.swing.text.AttributeSet attributeSet
           
private static javax.swing.JPanel BUTTON_PANEL
           
private static javax.swing.JPanel CHECK_BOX_PANEL
           
private static javax.swing.Action CLOSE_ACTION
           
static java.lang.String CLOSE_ACTION_COMMAND
           
private static javax.swing.JButton CLOSE_BUTTON
           
private static javax.swing.JPanel ENTRY_PANEL
           
private static javax.swing.event.EventListenerList EVENT_LISTENER_LIST
           
static javax.swing.Action FIND_ACTION
           
static java.lang.String FIND_ACTION_COMMAND
           
private static javax.swing.JButton FIND_BUTTON
           
private static javax.swing.JComboBox FIND_FIELD
           
private static javax.swing.JLabel FIND_LABEL
           
private static javax.swing.JPanel FIND_PANEL
           
private static javax.swing.JDialog FIND_REPLACE_DIALOG
           
private static int findReplaceCount
           
private static javax.swing.JCheckBox IS_BACKWARDS_CHECKBOX
           
private static java.lang.String lastAction
           
private static javax.swing.JCheckBox MATCH_CASE_CHECKBOX
           
private static javax.swing.Action REPLACE_ACTION
           
static java.lang.String REPLACE_ACTION_COMMAND
           
static java.lang.String REPLACE_ALL_ACTION_COMMAND
           
private static javax.swing.JButton REPLACE_ALL_BUTTON
           
private static javax.swing.JButton REPLACE_BUTTON
           
private static javax.swing.JComboBox REPLACE_FIELD
           
private static javax.swing.JLabel REPLACE_LABEL
           
private static javax.swing.JPanel REPLACE_PANEL
           
private static javax.swing.text.Segment SEGMENT
           
private static javax.swing.JPanel TEXT_FIELD_PANEL
           
private static java.awt.event.FocusAdapter TEXT_FOCUS_LISTENER
           
private static javax.swing.text.JTextComponent textComponent
           
private static javax.swing.JCheckBox WRAP_SEARCH_CHECKBOX
           
 
Constructor Summary
private FindReplaceUtility()
           
 
Method Summary
static void addTextListener(java.awt.event.TextListener tl)
           
static void dispose()
           
private static int findNext(boolean reverse, int pos)
          Find and select the next searchable matching text.
private static void fireTextEvent()
           
static java.lang.String getLastAction()
           
static int getReplacementCount()
           
static java.lang.String getSearchText()
           
static void registerTextComponent(javax.swing.text.JTextComponent textComponent)
           
static void removeTextListener(java.awt.event.TextListener tl)
           
private static void setListStrings()
           
static void showDialog()
           
static void showDialog(boolean isReplace)
           
static void unregisterTextComponent(javax.swing.text.JTextComponent textComponent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIND_ACTION_COMMAND

public static final java.lang.String FIND_ACTION_COMMAND
See Also:
Constant Field Values

REPLACE_ACTION_COMMAND

public static final java.lang.String REPLACE_ACTION_COMMAND
See Also:
Constant Field Values

REPLACE_ALL_ACTION_COMMAND

public static final java.lang.String REPLACE_ALL_ACTION_COMMAND
See Also:
Constant Field Values

CLOSE_ACTION_COMMAND

public static final java.lang.String CLOSE_ACTION_COMMAND
See Also:
Constant Field Values

FIND_ACTION

public static final javax.swing.Action FIND_ACTION

FIND_REPLACE_DIALOG

private static final javax.swing.JDialog FIND_REPLACE_DIALOG

TEXT_FIELD_PANEL

private static final javax.swing.JPanel TEXT_FIELD_PANEL

ENTRY_PANEL

private static final javax.swing.JPanel ENTRY_PANEL

FIND_PANEL

private static final javax.swing.JPanel FIND_PANEL

FIND_LABEL

private static final javax.swing.JLabel FIND_LABEL

FIND_FIELD

private static final javax.swing.JComboBox FIND_FIELD

REPLACE_PANEL

private static final javax.swing.JPanel REPLACE_PANEL

REPLACE_LABEL

private static final javax.swing.JLabel REPLACE_LABEL

REPLACE_FIELD

private static final javax.swing.JComboBox REPLACE_FIELD

BUTTON_PANEL

private static final javax.swing.JPanel BUTTON_PANEL

FIND_BUTTON

private static final javax.swing.JButton FIND_BUTTON

REPLACE_BUTTON

private static final javax.swing.JButton REPLACE_BUTTON

REPLACE_ALL_BUTTON

private static final javax.swing.JButton REPLACE_ALL_BUTTON

CLOSE_BUTTON

private static final javax.swing.JButton CLOSE_BUTTON

CLOSE_ACTION

private static final javax.swing.Action CLOSE_ACTION

REPLACE_ACTION

private static final javax.swing.Action REPLACE_ACTION

CHECK_BOX_PANEL

private static final javax.swing.JPanel CHECK_BOX_PANEL

MATCH_CASE_CHECKBOX

private static final javax.swing.JCheckBox MATCH_CASE_CHECKBOX

IS_BACKWARDS_CHECKBOX

private static final javax.swing.JCheckBox IS_BACKWARDS_CHECKBOX

WRAP_SEARCH_CHECKBOX

private static final javax.swing.JCheckBox WRAP_SEARCH_CHECKBOX

textComponent

private static javax.swing.text.JTextComponent textComponent

attributeSet

private static javax.swing.text.AttributeSet attributeSet

findReplaceCount

private static int findReplaceCount

lastAction

private static java.lang.String lastAction

EVENT_LISTENER_LIST

private static final javax.swing.event.EventListenerList EVENT_LISTENER_LIST

SEGMENT

private static final javax.swing.text.Segment SEGMENT

TEXT_FOCUS_LISTENER

private static final java.awt.event.FocusAdapter TEXT_FOCUS_LISTENER
Constructor Detail

FindReplaceUtility

private FindReplaceUtility()
Method Detail

addTextListener

public static void addTextListener(java.awt.event.TextListener tl)

fireTextEvent

private static void fireTextEvent()

getLastAction

public static java.lang.String getLastAction()
Returns:
the last action

getReplacementCount

public static int getReplacementCount()
Returns:
the replacement count

getSearchText

public static java.lang.String getSearchText()
Returns:
the search text

registerTextComponent

public static void registerTextComponent(javax.swing.text.JTextComponent textComponent)
Parameters:
textComponent - the text component to listen to

removeTextListener

public static void removeTextListener(java.awt.event.TextListener tl)

findNext

private static int findNext(boolean reverse,
                            int pos)
Find and select the next searchable matching text.

Parameters:
reverse - look forwards or backwards
pos - the starting index to start finding from
Returns:
the location of the next selected, or -1 if not found

setListStrings

private static void setListStrings()

showDialog

public static void showDialog()

showDialog

public static void showDialog(boolean isReplace)
Parameters:
isReplace - show a replace dialog rather than a find dialog if true

unregisterTextComponent

public static void unregisterTextComponent(javax.swing.text.JTextComponent textComponent)
Parameters:
textComponent - the text component to stop listening to

dispose

public static void dispose()


Copyright © ${year} The Codehaus. All Rights Reserved.