Class OntologyBrowser.OntologyTab

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Enclosing class:
OntologyBrowser

public class OntologyBrowser.OntologyTab extends JPanel
Represents a single ontology tab containing a searchable checkbox tree. Provides methods for customizing the tree's appearance and behavior.
See Also:
  • Method Details

    • setCellRenderer

      public void setCellRenderer(TreeCellRenderer renderer)
      Sets a custom cell renderer for the tree.
      Parameters:
      renderer - the cell renderer
    • setCheckBoxEnabledPredicate

      public void setCheckBoxEnabledPredicate(Predicate<Object> predicate)
      Sets a predicate that controls which nodes have enabled checkboxes. Nodes for which the predicate returns false will have their checkboxes disabled (grayed out, non-clickable).
      Parameters:
      predicate - a predicate tested against each node's user object; return true to enable the checkbox
    • setPopupMenu

      public void setPopupMenu(JPopupMenu popupMenu)
      Sets a popup menu on the tree.
      Parameters:
      popupMenu - the popup menu
    • setStatusLabelPlaceholder

      public void setStatusLabelPlaceholder(String text)
      Sets the status label placeholder text on the search bar.
      Parameters:
      text - the placeholder text (e.g., "CCF v3.1")
    • getSearchableBar

      public SNTSearchableBar getSearchableBar()
      Returns the search bar for additional configuration.
      Returns:
      the searchable bar
    • getTree

      public com.jidesoft.swing.CheckBoxTree getTree()
      Returns the underlying checkbox tree.
      Returns:
      the checkbox tree
    • setRootVisible

      public void setRootVisible(boolean visible)
      Sets whether the root node is visible.
      Parameters:
      visible - true to show the root
    • setDigIn

      public void setDigIn(boolean digIn)
      Sets whether checking a parent automatically checks all children.
      Parameters:
      digIn - true to enable dig-in selection
    • expandToLevel

      public void expandToLevel(int level)
      Expands the tree to the given depth level.
      Parameters:
      level - the depth to expand to
    • setBottomPanel

      public void setBottomPanel(JPanel panel)
      Adds a bottom panel (e.g., buttons) below the tree.
      Parameters:
      panel - the panel to add
    • setCheckboxSelected

      public void setCheckboxSelected(String nodeLabel, boolean selected)
      Programmatically checks the node whose user object's toString() matches the given label.
      Parameters:
      nodeLabel - the label to match
      selected - true to check, false to uncheck
    • findNode

      public DefaultMutableTreeNode findNode(String label)
      Finds a node by matching its user object's toString() against the given label (depth-first search).
      Parameters:
      label - the label to find
      Returns:
      the matching node, or null
    • repaintTree

      public void repaintTree()
      Triggers a repaint on the tree (e.g., after external state changes that affect the cell renderer).
    • createDefaultPopupMenu

      public JPopupMenu createDefaultPopupMenu()
      Creates the default popup menu with generic tree navigation actions: Deselect All, Uncheck All, Collapse/Expand All, Collapse/Expand Selected Level, and Auto-select Children toggle. Callers can append tab-specific items to the returned menu before installing it via setPopupMenu(JPopupMenu).
      Returns:
      a new popup menu with standard tree controls