|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectqx.core.Object
qx.core.Target
qx.ui.core.Widget
qx.ui.core.Parent
qx.ui.layout.BoxLayout
qx.ui.tree.AbstractTreeElement<T>
qx.ui.tree.TreeFolder<T>
qx.ui.tree.Tree<T>
public class Tree<T>
The Tree class implements a tree widget, with collapsable and expandable
container nodes and terminal leaf nodes. You instantiate a Tree object as the
root of the tree, then add TreeFolder
(node) and TreeFile
(leaf) objects as needed, using the (inherited) add()
method.
Beware though that the tree structure you are building is internally
augmented with other widgets to achieve the desired look and feel. So if you
later try to navigate the tree e.g. by using the
getChildren()
method, you get more (and type-wise different)
children than you initially added. If this is inconvenient you may want to
maintain a tree model alongside the tree widget in your application.
The handling of selections within a tree is somewhat distributed
between the root Tree object and the attached TreeSelectionManager
. To get the
currently selected element of a tree use the TreegetSelectedElement
method and TreesetSelectedElement
to set it. The TreeSelectionManager handles more
coars-grained issues like providing selectAll()/deselectAll() methods.
Field Summary |
---|
Fields inherited from class qx.ui.core.Widget |
---|
AUTO |
Constructor Summary | |
---|---|
Tree()
The tree constructor understands two signatures. |
|
Tree(java.lang.Object labelOrTreeRowStructure)
The tree constructor understands two signatures. |
|
Tree(java.lang.Object labelOrTreeRowStructure,
java.lang.String icon)
The tree constructor understands two signatures. |
|
Tree(java.lang.Object labelOrTreeRowStructure,
java.lang.String icon,
java.lang.String iconSelected)
The tree constructor understands two signatures. |
Method Summary | ||
---|---|---|
void |
_applyExcludeSpecificTreeLines(java.lang.Object value,
java.lang.Object old)
|
|
void |
_applyHideNode(java.lang.Object value,
java.lang.Object old)
|
|
void |
_applyRootOpenClose(java.lang.Object value,
java.lang.Object old)
|
|
void |
_applyUseTreeLines(java.lang.Object value,
java.lang.Object old)
|
|
java.lang.Object |
_onkeydown(Event e)
|
|
java.lang.Object |
_onkeypress(Event e)
|
|
void |
_onkeyup(Event e)
|
|
void |
addChildToTreeQueue(AbstractTreeElement vChild)
Adds vChild to the tree queue. |
|
static
|
create(T root)
|
|
void |
flushTreeQueue()
Flushes the tree queue. |
|
void |
flushWidgetQueue()
Flushes the tree queue. |
|
java.lang.Object |
getExcludeSpecificTreeLines()
Returns the (computed) value of the property excludeSpecificTreeLines . |
|
AbstractTreeElement |
getFirstTreeChild()
Returns itself. |
|
boolean |
getHideNode()
Returns the (computed) value of the property hideNode . |
|
java.lang.Object |
getHierarchy(java.lang.Object vArr)
Obtain the entire hierarchy of labels from the root down to the current node. |
|
java.lang.Object |
getIndentSymbol(java.lang.Object vUseTreeLines,
java.lang.Object vColumn,
java.lang.Object vLastColumn)
|
|
AbstractTreeElement |
getItems(boolean recursive,
boolean invisible)
Returns all children of the folder. |
|
java.lang.Object |
getLastTreeChild()
|
|
java.lang.Integer |
getLevel()
Always returns 0 since a Tree instance is always the root of a tree, and therefore is on level 0. |
|
SelectionManager |
getManager()
Returns the selection manager for this tree. |
|
TreeFolder |
getParentFolder()
Always returns null since a Tree instance is always the root of a tree, and therefore has no parent. |
|
boolean |
getRootOpenClose()
Returns the (computed) value of the property rootOpenClose . |
|
AbstractTreeElement |
getSelectedElement()
Returns the currently selected element within the tree. |
|
Tree |
getTree()
Returns the current tree instance, i.e. |
|
boolean |
getUseDoubleClick()
Returns the (computed) value of the property useDoubleClick . |
|
boolean |
getUseTreeLines()
Returns the (computed) value of the property useTreeLines . |
|
void |
hideNode()
|
|
void |
initExcludeSpecificTreeLines(java.lang.Object arg)
Calls the apply method and dispatches the change event of the property excludeSpecificTreeLines
with the default value defined by the class developer. |
|
void |
initHideNode(boolean arg)
Calls the apply method and dispatches the change event of the property hideNode
with the default value defined by the class developer. |
|
void |
initRootOpenClose(boolean arg)
Calls the apply method and dispatches the change event of the property rootOpenClose
with the default value defined by the class developer. |
|
void |
initUseDoubleClick(boolean arg)
Calls the apply method and dispatches the change event of the property useDoubleClick
with the default value defined by the class developer. |
|
void |
initUseTreeLines(boolean arg)
Calls the apply method and dispatches the change event of the property useTreeLines
with the default value defined by the class developer. |
|
boolean |
isHideNode()
Check whether the (computed) value of the boolean property hideNode equals true . |
|
boolean |
isRootOpenClose()
Check whether the (computed) value of the boolean property rootOpenClose equals true . |
|
boolean |
isUseDoubleClick()
Check whether the (computed) value of the boolean property useDoubleClick equals true . |
|
boolean |
isUseTreeLines()
Check whether the (computed) value of the boolean property useTreeLines equals true . |
|
void |
removeChildFromTreeQueue(AbstractTreeElement vChild)
Removes vChild from the tree queue. |
|
void |
resetExcludeSpecificTreeLines()
Resets the user value of the property excludeSpecificTreeLines . |
|
void |
resetHideNode()
Resets the user value of the property hideNode . |
|
void |
resetRootOpenClose()
Resets the user value of the property rootOpenClose . |
|
void |
resetUseDoubleClick()
Resets the user value of the property useDoubleClick . |
|
void |
resetUseTreeLines()
Resets the user value of the property useTreeLines . |
|
void |
setExcludeSpecificTreeLines(java.lang.Object arg)
Sets the user value of the property excludeSpecificTreeLines . |
|
void |
setHideNode(boolean arg)
Sets the user value of the property hideNode . |
|
void |
setRootOpenClose(boolean arg)
Sets the user value of the property rootOpenClose . |
|
void |
setSelectedElement(AbstractTreeElement vElement)
Sets the selected element in the tree to vElement. |
|
void |
setUseDoubleClick(boolean arg)
Sets the user value of the property useDoubleClick . |
|
void |
setUseTreeLines(boolean arg)
Sets the user value of the property useTreeLines . |
|
boolean |
toggleHideNode()
Toggles the (computed) value of the boolean property hideNode . |
|
boolean |
toggleRootOpenClose()
Toggles the (computed) value of the boolean property rootOpenClose . |
|
boolean |
toggleUseDoubleClick()
Toggles the (computed) value of the boolean property useDoubleClick . |
|
boolean |
toggleUseTreeLines()
Toggles the (computed) value of the boolean property useTreeLines . |
|
void |
useDoubleClick()
|
|
void |
useTreeLines()
|
Methods inherited from class qx.core.Target |
---|
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener |
Methods inherited from class qx.core.Object |
---|
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_ |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tree()
The tree constructor understands two signatures. One compatible with the
original qooxdoo tree and one compatible with the treefullcontrol widget.
If the first parameter if of type TreeRowStructure
the tree
element is rendered using this structure. Otherwhise the all three
arguments are evaluated.
public Tree(java.lang.Object labelOrTreeRowStructure)
The tree constructor understands two signatures. One compatible with the
original qooxdoo tree and one compatible with the treefullcontrol widget.
If the first parameter if of type TreeRowStructure
the tree
element is rendered using this structure. Otherwhise the all three
arguments are evaluated.
public Tree(java.lang.Object labelOrTreeRowStructure, java.lang.String icon)
The tree constructor understands two signatures. One compatible with the
original qooxdoo tree and one compatible with the treefullcontrol widget.
If the first parameter if of type TreeRowStructure
the tree
element is rendered using this structure. Otherwhise the all three
arguments are evaluated.
public Tree(java.lang.Object labelOrTreeRowStructure, java.lang.String icon, java.lang.String iconSelected)
The tree constructor understands two signatures. One compatible with the
original qooxdoo tree and one compatible with the treefullcontrol widget.
If the first parameter if of type TreeRowStructure
the tree
element is rendered using this structure. Otherwhise the all three
arguments are evaluated.
Method Detail |
---|
public void _applyExcludeSpecificTreeLines(java.lang.Object value, java.lang.Object old)
public void _applyHideNode(java.lang.Object value, java.lang.Object old)
public void _applyRootOpenClose(java.lang.Object value, java.lang.Object old)
public void _applyUseTreeLines(java.lang.Object value, java.lang.Object old)
public java.lang.Object _onkeydown(Event e)
public java.lang.Object _onkeypress(Event e)
public void _onkeyup(Event e)
public void addChildToTreeQueue(AbstractTreeElement vChild)
Adds vChild to the tree queue.
public void flushTreeQueue()
Flushes the tree queue.
public void flushWidgetQueue()
Flushes the tree queue.
public java.lang.Object getExcludeSpecificTreeLines()
Returns the (computed) value of the property excludeSpecificTreeLines
.
For further details take a look at the property definition: excludeSpecificTreeLines
.
public AbstractTreeElement getFirstTreeChild()
Returns itself.
public boolean getHideNode()
Returns the (computed) value of the property hideNode
.
For further details take a look at the property definition: hideNode
.
public java.lang.Object getHierarchy(java.lang.Object vArr)
AbstractTreeElement
Obtain the entire hierarchy of labels from the root down to the current node.
getHierarchy
in class AbstractTreeElement<T>
public java.lang.Object getIndentSymbol(java.lang.Object vUseTreeLines, java.lang.Object vColumn, java.lang.Object vLastColumn)
public AbstractTreeElement getItems(boolean recursive, boolean invisible)
Returns all children of the folder.
getItems
in class TreeFolder<T>
public java.lang.Object getLastTreeChild()
public java.lang.Integer getLevel()
Always returns 0 since a Tree instance is always the root of a tree, and therefore is on level 0.
getLevel
in class AbstractTreeElement<T>
public SelectionManager getManager()
Returns the selection manager for this tree. The selection manager is managing the whole tree, not just the root Tree element or some part of it.
public TreeFolder getParentFolder()
Always returns null since a Tree instance is always the root of a tree, and therefore has no parent.
getParentFolder
in class AbstractTreeElement<T>
public boolean getRootOpenClose()
Returns the (computed) value of the property rootOpenClose
.
For further details take a look at the property definition: rootOpenClose
.
public AbstractTreeElement getSelectedElement()
Returns the currently selected element within the tree. This is a descendant of the root tree element.
public Tree getTree()
Returns the current tree instance, i.e. itself.
getTree
in class AbstractTreeElement<T>
public boolean getUseDoubleClick()
Returns the (computed) value of the property useDoubleClick
.
For further details take a look at the property definition: useDoubleClick
.
public boolean getUseTreeLines()
Returns the (computed) value of the property useTreeLines
.
For further details take a look at the property definition: useTreeLines
.
public void hideNode()
public void initExcludeSpecificTreeLines(java.lang.Object arg)
Calls the apply method and dispatches the change event of the property excludeSpecificTreeLines
with the default value defined by the class developer. This function can
only be called from the constructor of a class.
For further details take a look at the property definition: excludeSpecificTreeLines
.
public void initHideNode(boolean arg)
Calls the apply method and dispatches the change event of the property hideNode
with the default value defined by the class developer. This function can
only be called from the constructor of a class.
For further details take a look at the property definition: hideNode
.
public void initRootOpenClose(boolean arg)
Calls the apply method and dispatches the change event of the property rootOpenClose
with the default value defined by the class developer. This function can
only be called from the constructor of a class.
For further details take a look at the property definition: rootOpenClose
.
public void initUseDoubleClick(boolean arg)
Calls the apply method and dispatches the change event of the property useDoubleClick
with the default value defined by the class developer. This function can
only be called from the constructor of a class.
For further details take a look at the property definition: useDoubleClick
.
public void initUseTreeLines(boolean arg)
Calls the apply method and dispatches the change event of the property useTreeLines
with the default value defined by the class developer. This function can
only be called from the constructor of a class.
For further details take a look at the property definition: useTreeLines
.
public boolean isHideNode()
Check whether the (computed) value of the boolean property hideNode
equals true
.
For further details take a look at the property definition: hideNode
.
public boolean isRootOpenClose()
Check whether the (computed) value of the boolean property rootOpenClose
equals true
.
For further details take a look at the property definition: rootOpenClose
.
public boolean isUseDoubleClick()
Check whether the (computed) value of the boolean property useDoubleClick
equals true
.
For further details take a look at the property definition: useDoubleClick
.
public boolean isUseTreeLines()
Check whether the (computed) value of the boolean property useTreeLines
equals true
.
For further details take a look at the property definition: useTreeLines
.
public void removeChildFromTreeQueue(AbstractTreeElement vChild)
Removes vChild from the tree queue.
public void resetExcludeSpecificTreeLines()
Resets the user value of the property excludeSpecificTreeLines
.
The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.
For further details take a look at the property definition: excludeSpecificTreeLines
.
public void resetHideNode()
Resets the user value of the property hideNode
.
The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.
For further details take a look at the property definition: hideNode
.
public void resetRootOpenClose()
Resets the user value of the property rootOpenClose
.
The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.
For further details take a look at the property definition: rootOpenClose
.
public void resetUseDoubleClick()
Resets the user value of the property useDoubleClick
.
The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.
For further details take a look at the property definition: useDoubleClick
.
public void resetUseTreeLines()
Resets the user value of the property useTreeLines
.
The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.
For further details take a look at the property definition: useTreeLines
.
public void setExcludeSpecificTreeLines(java.lang.Object arg)
Sets the user value of the property excludeSpecificTreeLines
.
For further details take a look at the property definition: excludeSpecificTreeLines
.
public void setHideNode(boolean arg)
Sets the user value of the property hideNode
.
For further details take a look at the property definition: hideNode
.
public void setRootOpenClose(boolean arg)
Sets the user value of the property rootOpenClose
.
For further details take a look at the property definition: rootOpenClose
.
public void setSelectedElement(AbstractTreeElement vElement)
Sets the selected element in the tree to vElement.
public void setUseDoubleClick(boolean arg)
Sets the user value of the property useDoubleClick
.
For further details take a look at the property definition: useDoubleClick
.
public void setUseTreeLines(boolean arg)
Sets the user value of the property useTreeLines
.
For further details take a look at the property definition: useTreeLines
.
public boolean toggleHideNode()
Toggles the (computed) value of the boolean property hideNode
.
For further details take a look at the property definition: hideNode
.
public boolean toggleRootOpenClose()
Toggles the (computed) value of the boolean property rootOpenClose
.
For further details take a look at the property definition: rootOpenClose
.
public boolean toggleUseDoubleClick()
Toggles the (computed) value of the boolean property useDoubleClick
.
For further details take a look at the property definition: useDoubleClick
.
public boolean toggleUseTreeLines()
Toggles the (computed) value of the boolean property useTreeLines
.
For further details take a look at the property definition: useTreeLines
.
public void useDoubleClick()
public void useTreeLines()
public static <T> Tree<T> create(T root)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |