Class DataTreeDialog

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

public class DataTreeDialog extends DialogComponentProvider implements GTreeSelectionListener, ActionListener
Dialog to open or save domain data items to a new location or name.
  • Field Details

  • Constructor Details

    • DataTreeDialog

      public DataTreeDialog(Component parent, String title, int type)
      Construct a new DataTreeDialog.
      Parameters:
      parent - dialog's parent
      title - title to use
      type - specify OPEN, SAVE, CHOOSE_FOLDER, CHOOSE_USER_FOLDER, or CREATE
      Throws:
      IllegalArgumentException - if invalid type is specified
    • DataTreeDialog

      public DataTreeDialog(Component parent, String title, int type, DomainFileFilter filter)
      Construct a new DataTreeDialog.
      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
      Throws:
      IllegalArgumentException - if invalid type is specified
  • Method Details

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

      protected void dialogShown()
      Description copied from class: DialogComponentProvider
      Override this method if you want to do something when the dialog is made visible
      Overrides:
      dialogShown in class DialogComponentProvider
    • 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.
    • 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
    • buildMainPanel

      protected JPanel buildMainPanel()
    • 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()
    • findAndSelect

      public void findAndSelect(String s)
    • setSearchText

      public void setSearchText(String string)