Class ProjectDataTreePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ProjectDataTreePanel extends JPanel
Panel that contains a DataTree for showing project data. Controls whether the data tree supports drag and drop operations.
See Also:
  • Constructor Details

    • ProjectDataTreePanel

      public ProjectDataTreePanel(FrontEndPlugin plugin)
      Construct an empty panel that is going to be used as the active panel
      Parameters:
      plugin - front end plugin
    • ProjectDataTreePanel

      public ProjectDataTreePanel(String projectName, boolean isActiveProject, FrontEndPlugin plugin, DomainFileFilter filter)
      Constructor
      Parameters:
      projectName - name of project
      isActiveProject - true if the project is active, and the data tree may be modified
      plugin - front end plugin; will be null if the panel is used in a dialog
      filter - optional filter that is used to hide programs from view
  • Method Details

    • getTreeSelectionModel

      public TreeSelectionModel getTreeSelectionModel()
    • setProjectData

      public void setProjectData(String projectName, ProjectData projectData)
      Set the project data for this data tree and populate it with nodes for the users in the project.
      Parameters:
      projectName - name of project
      projectData - data that has the root folder for the project
    • updateProjectName

      public void updateProjectName(String newName)
      Update the project name
      Parameters:
      newName - the new name
    • closeRootFolder

      public void closeRootFolder()
      Close the root folder for this data tree.
    • selectRootDataFolder

      public void selectRootDataFolder()
      Select the root data folder (not root node in the tree which shows the project name).
    • selectDomainFolder

      public void selectDomainFolder(DomainFolder domainFolder)
    • selectDomainFiles

      public void selectDomainFiles(Set<DomainFile> files)
    • selectDomainFile

      public void selectDomainFile(DomainFile domainFile)
    • setHelpLocation

      public void setHelpLocation(HelpLocation helpLocation)
    • setDomainFileFilter

      public void setDomainFileFilter(DomainFileFilter filter)
      Set the filter on this data tree.
      Parameters:
      filter - determines what should be included in the data tree
    • getSelectedItemCount

      public int getSelectedItemCount()
      Get the number of selected items in the tree. These could be either files or folders.
      Returns:
      the number of selected items in the tree.
    • getSelectedDomainFolder

      public DomainFolder getSelectedDomainFolder()
      Get the last selected domain folder.
      Returns:
      null if no domain folder is selected.
    • getSelectedDomainFile

      public DomainFile getSelectedDomainFile()
      Get the last selected domain file.
      Returns:
      null if no domain file is selected.
    • addTreeSelectionListener

      public void addTreeSelectionListener(GTreeSelectionListener l)
      Add the tree selection listener to the data tree. When the listener is notified of the selection change, it should call getSelectedDomainFolder() and getSelectedDomainFile() to get the last selected object.
      Parameters:
      l - listener to add
    • removeTreeSelectionListener

      public void removeTreeSelectionListener(GTreeSelectionListener l)
      Remove the tree selection listener from the data tree.
      Parameters:
      l - listener to remove
    • addTreeMouseListener

      public void addTreeMouseListener(MouseListener l)
    • removeTreeMouseListener

      public void removeTreeMouseListener(MouseListener l)
    • setPreferredTreePanelSize

      public void setPreferredTreePanelSize(Dimension d)
    • getProjectData

      public ProjectData getProjectData()
    • projectRenamed

      public void projectRenamed(String newName)
      Notification that the project was renamed; update the root node name and reload the node
      Parameters:
      newName - the new project name
    • dispose

      public void dispose()
    • getActionContext

      public ActionContext getActionContext(ComponentProvider provider, MouseEvent e)
      Get the data tree node that is selected
      Parameters:
      provider - the provider with which to construct the new context
      e - mouse event for the popup; may be null if this is being called as a result of the key binding pressed
      Returns:
      the new context; null if there is no selection
    • getDataTree

      public DataTree getDataTree()
    • setTreeFilterEnabled

      public void setTreeFilterEnabled(boolean enabled)
      Adds or removes the filter from the tree.
      Parameters:
      enabled - Tree adds the filter; false removes it
    • getFilterField

      public Component getFilterField()
    • getExpandedPathsByNodeName

      public String[] getExpandedPathsByNodeName()
    • setExpandedPathsByNodeName

      public void setExpandedPathsByNodeName(String[] stringPaths)
    • checkOpen

      public void checkOpen(MouseEvent e)
    • findAndSelect

      public void findAndSelect(String s)
      Find a node that has the given name and select it.
      Parameters:
      s - node name