Package ghidra.features.base.replace

# Class SearchAndReplaceDialog

java.lang.Object
docking.DialogComponentProvider
ghidra.features.base.replace.SearchAndReplaceDialog

All Implemented Interfaces:
  `ActionContextProvider`, `StatusListener`, `TaskListener`

public class SearchAndReplaceDialog extends DialogComponentProvider
Dialog for entering information to perform a search and replace operation.

- ## Field Summary

  ### Fields inherited from class docking.DialogComponentProvider

  `applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SearchAndReplaceDialog(int searchLimit)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SearchAndReplaceQuery`
  `getQuery()`
  Returns the query generated by the dialog when the "Ok" button is pressed or null if the dialog was cancelled.
  `boolean`
  `isOkEnabled()`
  Returns true if the "ok" button is enabled.
  `protected void`
  `okCallback()`
  The callback method for when the "OK" button is pressed.
  `void`
  `selectRegEx(boolean b)`
  Selects the RegEx checkbox in the dialog.
  `void`
  `selectSearchType(String searchType)`
  Sets the search type with the given name to be selected.
  `void`
  `setSarchAndReplaceText(String searchText, String replaceText)`
  Sets the search and replace text fields with given values.
  `void`
  `setSearchLimit(int searchLimit)`
  Sets a new maximum number of search matches to find before stopping.
  `SearchAndReplaceQuery`
  `show(PluginTool tool)`
  Convenience method for initializing the dialog, showing it and returning the query.

  ### Methods inherited from class docking.DialogComponentProvider

  `addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, closeDialog, createSharedActions, dialogClosed, dialogShown, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocation, getId, getInitialLocation, getLocationOnScreen, getParent, getPreferredSize, getRememberLocation, getRememberSize, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isDialogKeyBindingAction, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setAccessibleDescription, setApplyEnabled, setApplyToolTip, setBackground, setCancelButtonText, setCancelEnabled, setCancelToolTip, setCursor, setDefaultButton, setDefaultSize, setDialogSize, setDismissToolTip, setFocusComponent, setGlassPane, setHelpLocation, setInitialLocation, setMinimumSize, setMinimumSize, setOkButtonText, setOkEnabled, setOkToolTip, setPreferredSize, setRememberLocation, setRememberSize, setResizable, setStatusJustification, setStatusText, setStatusText, setStatusText, setTitle, setTransient, setUseSharedLocation, showProgressBar, showTaskMonitorComponent, stopProgressTimer, taskCancelled, taskCompleted, toFront, toString, waitForCurrentTask`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SearchAndReplaceDialog

    public SearchAndReplaceDialog(int searchLimit)
    Constructor
    Parameters:
      `searchLimit` - the maximum number of search matches to find before stopping.

- ## Method Details

  - ### setSearchLimit

    public void setSearchLimit(int searchLimit)
    Sets a new maximum number of search matches to find before stopping.
    Parameters:
      `searchLimit` - the new maximum number of search matches to find before stopping.

  - ### show

    public SearchAndReplaceQuery show(PluginTool tool)
    Convenience method for initializing the dialog, showing it and returning the query.
    Parameters:
      `tool` - the tool this dialog belongs to
    Returns:
      the SearchAndReplaceQuery generated by the information in the dialog when the "Ok" button is pressed, or null if the dialog was cancelled.

  - ### getQuery

    public SearchAndReplaceQuery getQuery()
    Returns the query generated by the dialog when the "Ok" button is pressed or null if the dialog was cancelled.
    Returns:
      the SearchAndReplaceQuery generated by the information in the dialog when the "Ok" button is pressed, or null if the dialog was cancelled.

  - ### okCallback

    protected void okCallback()
    Description copied from class: `DialogComponentProvider`
    The callback method for when the "OK" button is pressed.
    Overrides:
      `okCallback` in class `DialogComponentProvider`

  - ### setSarchAndReplaceText

    public void setSarchAndReplaceText(String searchText, String replaceText)
    Sets the search and replace text fields with given values.
    Parameters:
      `searchText` - the text to be put in the search field
      `replaceText` - the text to be put in the replace field

  - ### selectSearchType

    public void selectSearchType(String searchType)
    Sets the search type with the given name to be selected.
    Parameters:
      `searchType` - the name of the search type to select

  - ### isOkEnabled

    public boolean isOkEnabled()
    Returns true if the "ok" button is enabled.
    Returns:
      true if the "ok" button is enabled.

  - ### selectRegEx

    public void selectRegEx(boolean b)
    Selects the RegEx checkbox in the dialog.
    Parameters:
      `b` - true to select RegEx, false to turn deselect it