Package ghidra.framework.main

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CHOOSE_FOLDER`
  Dialog type for choosing a user folder.
  `static final int`
  `CREATE`
  Dialog type for creating domain data files.
  `protected static final int`
  `HEIGHT`
  `static final int`
  `OPEN`
  Dialog type for opening domain data files.
  `static final int`
  `SAVE`
  Dialog type for saving domain data files.
  `protected ProjectDataTreePanel`
  `treePanel`
  `protected static final int`
  `WIDTH`

  ### Fields inherited from class docking.DialogComponentProvider

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DataTreeDialog(Component parent, String title, int type)`
  Construct a new DataTreeDialog for the active project.
  `DataTreeDialog(Component parent, String title, int type, DomainFileFilter filter)`
  Construct a new DataTreeDialog for the active project.
  `DataTreeDialog(Component parent, String title, int type, DomainFileFilter filter, Project project)`
  Construct a new DataTreeDialog for the given project.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `actionPerformed(ActionEvent event)`
  `void`
  `addOkActionListener(ActionListener l)`
  Add action listener that is called when the OK button is hit.
  `protected void`
  `addTreeListeners()`
  `protected JPanel`
  `buildMainPanel()`
  `protected void`
  `cancelCallback()`
  The callback method for when the "Cancel" button is pressed.
  `void`
  `close()`
  `protected void`
  `dialogShown()`
  Override this method if you want to do something when the dialog is made visible
  `void`
  `findAndSelect(String s)`
  `ActionContext`
  `getActionContext(MouseEvent event)`
  An optional extension point for subclasses to provider action context for the actions used by this provider.
  `DomainFile`
  `getDomainFile()`
  Get the selected domain file.
  `DomainFolder`
  `getDomainFolder()`
  Get the selected folder.
  `String`
  `getNameText()`
  `protected void`
  `okCallback()`
  The callback method for when the "OK" button is pressed.
  `void`
  `selectDomainFile(DomainFile file)`
  Select the node that corresponds to the given domain file.
  `void`
  `selectFolder(DomainFolder folder)`
  Select a folder in the tree.
  `void`
  `selectRootDataFolder()`
  Select the root folder in the tree.
  `void`
  `setNameText(String name)`
  `void`
  `setSearchText(String string)`
  `void`
  `setSelectedFolder(DomainFolder folder)`
  Sets a domain folder as the initially selected folder when the dialog is first shown.
  `void`
  `setTreeSelectionMode(int mode)`
  `void`
  `show()`
  `void`
  `showComponent()`
  Shows this dialog.
  `void`
  `valueChanged(GTreeSelectionEvent e)`
  TreeSelectionListener method that is called whenever the value of the selection changes.
  `boolean`
  `wasCancelled()`

  ### Methods inherited from class docking.DialogComponentProvider

  `addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, closeDialog, dialogClosed, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, 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, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, 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`

- ## Field Details

  - ### OPEN

    public static final int OPEN
    Dialog type for opening domain data files.
    See Also:
      - Constant Field Values

  - ### SAVE

    public static final int SAVE
    Dialog type for saving domain data files.
    See Also:
      - Constant Field Values

  - ### CHOOSE_FOLDER

    public static final int CHOOSE_FOLDER
    Dialog type for choosing a user folder.
    See Also:
      - Constant Field Values

  - ### CREATE

    public static final int CREATE
    Dialog type for creating domain data files.
    See Also:
      - Constant Field Values

  - ### WIDTH

    protected static final int WIDTH
    See Also:
      - Constant Field Values

  - ### HEIGHT

    protected static final int HEIGHT
    See Also:
      - Constant Field Values

  - ### treePanel

    protected ProjectDataTreePanel treePanel

- ## Constructor Details

  - ### DataTreeDialog

    public DataTreeDialog(Component parent, String title, int type)
    Construct a new DataTreeDialog for the active project. This chooser will show all project files. Following linked-folders will only be allowed if a type of `CHOOSE_FOLDER` or `OPEN` is specified. If different behavior is required a filter should be specified using the other constructor.
    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 for the active 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
    Throws:
      `IllegalArgumentException` - if invalid type is specified

  - ### DataTreeDialog

    public DataTreeDialog(Component parent, String title, int 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

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

  - ### 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`

  - ### 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)