YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.upnp.server.configuration.TreeNode Class Reference

TreeNode is a container for the value to represent a node on the TreeView. More...

Collaboration diagram for de.yaacc.upnp.server.configuration.TreeNode:
Collaboration graph

Classes

enum  LoadState
 Whether the children of a folder were read: unknown, being read, or read (then possibly none). More...
 

Public Member Functions

 TreeNode (TreeNodeData value, int layoutId)
 
void addChild (TreeNode child)
 
void addChildren (List< TreeNode > newChildren)
 Adds all children in one go (one array growth, no per-child list work).
 
TreeNodeData getValue ()
 
void setParent (TreeNode parent)
 
TreeNode getParent ()
 
List< TreeNode > getChildren ()
 
int getLayoutId ()
 
void setLevel (int level)
 
int getLevel ()
 
void setExpanded (boolean expanded)
 
boolean isExpanded ()
 
void setSelected (boolean selected)
 
boolean isSelected ()
 
int startLoading ()
 Starts reading the children.
 
boolean cancelLoading ()
 Gives up a running load (the user collapsed the node): its result will be ignored.
 
boolean finishLoading (int generation, List< TreeNode > loadedChildren)
 Takes over the children a load has read.
 
boolean failLoading (int generation)
 A load could not read the folder: it stays unknown, so the next click asks again.
 
boolean isLoading ()
 
boolean isLoaded ()
 
boolean isKnownEmpty ()
 The folder was read and has no children - the only case in which the expand symbol is hidden.
 

Detailed Description

TreeNode is a container for the value to represent a node on the TreeView.

All methods are for the main thread. A folder's children are read on a worker thread and handed over with finishLoading; the load generation makes a result that arrives after the node was collapsed (or loaded again) harmless.

Member Function Documentation

◆ cancelLoading()

boolean de.yaacc.upnp.server.configuration.TreeNode.cancelLoading ( )

Gives up a running load (the user collapsed the node): its result will be ignored.

Returns
true if a load was running

◆ failLoading()

boolean de.yaacc.upnp.server.configuration.TreeNode.failLoading ( int generation)

A load could not read the folder: it stays unknown, so the next click asks again.

Returns
false if the result was stale

◆ finishLoading()

boolean de.yaacc.upnp.server.configuration.TreeNode.finishLoading ( int generation,
List< TreeNode > loadedChildren )

Takes over the children a load has read.

Returns
false (and nothing changed) if the load was cancelled, restarted or is already finished
Here is the call graph for this function:

◆ startLoading()

int de.yaacc.upnp.server.configuration.TreeNode.startLoading ( )

Starts reading the children.

Returns
the generation the result has to present to finishLoading / failLoading

The documentation for this class was generated from the following file: