Class TreeSelectionContext

All Implemented Interfaces:
Extensible, SelectionChangeEmitter, SelectionContext, SelectionSource

public class TreeSelectionContext extends AbstractSelectionContext
A selection provider that wraps a JTree. Elements contained in Selections handled by this provider represent currently selected tree node paths as Object[] values.
  • Constructor Details

    • TreeSelectionContext

      public TreeSelectionContext(JTree tree)
  • Method Details

    • getSelection

      public Selection getSelection()
      Returns:
      The current selection. The selection may be empty, but never null.
      See Also:
    • setSelection

      public void setSelection(Selection selection)
      Description copied from interface: SelectionContext
      Sets a new selection.
      Parameters:
      selection - The new selection.
    • getTree

      public JTree getTree()
    • setTree

      public void setTree(JTree tree)
    • handleTreeSelectionChanged

      protected void handleTreeSelectionChanged(TreeSelectionEvent event)