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.
  • 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