Class ClassBrowserTree

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class ClassBrowserTree extends JTree
This class is used to display all the storable classes from the database in the form of a JTree component. Each node of this tree is an object of DefaultMutableTreeNode which has an userObject of type DDClass.
See Also:
  • Constructor Details

    • ClassBrowserTree

      public ClassBrowserTree(DataDictionary dictionary)
      Creates a ClassBrowserTree containing all of the storable classes described by the DataDictionary instance.
      Parameters:
      dictionary - The initialized DataDictionary instance
    • ClassBrowserTree

      public ClassBrowserTree(DataDictionary dictionary, String[] classList)
      Creates a ClassBrowserTree containing only the storable classes described in the classList.
      Parameters:
      dictionary - The initialized DataDictionary instance
      classList - The list of storable classes to display, specified as Strings ("/account", "/service", etc.).
  • Method Details

    • parseTreeModel

      protected void parseTreeModel() throws EBufException
      Throws:
      EBufException
    • createClassTree

      protected void createClassTree(String title)
    • convertValueToText

      public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
      Overrides:
      convertValueToText in class JTree
    • collapsePath

      public void collapsePath(TreePath path)
      Ensures that the node identified by the specified path is collapsed and viewable.
      Overrides:
      collapsePath in class JTree
      Parameters:
      path - the TreePath identifying a node
    • expandAndSelect

      public TreePath expandAndSelect(String nameToFind)
      Attempts to locate the tree node representing the storable class type passed in. If found, that node will be expanded and selected. You can retrieve the actual DDClass for the expanded node via the getUserObject() method on the last path component in the returned TreePath.
      Parameters:
      nameToFind - The storable class to find (i.e. "/event")
      Returns:
      The TreePath to the node representing the storable class; null if not found.