Package: groovy.console.ui.text

## [Java] Class FindReplaceUtility

- groovy.console.ui.text.FindReplaceUtility

-     public final class FindReplaceUtility
      extends Object

  Shared find/replace dialog support for text components used by the console.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `CLOSE_ACTION_COMMAND` | Action command for closing the dialog.
    `static Action` | `FIND_ACTION` | Shared action that repeats a find against the active text component.
    `static String` | `FIND_ACTION_COMMAND` | Action command for find operations.
    `static String` | `REPLACE_ACTION_COMMAND` | Action command for single replace operations.
    `static String` | `REPLACE_ALL_ACTION_COMMAND` | Action command for replace-all operations.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static void` | `addTextListener(TextListener tl)` Registers a listener for dialog text events.
    `` | `public static void` | `dispose()` Disposes of the shared find/replace dialog.
    `` | `public static String` | `getLastAction()` Returns: the last action
    `` | `public static int` | `getReplacementCount()` Returns: the replacement count
    `` | `public static String` | `getSearchText()` Returns: the search text
    `` | `public static void` | `registerTextComponent(JTextComponent textComponent)` Starts tracking the supplied text component for find/replace actions.
    `` | `public static void` | `removeTextListener(TextListener tl)` Removes a listener for dialog text events.
    `` | `public static void` | `showDialog()` Shows the find dialog for the active text component.
    `` | `public static void` | `showDialog(boolean isReplace)` Shows either the find or replace dialog for the active text component.
    `` | `public static void` | `unregisterTextComponent(JTextComponent textComponent)` Stops tracking the supplied text component for find/replace actions.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final String CLOSE_ACTION_COMMAND

      Action command for closing the dialog.

    - #### public static final Action FIND_ACTION

      Shared action that repeats a find against the active text component.

    - #### public static final String FIND_ACTION_COMMAND

      Action command for find operations.

    - #### public static final String REPLACE_ACTION_COMMAND

      Action command for single replace operations.

    - #### public static final String REPLACE_ALL_ACTION_COMMAND

      Action command for replace-all operations.

  - ### Method Detail

    - #### public static void addTextListener(TextListener tl)

      Registers a listener for dialog text events.

      Parameters:
        `tl` - the listener to add

    - #### public static void dispose()

      Disposes of the shared find/replace dialog.

    - #### public static String getLastAction()

      Returns:
        the last action

    - #### public static int getReplacementCount()

      Returns:
        the replacement count

    - #### public static String getSearchText()

      Returns:
        the search text

    - #### public static void registerTextComponent(JTextComponent textComponent)

      Starts tracking the supplied text component for find/replace actions.

      Parameters:
        `textComponent` - the text component to listen to

    - #### public static void removeTextListener(TextListener tl)

      Removes a listener for dialog text events.

      Parameters:
        `tl` - the listener to remove

    - #### public static void showDialog()

      Shows the find dialog for the active text component.

    - #### public static void showDialog(boolean isReplace)

      Shows either the find or replace dialog for the active text component.

      Parameters:
        `isReplace` - show a replace dialog rather than a find dialog if true

    - #### public static void unregisterTextComponent(JTextComponent textComponent)

      Stops tracking the supplied text component for find/replace actions.

      Parameters:
        `textComponent` - the text component to stop listening to