Class BindableTreeNode<T>
java.lang.Object
com.inductiveautomation.ignition.designer.mvvm.binders.swing.BindableTreeNode<T>
- All Implemented Interfaces:
Disposable, TriStateCheckBoxTree.CheckBoxVisibleAware, CheckBoxTreeBinders.CheckBoxEnabledAware, TreeNode
public class BindableTreeNode<T>
extends Object
implements TreeNode, CheckBoxTreeBinders.CheckBoxEnabledAware, TriStateCheckBoxTree.CheckBoxVisibleAware, Disposable
A simple, type-safe implementation of
TreeNode suitable for binding
arbitrary values to a Swing JTree. Uses generics for the bound value type.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumstatic final recordLazily-allocated record holding all checkbox-related state.static enum -
Constructor Summary
ConstructorsConstructorDescriptionBindableTreeNode(BindableTreeNode<T> parent, T value, boolean allowsChildren, List<BindableTreeNode<T>> children, @Nullable BindableTreeNode.CheckBoxProps checkBoxProps, UUID uuid, long timestamp) -
Method Summary
Modifier and TypeMethodDescriptionaddChild(T childValue, BindableTreeNode.CheckBoxBehavior checkBoxBehavior) addLeafChild(T childValue) Adds a child withallowsChildren = false, so the tree never shows an expand handle.static <T> BindableTreeNode.Builder<T> builder(T value) Builder for BindableTreeNode.Enumeration<? extends TreeNode> children()voidclear()deepCopy()static <T> BindableTreeNode<T> deepCopyTree(BindableTreeNode<T> node) voiddispose()booleangetChildAt(int childIndex) intintlonggetUuid()getValue()booleanbooleanbooleanisLeaf()static <T> BindableTreeNode<T> of(BindableTreeNode<T> parent, T value) static <T> BindableTreeNode<T> of(BindableTreeNode<T> parent, T value, boolean allowsChildren) static <T> BindableTreeNode<T> of(T value) booleanremoveChild(BindableTreeNode<T> child) voidsetCheckBoxEnabled(boolean enabled) voidvoidsetCheckBoxVisible(boolean visible) toString()
-
Constructor Details
-
BindableTreeNode
public BindableTreeNode(BindableTreeNode<T> parent, T value, boolean allowsChildren, List<BindableTreeNode<T>> children, @Nullable BindableTreeNode.CheckBoxProps checkBoxProps, UUID uuid, long timestamp)
-
-
Method Details
-
of
-
of
-
of
public static <T> BindableTreeNode<T> of(BindableTreeNode<T> parent, T value, boolean allowsChildren) -
getCheckBoxState
-
setCheckBoxState
-
getUuid
-
getTimestamp
public long getTimestamp() -
addChild
-
addChild
public BindableTreeNode<T> addChild(T childValue, BindableTreeNode.CheckBoxBehavior checkBoxBehavior) -
addLeafChild
Adds a child withallowsChildren = false, so the tree never shows an expand handle. -
removeChild
-
getValue
-
getChildAt
- Specified by:
getChildAtin interfaceTreeNode
-
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceTreeNode
-
getParent
-
getIndex
-
getAllowsChildren
public boolean getAllowsChildren()- Specified by:
getAllowsChildrenin interfaceTreeNode
-
isLeaf
-
children
-
clear
public void clear() -
isCheckBoxEnabled
public boolean isCheckBoxEnabled()- Specified by:
isCheckBoxEnabledin interfaceCheckBoxTreeBinders.CheckBoxEnabledAware
-
isCheckBoxVisible
public boolean isCheckBoxVisible()- Specified by:
isCheckBoxVisiblein interfaceTriStateCheckBoxTree.CheckBoxVisibleAware
-
toString
-
deepCopy
-
deepCopyTree
-
setCheckBoxEnabled
public void setCheckBoxEnabled(boolean enabled) -
setCheckBoxVisible
public void setCheckBoxVisible(boolean visible) -
getCheckBoxBehavior
-
dispose
public void dispose()- Specified by:
disposein interfaceDisposable
-
builder
Builder for BindableTreeNode.
-