Class MethodBrowser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MethodBrowser extends JPanel
Component displaying the static public members of a set of classes. This is currently arranged as a tree. If javadocs are available (under names as described by DocNames) these are displayed alongside.

Currently, the items in the tree can be an instance of one of the following classes:

Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • MethodBrowser

      public MethodBrowser()
      Constructor.
  • Method Details

    • getTree

      public JTree getTree()
      Returns the tree which displays the classes.
      Returns:
      tree
    • getTreeModel

      public DefaultTreeModel getTreeModel()
      Returns the tree model which contains the classes for display.
      Returns:
      tree model
    • getRoot

      public DefaultMutableTreeNode getRoot()
      Returns the root node of the tree.
      Returns:
      tree root
    • addStaticClasses

      public void addStaticClasses(Class<?>[] clazzes)
      Adds the static members of a set of classes to the tree root for display.
      Parameters:
      clazzes - classes for display
    • addStaticClass

      public void addStaticClass(Class<?> clazz, DefaultMutableTreeNode parent)
      Adds a new class to the tree containing available static methods.
      Parameters:
      clazz - class to add
      parent - tree node to append it to
    • textFor

      public String textFor(Object userObj)
      Returns the string to get used for representing a node in the tree.
      Parameters:
      userObj - user object at node
      Returns:
      suitable text
    • iconFor

      public Icon iconFor(Object userObj)
      Returns the icon to get used for representing a node in the tree.
      Parameters:
      userObj - user object at node
      Returns:
      suitable icon