Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class PdoTreeItem<T extends org.tentackle.pdo.PersistentDomainObject<T>>
- java.lang.Object
-
- javafx.scene.control.TreeItem<T>
-
- org.tentackle.fx.rdc.PdoTreeItem<T>
-
- Type Parameters:
T- the pdo type
- All Implemented Interfaces:
javafx.event.EventTarget
public class PdoTreeItem<T extends org.tentackle.pdo.PersistentDomainObject<T>> extends javafx.scene.control.TreeItem<T>Tree item for a PDO.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description PdoTreeItem(T pdo)Creates a tree item for a PDO.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollapse()Collapses this and all child tree items.protected voidcollapse(java.util.Set<T> pdoSet)Recursively collapses given item and all child items.voidexpand()Expands this and all child tree items.protected voidexpand(java.util.Set<T> pdoSet)Recursively expands given item and all child items.javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>>getChildren()GuiProvider<T>getGuiProvider()Lazily gets the GUI provider for the PDO.<P extends org.tentackle.pdo.PersistentDomainObject<P>>
PdoTreeItem<P>getParentPdoItem()Gets the parent PdoTreeItem.TgetPdo()Returns the PDO represented by this item.booleanisLeaf()voidsetPdo(T pdo)Sets the pdo.
Can be used to reload the pdo, for example.-
Methods inherited from class javafx.scene.control.TreeItem
addEventHandler, branchCollapsedEvent, branchExpandedEvent, buildEventDispatchChain, childrenModificationEvent, expandedItemCountChangeEvent, expandedProperty, getGraphic, getParent, getValue, graphicChangedEvent, graphicProperty, isExpanded, leafProperty, nextSibling, nextSibling, parentProperty, previousSibling, previousSibling, removeEventHandler, setExpanded, setGraphic, setValue, toString, treeNotificationEvent, valueChangedEvent, valueProperty
-
-
-
-
Constructor Detail
-
PdoTreeItem
public PdoTreeItem(T pdo)
Creates a tree item for a PDO.- Parameters:
pdo- the pdo
-
-
Method Detail
-
getPdo
public T getPdo()
Returns the PDO represented by this item.- Returns:
- the PDO
-
setPdo
public void setPdo(T pdo)
Sets the pdo.
Can be used to reload the pdo, for example.- Parameters:
pdo- the pdo
-
isLeaf
public boolean isLeaf()
-
getChildren
public javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> getChildren()
-
getParentPdoItem
public <P extends org.tentackle.pdo.PersistentDomainObject<P>> PdoTreeItem<P> getParentPdoItem()
Gets the parent PdoTreeItem.- Type Parameters:
P- the parent PDO type- Returns:
- the parent, null if no parent or parent is no PdoTreeItem
-
getGuiProvider
public GuiProvider<T> getGuiProvider()
Lazily gets the GUI provider for the PDO.- Returns:
- the provider, never null
-
expand
public void expand()
Expands this and all child tree items.
-
collapse
public void collapse()
Collapses this and all child tree items.
-
expand
protected void expand(java.util.Set<T> pdoSet)
Recursively expands given item and all child items.- Parameters:
pdoSet- holds already expanded PDOs to detect recursion loops
-
collapse
protected void collapse(java.util.Set<T> pdoSet)
Recursively collapses given item and all child items.- Parameters:
pdoSet- holds already collapsed PDOs to detect recursion loops
-
-