Class AbstractDataTreeDialog

java.lang.Object
docking.DialogComponentProvider
ghidra.framework.main.AbstractDataTreeDialog
All Implemented Interfaces:
ActionContextProvider, GTreeSelectionListener, StatusListener, TaskListener, ActionListener, EventListener
Direct Known Subclasses:
DataTreeDialog, OpenVersionedFileDialog

public abstract class AbstractDataTreeDialog extends DialogComponentProvider implements GTreeSelectionListener, ActionListener
Base dialog for choosing DomainFiles. Provides and manages the base data tree panel. Subclasses should call the buildDataTreePanel() when they are constructing their main panels. They should also call the initializeFocusedComponent() method so that default focus for the dialog is in the text field if it is enabled or otherwise the focus should be the tree.
  • Field Details

  • Constructor Details

    • AbstractDataTreeDialog

      protected AbstractDataTreeDialog(Component parent, String title, DataTreeDialogType type, DomainFileFilter filter, Project project)
      Construct a new DataTreeDialog for the given project.
      Parameters:
      parent - dialog's parent
      title - title to use
      type - specify OPEN, SAVE, CHOOSE_FOLDER, or CHOOSE_USER_FOLDER
      filter - filter used to control what is displayed in the data tree
      project - the project to browse
      Throws:
      IllegalArgumentException - if invalid type is specified
  • Method Details

    • initializeFocusedComponent

      protected void initializeFocusedComponent()
    • setTreeSelectionMode

      public void setTreeSelectionMode(int mode)
    • addOkActionListener

      public void addOkActionListener(ActionListener l)
      Add action listener that is called when the OK button is hit.
      Parameters:
      l - listener to add
    • getActionContext

      public ActionContext getActionContext(MouseEvent event)
      Description copied from class: DialogComponentProvider
      An optional extension point for subclasses to provider action context for the actions used by this provider.
      Specified by:
      getActionContext in interface ActionContextProvider
      Overrides:
      getActionContext in class DialogComponentProvider
      Parameters:
      event - The mouse event used (may be null) to generate a popup menu
    • show

      public void show()
    • showComponent

      public void showComponent()
      Shows this dialog. The preferred show method is show(), as it is the preferred nomenclature.
    • getNameText

      public String getNameText()
    • setNameText

      public void setNameText(String name)
    • setSelectedFolder

      public void setSelectedFolder(DomainFolder folder)
      Sets a domain folder as the initially selected folder when the dialog is first shown.
      Parameters:
      folder - DomainFolder to select when showing the dialog
    • getDomainFile

      public DomainFile getDomainFile()
      Get the selected domain file.
      Returns:
      null if there was no domain file selected
    • getDomainFolder

      public DomainFolder getDomainFolder()
      Get the selected folder.
      Returns:
      null if there was no domain folder selected
    • valueChanged

      public void valueChanged(GTreeSelectionEvent e)
      TreeSelectionListener method that is called whenever the value of the selection changes.
      Specified by:
      valueChanged in interface GTreeSelectionListener
      Parameters:
      e - the event that characterizes the change.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Specified by:
      actionPerformed in interface ActionListener
    • selectRootDataFolder

      public void selectRootDataFolder()
      Select the root folder in the tree.
    • selectFolder

      public void selectFolder(DomainFolder folder)
      Select a folder in the tree.
      Parameters:
      folder - the folder to select
    • selectDomainFile

      public void selectDomainFile(DomainFile file)
      Select the node that corresponds to the given domain file.
      Parameters:
      file - the file
    • close

      public void close()
      Overrides:
      close in class DialogComponentProvider
    • buildDataTreePanel

      protected JPanel buildDataTreePanel()
    • okCallback

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

      public boolean wasCancelled()
    • cancelCallback

      protected void cancelCallback()
      Description copied from class: DialogComponentProvider
      The callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.
      Overrides:
      cancelCallback in class DialogComponentProvider
    • addTreeListeners

      protected void addTreeListeners()
    • setSearchText

      public void setSearchText(String s)
    • getDefaultFilter

      protected static DomainFileFilter getDefaultFilter(DataTreeDialogType type)