|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.data.Record
com.smartgwt.client.widgets.grid.ListGridRecord
com.smartgwt.client.widgets.tree.TreeNode
public class TreeNode
Every node in the tree is represented by a TreeNode object which is an object literal with a set of properties that configure the node.
When a Tree is supplied as data
to
TreeGrid
, you can also set properties from ListGridRecord
on the TreeNode (e.g. setting enabled
:false
on the node).
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
TreeNode()
|
|
TreeNode(JavaScriptObject jsObj)
|
|
TreeNode(String name)
Constructor |
|
TreeNode(String name,
TreeNode... children)
Constructor |
Method Summary | |
---|---|
Boolean |
getCanAcceptDrop()
Governs whether dragged data (typicaly other treeNode s) may be dropped over this node. |
Boolean |
getCanDrag()
Governs whether this node can be dragged. |
Boolean |
getEnabled()
Default property name denoting whether this record is enabled. |
String |
getIcon()
This Property allows the developer to customize the icon displayed next to a node. |
String |
getName()
Provides a name for the node that is unique among it's immediate siblings, thus allowing a unique path to be used to identify the node, similar to a file system. |
static TreeNode |
getOrCreateRef(JavaScriptObject jsObj)
|
Boolean |
getShowDropIcon()
For folder nodes showing custom icons (set via icon ), this
property allows the developer to specify on a per-node basis whether a drop state icon should be displayed when the
user drop-hovers over this folder.Set node.showDropIcon to true to show the drop state icon, or false
to suppress this.If not specified, this behavior is determined by showCustomIconDrop for this node. |
Boolean |
getShowOpenIcon()
For folder nodes showing custom icons (set via icon ), this
property allows the developer to specify on a per-node basis whether an open state icon should be displayed when the
folder is open. |
String |
getTitle()
The title of the node as it should appear next to the node icon in the Tree . |
void |
setCanAcceptDrop(Boolean canAcceptDrop)
Governs whether dragged data (typicaly other treeNode s) may be dropped over this node. |
void |
setCanDrag(Boolean canDrag)
Governs whether this node can be dragged. |
void |
setChildren(TreeNode[] children)
For trees with the modelType "children", this property specifies the children of this TreeNode. |
void |
setEnabled(Boolean enabled)
Default property name denoting whether this record is enabled. |
void |
setIcon(String icon)
This Property allows the developer to customize the icon displayed next to a node. |
void |
setID(String id)
For trees with modelType "parent", this property
specifies the unique ID of this node. |
void |
setIsFolder(boolean isFolder)
Set to true to explicitly mark this node as a folder. |
void |
setName(String name)
Provides a name for the node that is unique among it's immediate siblings, thus allowing a unique path to be used to identify the node, similar to a file system. |
void |
setParentID(String parentID)
For trees with modelType "parent", this property specifies unique parent ID of this node. |
void |
setShowDropIcon(Boolean showDropIcon)
For folder nodes showing custom icons (set via icon ), this
property allows the developer to specify on a per-node basis whether a drop state icon should be displayed when the
user drop-hovers over this folder.Set node.showDropIcon to true to show the drop state icon, or false
to suppress this.If not specified, this behavior is determined by showCustomIconDrop for this node. |
void |
setShowOpenIcon(Boolean showOpenIcon)
For folder nodes showing custom icons (set via icon ), this
property allows the developer to specify on a per-node basis whether an open state icon should be displayed when the
folder is open. |
void |
setTitle(String title)
The title of the node as it should appear next to the node icon in the Tree . |
Methods inherited from class com.smartgwt.client.widgets.grid.ListGridRecord |
---|
get_baseStyle, getCanExpand, getCustomStyle, getDetailDS, getIncludeInSummary, getIsGridSummary, getIsGroupSummary, getIsSeparator, getLinkText, getSingleCellValue, set_baseStyle, setCanExpand, setCustomStyle, setDetailDS, setIncludeInSummary, setIsGridSummary, setIsGroupSummary, setIsSeparator, setLinkText, setSingleCellValue |
Methods inherited from class com.smartgwt.client.data.Record |
---|
convertToRecordArray, getAttributeAsRecordArray, getAttributeAsRecordList |
Methods inherited from class com.smartgwt.client.core.RefDataClass |
---|
getRef, getRef |
Methods inherited from class com.smartgwt.client.core.JsObject |
---|
isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeNode()
public TreeNode(JavaScriptObject jsObj)
public TreeNode(String name)
name
- the namepublic TreeNode(String name, TreeNode... children)
name
- the namechildren
- the children nodesMethod Detail |
---|
public static TreeNode getOrCreateRef(JavaScriptObject jsObj)
public void setEnabled(Boolean enabled)
recordEnabledProperty
.
setEnabled
in class ListGridRecord
enabled
- enabled Default value is nullpublic Boolean getEnabled()
recordEnabledProperty
.
getEnabled
in class ListGridRecord
public void setCanDrag(Boolean canDrag)
TreeGrid
where canDragRecordsOut
, canReorderRecords
or canReparentNodes
is true
.
Note : This is an advanced setting
setCanDrag
in class ListGridRecord
canDrag
- canDrag Default value is nullpublic Boolean getCanDrag()
TreeGrid
where canDragRecordsOut
, canReorderRecords
or canReparentNodes
is true
.
getCanDrag
in class ListGridRecord
public void setCanAcceptDrop(Boolean canAcceptDrop)
treeNode
s) may be dropped over this node. Only has an effect
if this node is displayed in a TreeGrid
where canAcceptDroppedRecords
, canReorderRecords
or canReparentNodes
is true.
Note : This is an advanced setting
setCanAcceptDrop
in class ListGridRecord
canAcceptDrop
- canAcceptDrop Default value is nullpublic Boolean getCanAcceptDrop()
treeNode
s) may be dropped over this node. Only has an effect
if this node is displayed in a TreeGrid
where canAcceptDroppedRecords
, canReorderRecords
or canReparentNodes
is true.
getCanAcceptDrop
in class ListGridRecord
public void setName(String name)
Tree.getPath(com.smartgwt.client.widgets.tree.TreeNode)
. If the
nameProperty is not set on a given node, the id
will be used
instead. If this is also missing, Tree.getName(com.smartgwt.client.widgets.tree.TreeNode)
and Tree.getPath(com.smartgwt.client.widgets.tree.TreeNode)
will auto-generate a unique name for you. Thus names are not required,
but if the dataset you are using already has usable names for each node, using them can make APIs such as Tree.find(java.lang.String)
more useful. Alternatively, if your dataset has unique ids consider
providing those as id
.
If a value provided for the nameProperty of a node (e.g. node.name) is not a string, it will be converted to a string by the Tree via ""+value.
This property is also used as the default title for the node (see Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
) if title
is
not specified.
Note: the name of this property can be changed by setting nameProperty
.
name
- name Default value is null, but see belowpublic String getName()
Tree.getPath(com.smartgwt.client.widgets.tree.TreeNode)
. If the
nameProperty is not set on a given node, the id
will be used
instead. If this is also missing, Tree.getName(com.smartgwt.client.widgets.tree.TreeNode)
and Tree.getPath(com.smartgwt.client.widgets.tree.TreeNode)
will auto-generate a unique name for you. Thus names are not required,
but if the dataset you are using already has usable names for each node, using them can make APIs such as Tree.find(java.lang.String)
more useful. Alternatively, if your dataset has unique ids consider
providing those as id
.
If a value provided for the nameProperty of a node (e.g. node.name) is not a string, it will be converted to a string by the Tree via ""+value.
This property is also used as the default title for the node (see Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
) if title
is
not specified.
Note: the name of this property can be changed by setting nameProperty
.
public void setTitle(String title)
Tree
.
If left unset, the value of name
is used by default. See the
description in Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
for full details. Note: the name of this
property can be changed by setting titleProperty
.
title
- title Default value is nullpublic String getTitle()
Tree
.
If left unset, the value of name
is used by default. See the
description in Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
for full details. Note: the name of this
property can be changed by setting titleProperty
.
public void setIcon(String icon)
node.icon
to the URL
of the desired icon to display and it will be shown instead of the standard nodeIcon
for this node.showOpenIcon
and/or showDropIcon
is true for this node, customized icons for
folder nodes will be appended with the openIconSuffix
or dropIconSuffix
suffixes on state
change as with the standard folderIcon
for this
treeGrid. Also note that for custom folder icons, the closedIconSuffix
will never be appended. You can
change the name of this property by setting customIconProperty
.
icon
- icon Default value is nullpublic String getIcon()
node.icon
to the URL
of the desired icon to display and it will be shown instead of the standard nodeIcon
for this node.showOpenIcon
and/or showDropIcon
is true for this node, customized icons for
folder nodes will be appended with the openIconSuffix
or dropIconSuffix
suffixes on state
change as with the standard folderIcon
for this
treeGrid. Also note that for custom folder icons, the closedIconSuffix
will never be appended. You can
change the name of this property by setting customIconProperty
.
public void setShowOpenIcon(Boolean showOpenIcon)
icon
), this
property allows the developer to specify on a per-node basis whether an open state icon should be displayed when the
folder is open. Set node.showOpenIcon
to true to show the open state icons, or false to suppress this.showCustomIconOpen
for this node. You can change the name of this property by setting customIconOpenProperty
.
Note : This is an advanced setting
showOpenIcon
- showOpenIcon Default value is falsepublic Boolean getShowOpenIcon()
icon
), this
property allows the developer to specify on a per-node basis whether an open state icon should be displayed when the
folder is open. Set node.showOpenIcon
to true to show the open state icons, or false to suppress this.showCustomIconOpen
for this node. You can change the name of this property by setting customIconOpenProperty
.
public void setShowDropIcon(Boolean showDropIcon)
icon
), this
property allows the developer to specify on a per-node basis whether a drop state icon should be displayed when the
user drop-hovers over this folder.node.showDropIcon
to true to show the drop state icon, or false
to suppress this.showCustomIconDrop
for this node. You can change the
name of this property by setting customIconDropProperty
.
Note : This is an advanced setting
showDropIcon
- showDropIcon Default value is falsepublic Boolean getShowDropIcon()
icon
), this
property allows the developer to specify on a per-node basis whether a drop state icon should be displayed when the
user drop-hovers over this folder.node.showDropIcon
to true to show the drop state icon, or false
to suppress this.showCustomIconDrop
for this node. You can change the
name of this property by setting customIconDropProperty
.
public void setID(String id)
modelType
"parent", this property
specifies the unique ID of this node. The unique ID of a node, together with the unique ID of its parent (see
parentId
) is used by Tree.linkNodes(com.smartgwt.client.widgets.tree.TreeNode[])
to link a list of nodes into a tree. Note: the name of this
property can be changed by setting idField
.
id
- id Default value is nullpublic void setParentID(String parentID)
Tree.linkNodes(com.smartgwt.client.widgets.tree.TreeNode[])
to link a list of nodes into a tree. Note: the name of this property can be changed by setting parentIdField
.
parentId
- parentId Default value is nullpublic void setIsFolder(boolean isFolder)
true
to explicitly mark this node as a folder. See Tree.isFolder(com.smartgwt.client.widgets.tree.TreeNode)
for a full description of how the Tree
determines whether a node is a folder or not. Note: the name of this
property can be changed by setting isFolderProperty
.
isFolder
- isFolder Default value is nullpublic void setChildren(TreeNode[] children)
Note: the
name of this property can be changed by setting childrenProperty
children
- children Default value is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |