com.alee.extended.tree
Class WebCheckBoxTree<E extends javax.swing.tree.DefaultMutableTreeNode>

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTree
                  extended by com.alee.laf.tree.WebTree<E>
                      extended by com.alee.extended.tree.WebCheckBoxTree<E>
All Implemented Interfaces:
FontMethods<WebTree<E>>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable

public class WebCheckBoxTree<E extends javax.swing.tree.DefaultMutableTreeNode>
extends WebTree<E>

This WebTree extension class provides additional checkbox tree functionality. Basically this tree puts its own rendered behind the one specified by developer and uses it to render checkboxes.

Author:
Mikle Garin
See Also:
Serialized Form

Nested Class Summary
protected  class WebCheckBoxTree.Handler
          WebCheckBoxTree mouse and key actions handler.
 
Nested classes/interfaces inherited from class javax.swing.JTree
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DropLocation, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.tree.TreeCellRenderer actualCellRenderer
          Actual content renderer;
protected  CheckBoxTreeCellRenderer checkBoxCellRenderer
          Checkbox cell renderer.
protected  java.lang.Integer checkBoxRendererGap
           
protected  java.lang.Boolean checkBoxVisible
           
protected  java.lang.Boolean checkingEnabled
           
protected  TreeCheckingModel<E> checkingModel
          Cusstom checking model.
protected  java.lang.Boolean checkMixedOnToggle
           
protected  java.util.List<CheckStateChangeListener<E>> checkStateChangeListeners
          Checkbox tree check state change listeners.
protected  StateProvider<E> enabledStateProvider
          Checkbox enabled state provider.
protected  WebCheckBoxTree.Handler handler
          Tree actions handler.
protected  java.lang.Boolean recursiveChecking
          Style settings.
protected  StateProvider<E> visibleStateProvider
          Checkbox visibility state provider.
 
Fields inherited from class com.alee.laf.tree.WebTree
cellEditorListeners, CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, scrollToSelectionListener, SINGLE_TREE_SELECTION
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebCheckBoxTree()
          Constructs tree with default sample model.
WebCheckBoxTree(E root)
          Constructs tree with model based on specified root node.
WebCheckBoxTree(E root, boolean asksAllowsChildren)
          Constructs tree with model based on specified root node and which decides whether a node is a leaf node in the specified manner.
WebCheckBoxTree(java.util.Hashtable<?,?> value)
          Constructs tree with model based on specified values.
WebCheckBoxTree(java.lang.Object[] value)
          Constructs tree with model based on specified values.
WebCheckBoxTree(javax.swing.tree.TreeModel newModel)
          Constructs tree with specified model.
WebCheckBoxTree(java.util.Vector<?> value)
          Constructs tree with model based on specified values.
 
Method Summary
 void addCheckStateChangeListener(CheckStateChangeListener<E> listener)
          Adds check state change listener.
 void checkAll()
          Checks all tree nodes.
protected  WebCheckBoxTreeCellRenderer createCheckBoxTreeCellRenderer()
          Creates and returns checkbox tree cell renderer.
protected  TreeCheckingModel<E> createDefaultCheckingModel(WebCheckBoxTree<E> checkBoxTree)
          Creates and returns new default checking model for the specified checkbox tree.
 void fireCheckStateChanged(java.util.List<CheckStateChange<E>> stateChanges)
          Informs about single or multiply check state changes.
 javax.swing.tree.TreeCellRenderer getActualRenderer()
          Returns actual tree cell renderer.
 java.awt.Rectangle getCheckBoxBounds(E node)
          Returns checkbox bounds for the specified tree node.
 java.awt.Rectangle getCheckBoxBounds(javax.swing.tree.TreePath treePath)
          Returns checkbox bounds for the specified tree path.
 CheckBoxTreeCellRenderer getCheckBoxCellRenderer()
          Returns checkbox tree cell renderer.
 int getCheckBoxRendererGap()
          Returns gap between checkbox and actual tree renderer.
 java.util.List<E> getCheckedNodes()
          Returns optimized list of checked nodes.
 java.util.List<E> getCheckedNodes(boolean optimize)
          Returns list of checked nodes.
 TreeCheckingModel<E> getCheckingModel()
          Returns tree checking model.
 CheckState getCheckState(E node)
          Returns specified tree node check state.
 java.util.List<E> getMixedNodes()
          Returns list of nodes in mixed state.
protected  void init()
          Initializes additional tree settings.
 void invertCheck(E node)
          Inverts tree node check.
 void invertCheck(java.util.List<E> nodes)
          Inverts tree node check.
 boolean isCheckBoxEnabled(E node)
          Returns whether checkbox for the specified node should be enabled or not.
 boolean isCheckBoxVisible()
          Returns whether checkboxes are visible in the tree or not.
 boolean isCheckBoxVisible(E node)
          Returns whether checkbox for the specified node should be visible or not.
 boolean isChecked(E node)
          Returns whether the specified tree node is checked or not.
 boolean isCheckingByUserEnabled()
          Returns whether user can change checkbox states or not.
 boolean isCheckingEnabled()
          Returns whether user can interact with checkboxes to change their check state or not.
 boolean isCheckMixedOnToggle()
          Returns whether partially checked node should be checked or unchecked on toggle.
 boolean isMixed(E node)
          Returns whether the specified tree node is partially checked or not.
 boolean isRecursiveCheckingEnabled()
          Returns whether checked or unchecked node childs should be checked or unchecked recursively or not.
 boolean isUnchecked(E node)
          Returns whether the specified tree nod is unchecked or not.
 void removeCheckStateChangeListener(CheckStateChangeListener listener)
          Removes check state change listener.
 void setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
          
 void setCheckBoxEnabledStateProvider(StateProvider<E> provider)
          Sets enabled state provider.
 void setCheckBoxRendererGap(int gap)
          Sets gap between checkbox and actual tree renderer.
 void setCheckBoxTreeCellRenderer(CheckBoxTreeCellRenderer renderer)
          Sets special checkbox tree cell renderer.
 void setCheckBoxVisible(boolean visible)
          Sets whether checkboxes are visible in the tree or not.
 void setCheckBoxVisibleStateProvider(StateProvider<E> provider)
          Sets visibility state provider.
 void setChecked(java.util.Collection<E> nodes, boolean checked)
          Sets specified nodes state to checked.
 void setChecked(E node, boolean checked)
          Sets whether the specified tree node is checked or not.
 void setCheckingEnabled(boolean enabled)
          Sets whether user can interact with checkboxes to change their check state or not.
 void setCheckingModel(TreeCheckingModel<E> checkingModel)
          Sets tree checking model.
 void setCheckMixedOnToggle(boolean checkMixedOnToggle)
          Sets whether partially checked node should be checked or unchecked on toggle.
 void setRecursiveChecking(boolean recursive)
          Sets whether checked or unchecked node childs should be checked or unchecked recursively or not.
 void uncheckAll()
          Unchecks all tree nodes.
 
Methods inherited from class com.alee.laf.tree.WebTree
addCellEditorListener, changeFontSize, createTreeModel, expandAll, expandNode, expandRoot, getAllNodes, getClosestNodeForLocation, getClosestNodeForLocation, getClosestPathForLocation, getDefaultTreeModel, getDropCellShadeWidth, getFirstVisibleLeafNode, getFontName, getFontSize, getLinesColor, getNodeBounds, getNodeBounds, getNodeForLocation, getNodeForLocation, getNodeForPath, getNodeForRow, getPathForLocation, getPathForNode, getRootNode, getSelectedNode, getSelectedNodes, getSelectionRound, getSelectionShadeWidth, getSelectionStyle, getSelectorBorderColor, getSelectorColor, getSelectorRound, getSelectorStroke, getTreeState, getTreeState, getWebUI, isAutoExpandSelectedNode, isBoldFont, isExpanded, isHighlightRolloverNode, isItalicFont, isPaintLines, isPlainFont, isRolloverSelectionEnabled, isScrollToSelection, isSelected, isSelectorEnabled, removeCellEditorListener, repaint, repaint, repaint, repaint, scrollToNode, scrollToSelection, scrollToStart, selectFirstVisibleLeafNode, selectNextRow, selectNextRow, selectNodeUnderPoint, selectNodeUnderPoint, selectPreviousRow, selectPreviousRow, setAutoExpandSelectedNode, setBoldFont, setBoldFont, setCellEditor, setDropCellShadeWidth, setFontName, setFontSize, setFontSizeAndStyle, setFontSizeAndStyle, setFontStyle, setFontStyle, setHighlightRolloverNode, setItalicFont, setItalicFont, setLinesColor, setMultiplySelectionAllowed, setPaintLines, setPlainFont, setPlainFont, setRolloverSelectionEnabled, setScrollToSelection, setSelectedNode, setSelectedNodes, setSelectedNodes, setSelectionMode, setSelectionRound, setSelectionShadeWidth, setSelectionStyle, setSelectorBorderColor, setSelectorColor, setSelectorEnabled, setSelectorRound, setSelectorStroke, setTreeState, setTreeState, startEditingNode, startEditingSelectedNode, updateAllVisibleNodes, updateUI
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

recursiveChecking

protected java.lang.Boolean recursiveChecking
Style settings.


checkBoxRendererGap

protected java.lang.Integer checkBoxRendererGap

checkBoxVisible

protected java.lang.Boolean checkBoxVisible

checkingEnabled

protected java.lang.Boolean checkingEnabled

checkMixedOnToggle

protected java.lang.Boolean checkMixedOnToggle

checkingModel

protected TreeCheckingModel<E extends javax.swing.tree.DefaultMutableTreeNode> checkingModel
Cusstom checking model.


checkBoxCellRenderer

protected CheckBoxTreeCellRenderer checkBoxCellRenderer
Checkbox cell renderer.


actualCellRenderer

protected javax.swing.tree.TreeCellRenderer actualCellRenderer
Actual content renderer;


enabledStateProvider

protected StateProvider<E extends javax.swing.tree.DefaultMutableTreeNode> enabledStateProvider
Checkbox enabled state provider.


visibleStateProvider

protected StateProvider<E extends javax.swing.tree.DefaultMutableTreeNode> visibleStateProvider
Checkbox visibility state provider.


handler

protected WebCheckBoxTree.Handler handler
Tree actions handler.


checkStateChangeListeners

protected java.util.List<CheckStateChangeListener<E extends javax.swing.tree.DefaultMutableTreeNode>> checkStateChangeListeners
Checkbox tree check state change listeners.

Constructor Detail

WebCheckBoxTree

public WebCheckBoxTree()
Constructs tree with default sample model.


WebCheckBoxTree

public WebCheckBoxTree(java.lang.Object[] value)
Constructs tree with model based on specified values.

Parameters:
value - tree data

WebCheckBoxTree

public WebCheckBoxTree(java.util.Vector<?> value)
Constructs tree with model based on specified values.

Parameters:
value - tree data

WebCheckBoxTree

public WebCheckBoxTree(java.util.Hashtable<?,?> value)
Constructs tree with model based on specified values.

Parameters:
value - tree data

WebCheckBoxTree

public WebCheckBoxTree(E root)
Constructs tree with model based on specified root node.

Parameters:
root - tree root node

WebCheckBoxTree

public WebCheckBoxTree(E root,
                       boolean asksAllowsChildren)
Constructs tree with model based on specified root node and which decides whether a node is a leaf node in the specified manner.

Parameters:
root - tree root node
asksAllowsChildren - false if any node can have children, true if each node is asked to see if it can have children

WebCheckBoxTree

public WebCheckBoxTree(javax.swing.tree.TreeModel newModel)
Constructs tree with specified model.

Parameters:
newModel - tree model
Method Detail

init

protected void init()
Initializes additional tree settings.

Overrides:
init in class WebTree<E extends javax.swing.tree.DefaultMutableTreeNode>

getCheckBoxCellRenderer

public CheckBoxTreeCellRenderer getCheckBoxCellRenderer()
Returns checkbox tree cell renderer.

Returns:
checkbox tree cell renderer

getActualRenderer

public javax.swing.tree.TreeCellRenderer getActualRenderer()
Returns actual tree cell renderer.

Returns:
actual tree cell renderer

setCellRenderer

public void setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)

Overrides:
setCellRenderer in class javax.swing.JTree

setCheckBoxTreeCellRenderer

public void setCheckBoxTreeCellRenderer(CheckBoxTreeCellRenderer renderer)
Sets special checkbox tree cell renderer.

Parameters:
renderer - checkbox tree cell renderer

createCheckBoxTreeCellRenderer

protected WebCheckBoxTreeCellRenderer createCheckBoxTreeCellRenderer()
Creates and returns checkbox tree cell renderer.

Returns:
checkbox tree cell renderer

getCheckBoxRendererGap

public int getCheckBoxRendererGap()
Returns gap between checkbox and actual tree renderer.

Returns:
gap between checkbox and actual tree renderer

setCheckBoxRendererGap

public void setCheckBoxRendererGap(int gap)
Sets gap between checkbox and actual tree renderer.

Parameters:
gap - gap between checkbox and actual tree renderer

getCheckState

public CheckState getCheckState(E node)
Returns specified tree node check state.

Parameters:
node - tree node to process
Returns:
specified tree node check state

isUnchecked

public boolean isUnchecked(E node)
Returns whether the specified tree nod is unchecked or not.

Parameters:
node - tree node to process
Returns:
true if the specified tree nod is unchecked, false otherwise

isChecked

public boolean isChecked(E node)
Returns whether the specified tree node is checked or not.

Parameters:
node - tree node to process
Returns:
true if the specified tree node is checked, false otherwise

isMixed

public boolean isMixed(E node)
Returns whether the specified tree node is partially checked or not.

Parameters:
node - tree node to process
Returns:
true if the specified tree node is partially checked, false otherwise

getCheckedNodes

public java.util.List<E> getCheckedNodes()
Returns optimized list of checked nodes.

Returns:
optimized list of checked nodes

getCheckedNodes

public java.util.List<E> getCheckedNodes(boolean optimize)
Returns list of checked nodes.

Parameters:
optimize - whether should optimize the resulting list by removing checked node childs or not
Returns:
list of checked nodes

getMixedNodes

public java.util.List<E> getMixedNodes()
Returns list of nodes in mixed state.

Returns:
list of nodes in mixed state

setChecked

public void setChecked(java.util.Collection<E> nodes,
                       boolean checked)
Sets specified nodes state to checked.

Parameters:
nodes - nodes to check
checked - whether the specified tree nodes should be checked or not

setChecked

public void setChecked(E node,
                       boolean checked)
Sets whether the specified tree node is checked or not.

Parameters:
node - tree node to process
checked - whether the specified tree node is checked or not

invertCheck

public void invertCheck(E node)
Inverts tree node check.

Parameters:
node - tree node to process

invertCheck

public void invertCheck(java.util.List<E> nodes)
Inverts tree node check.

Parameters:
nodes - tree node to process

uncheckAll

public void uncheckAll()
Unchecks all tree nodes.


checkAll

public void checkAll()
Checks all tree nodes.


getCheckingModel

public TreeCheckingModel<E> getCheckingModel()
Returns tree checking model.

Returns:
tree checking model

setCheckingModel

public void setCheckingModel(TreeCheckingModel<E> checkingModel)
Sets tree checking model.

Parameters:
checkingModel - tree checking model

createDefaultCheckingModel

protected TreeCheckingModel<E> createDefaultCheckingModel(WebCheckBoxTree<E> checkBoxTree)
Creates and returns new default checking model for the specified checkbox tree.

Parameters:
checkBoxTree - checkbox tree to process
Returns:
new default checking model for the specified checkbox tree

isCheckBoxEnabled

public boolean isCheckBoxEnabled(E node)
Returns whether checkbox for the specified node should be enabled or not.

Parameters:
node - tree node to process
Returns:
true if checkbox for the specified node should be enabled, false otherwise

setCheckBoxEnabledStateProvider

public void setCheckBoxEnabledStateProvider(StateProvider<E> provider)
Sets enabled state provider. It defines whether checkboxes for specific nodes should be enabled or not.

Parameters:
provider - enabled state provider

isCheckBoxVisible

public boolean isCheckBoxVisible(E node)
Returns whether checkbox for the specified node should be visible or not.

Parameters:
node - tree node to process
Returns:
true if checkbox for the specified node should be visible, false otherwise

setCheckBoxVisibleStateProvider

public void setCheckBoxVisibleStateProvider(StateProvider<E> provider)
Sets visibility state provider. It defines whether checkboxes for specific nodes should be visible or not.

Parameters:
provider - new visibility state provider

isRecursiveCheckingEnabled

public boolean isRecursiveCheckingEnabled()
Returns whether checked or unchecked node childs should be checked or unchecked recursively or not.

Returns:
true if checked or unchecked node childs should be checked or unchecked recursively, false otherwise

setRecursiveChecking

public void setRecursiveChecking(boolean recursive)
Sets whether checked or unchecked node childs should be checked or unchecked recursively or not.

Parameters:
recursive - whether checked or unchecked node childs should be checked or unchecked recursively or not

isCheckBoxVisible

public boolean isCheckBoxVisible()
Returns whether checkboxes are visible in the tree or not.

Returns:
true if checkboxes are visible in the tree, false otherwise

setCheckBoxVisible

public void setCheckBoxVisible(boolean visible)
Sets whether checkboxes are visible in the tree or not.

Parameters:
visible - whether checkboxes are visible in the tree or not

isCheckingEnabled

public boolean isCheckingEnabled()
Returns whether user can interact with checkboxes to change their check state or not.

Returns:
true if user can interact with checkboxes to change their check state, false otherwise

setCheckingEnabled

public void setCheckingEnabled(boolean enabled)
Sets whether user can interact with checkboxes to change their check state or not.

Parameters:
enabled - whether user can interact with checkboxes to change their check state or not

isCheckMixedOnToggle

public boolean isCheckMixedOnToggle()
Returns whether partially checked node should be checked or unchecked on toggle.

Returns:
true if partially checked node should be checked on toggle, false if it should be unchecked

setCheckMixedOnToggle

public void setCheckMixedOnToggle(boolean checkMixedOnToggle)
Sets whether partially checked node should be checked or unchecked on toggle.

Parameters:
checkMixedOnToggle - whether partially checked node should be checked or unchecked on toggle

getCheckBoxBounds

public java.awt.Rectangle getCheckBoxBounds(E node)
Returns checkbox bounds for the specified tree node.

Parameters:
node - tree node to process
Returns:
checkbox bounds for the specified tree node

getCheckBoxBounds

public java.awt.Rectangle getCheckBoxBounds(javax.swing.tree.TreePath treePath)
Returns checkbox bounds for the specified tree path.

Parameters:
treePath - tree path to process
Returns:
checkbox bounds for the specified tree path

isCheckingByUserEnabled

public boolean isCheckingByUserEnabled()
Returns whether user can change checkbox states or not.

Returns:
true if user can change checkbox states, false otherwise

addCheckStateChangeListener

public void addCheckStateChangeListener(CheckStateChangeListener<E> listener)
Adds check state change listener.

Parameters:
listener - check state change listener to add

removeCheckStateChangeListener

public void removeCheckStateChangeListener(CheckStateChangeListener listener)
Removes check state change listener.

Parameters:
listener - check state change listener to remove

fireCheckStateChanged

public void fireCheckStateChanged(java.util.List<CheckStateChange<E>> stateChanges)
Informs about single or multiply check state changes.

Parameters:
stateChanges - check state changes list