Package ghidra.framework.main.datatable

# Interface ProjectTreeContext

All Known Implementing Classes:
  `DialogProjectTreeContext`, `FrontEndProjectTreeContext`

public interface ProjectTreeContext
Common methods appropriate for both the `FrontEndProjectTreeContext` and the `DialogProjectTreeContext`. The project tree actions require that the contexts be separate even though they need many of the same methods. By extracting the methods to this interface, the contexts can be kept separate, but can share action code.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `GTreeNode`
  `getContextNode()`
  Returns the node that represents the context object for this context
  `int`
  `getFileCount()`
  Returns the number of files selected in the tree.
  `int`
  `getFolderCount()`
  Returns the number of folders selected in the tree.
  `List<DomainFile>`
  `getSelectedFiles()`
  Returns a list of `DomainFile`s selected in the tree.
  `List<DomainFolder>`
  `getSelectedFolders()`
  Returns a list of `DomainFolder`s selected in the tree.
  `TreePath[]`
  `getSelectionPaths()`
  Returns the list of selected `TreePath`s selected.
  `DataTree`
  `getTree()`
  Returns the project data tree component.
  `boolean`
  `hasExactlyOneFileOrFolder()`
  Returns true of only one file or folder has been selected, else false..
  `boolean`
  `hasOneOrMoreFilesAndFolders()`
  Returns true if one or more file and/or folders have been selected, else false..

- ## Method Details

  - ### getFolderCount

    int getFolderCount()
    Returns the number of folders selected in the tree.
    Returns:
      the number of folders selected in the tree.

  - ### getFileCount

    int getFileCount()
    Returns the number of files selected in the tree.
    Returns:
      the number of files selected in the tree.

  - ### hasExactlyOneFileOrFolder

    boolean hasExactlyOneFileOrFolder()
    Returns true of only one file or folder has been selected, else false..
    Returns:
      true of only one file or folder has been selected, else false.

  - ### hasOneOrMoreFilesAndFolders

    boolean hasOneOrMoreFilesAndFolders()
    Returns true if one or more file and/or folders have been selected, else false..
    Returns:
      true if one or more file and/or folders have been selected, else false.

  - ### getSelectedFolders

    List<DomainFolder> getSelectedFolders()
    Returns a list of `DomainFolder`s selected in the tree.
    Returns:
      a list of `DomainFolder`s selected in the tree.

  - ### getSelectedFiles

    List<DomainFile> getSelectedFiles()
    Returns a list of `DomainFile`s selected in the tree.
    Returns:
      a list of `DomainFile`s selected in the tree.

  - ### getTree

    DataTree getTree()
    Returns the project data tree component.
    Returns:
      the project data tree component.

  - ### getSelectionPaths

    TreePath[] getSelectionPaths()
    Returns the list of selected `TreePath`s selected.
    Returns:
      the list of selected `TreePath`s selected.

  - ### getContextNode

    GTreeNode getContextNode()
    Returns the node that represents the context object for this context
    Returns:
      the node