public class TreeNode extends ListGridRecord
When a Tree is supplied as TreeGrid.data
to TreeGrid
, you can also set properties from ListGridRecord
on the TreeNode (e.g. setting ListGridRecord.enabled
:false
on the node).
id
factoryCreated, factoryProperties, readOnly
Constructor and Description |
---|
TreeNode() |
TreeNode(com.google.gwt.core.client.JavaScriptObject jsObj) |
TreeNode(java.lang.String name)
Constructor
|
TreeNode(java.lang.String name,
TreeNode... children)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
getCanAcceptDrop()
Governs whether dragged data (typically other
treeNode s) may be dropped over this node. |
java.lang.Boolean |
getCanDrag()
Governs whether this node can be dragged.
|
java.lang.Boolean |
getEnabled()
Default property name denoting whether this record is enabled.
|
java.lang.String |
getIcon()
This Property allows the developer to customize the icon displayed next to a node.
|
java.lang.String |
getName()
Provides a name for the node that is unique among its immediate siblings, thus allowing a unique path to be used to
identify the node, similar to a file system.
|
static TreeNode |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.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 TreeGrid.showCustomIconDrop for this node. |
java.lang.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. |
java.lang.String |
getTitle()
The title of the node as it should appear next to the node icon in the
Tree . |
void |
setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
Governs whether dragged data (typically other
treeNode s) may be dropped over this node. |
void |
setCanDrag(java.lang.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(java.lang.Boolean enabled)
Default property name denoting whether this record is enabled.
|
void |
setIcon(java.lang.String icon)
This Property allows the developer to customize the icon displayed next to a node.
|
void |
setID(java.lang.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(java.lang.String name)
Provides a name for the node that is unique among its immediate siblings, thus allowing a unique path to be used to
identify the node, similar to a file system.
|
void |
setParentID(java.lang.String parentID)
For trees with modelType "parent", this property specifies unique parent ID of this node.
|
void |
setShowDropIcon(java.lang.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 TreeGrid.showCustomIconDrop for this node. |
void |
setShowOpenIcon(java.lang.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(java.lang.String title)
The title of the node as it should appear next to the node icon in the
Tree . |
get_baseStyle, get_canEdit, get_canRemove, getBackgroundComponent, getCanExpand, getCanSelect, getCustomStyle, getDetailDS, getIncludeInSummary, getIsGridSummary, getIsGroupSummary, getIsSeparator, getLinkText, getSingleCellValue, set_baseStyle, set_canEdit, set_canRemove, setBackgroundComponent, setCanExpand, setCanSelect, setCustomStyle, setDetailDS, setIncludeInSummary, setIsGridSummary, setIsGroupSummary, setIsSeparator, setLinkText, setSingleCellValue
convertToRecordArray, copyAttributes, copyAttributesInto, getAttributeAsRecordArray, getAttributeAsRecordList, isARecord, toMap
getRef, getRef, internalSetID
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated, setReadOnly
public TreeNode()
public TreeNode(com.google.gwt.core.client.JavaScriptObject jsObj)
public TreeNode(java.lang.String name)
name
- the namepublic TreeNode(java.lang.String name, TreeNode... children)
name
- the namechildren
- the children nodespublic static TreeNode getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
treeNode
s) may be dropped over this node. Only has an effect
if this node is displayed in a TreeGrid
where TreeGrid.canAcceptDroppedRecords
, TreeGrid.canReorderRecords
or TreeGrid.canReparentNodes
is true.
Note : This is an advanced setting
setCanAcceptDrop
in class ListGridRecord
canAcceptDrop
- Default value is nullpublic java.lang.Boolean getCanAcceptDrop()
treeNode
s) may be dropped over this node. Only has an effect
if this node is displayed in a TreeGrid
where TreeGrid.canAcceptDroppedRecords
, TreeGrid.canReorderRecords
or TreeGrid.canReparentNodes
is true.getCanAcceptDrop
in class ListGridRecord
public void setCanDrag(java.lang.Boolean canDrag)
TreeGrid
where TreeGrid.canDragRecordsOut
, TreeGrid.canReorderRecords
or TreeGrid.canReparentNodes
is true
.
Note : This is an advanced setting
setCanDrag
in class ListGridRecord
canDrag
- Default value is nullpublic java.lang.Boolean getCanDrag()
TreeGrid
where TreeGrid.canDragRecordsOut
, TreeGrid.canReorderRecords
or TreeGrid.canReparentNodes
is true
.getCanDrag
in class ListGridRecord
public void setEnabled(java.lang.Boolean enabled)
ListGrid.recordEnabledProperty
.setEnabled
in class ListGridRecord
enabled
- Default value is nullpublic java.lang.Boolean getEnabled()
ListGrid.recordEnabledProperty
.getEnabled
in class ListGridRecord
public void setIcon(java.lang.String icon)
node.icon
to the URL
of the desired icon to display and it will be shown instead of the standard TreeGrid.nodeIcon
for this node.showOpenIcon
and/or showDropIcon
is true for this node, customized icons for
folder nodes will be appended with the TreeGrid.openIconSuffix
or TreeGrid.dropIconSuffix
suffixes on state change as with the standard TreeGrid.folderIcon
for this treeGrid. Also note that for custom folder icons, the TreeGrid.closedIconSuffix
will never be appended. You
can change the name of this property by setting TreeGrid.customIconProperty
.
icon
- See SCImgURL
. Default value is nullpublic java.lang.String getIcon()
node.icon
to the URL
of the desired icon to display and it will be shown instead of the standard TreeGrid.nodeIcon
for this node.showOpenIcon
and/or showDropIcon
is true for this node, customized icons for
folder nodes will be appended with the TreeGrid.openIconSuffix
or TreeGrid.dropIconSuffix
suffixes on state change as with the standard TreeGrid.folderIcon
for this treeGrid. Also note that for custom folder icons, the TreeGrid.closedIconSuffix
will never be appended. You
can change the name of this property by setting TreeGrid.customIconProperty
.
SCImgURL
public void setName(java.lang.String name)
Tree.getPath()
.
If the nameProperty is not set on a given node, the id
will
be used instead. If this is also missing, Tree.getName()
and
Tree.getPath()
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()
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()
) if title
is not specified.
Note: the name of this property can be
changed by setting Tree.nameProperty
.
name
- Default value is null, but see belowTree.setNameProperty(java.lang.String)
,
Tree.setPathDelim(java.lang.String)
,
Tree.getPath(com.smartgwt.client.widgets.tree.TreeNode)
,
Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
public java.lang.String getName()
Tree.getPath()
.
If the nameProperty is not set on a given node, the id
will
be used instead. If this is also missing, Tree.getName()
and
Tree.getPath()
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()
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()
) if title
is not specified.
Note: the name of this property can be
changed by setting Tree.nameProperty
.
public void setShowDropIcon(java.lang.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.TreeGrid.showCustomIconDrop
for this node. You can
change the name of this property by setting TreeGrid.customIconDropProperty
.
Note : This is an advanced setting
showDropIcon
- Default value is falseTreeGrid.setCustomIconProperty(java.lang.String)
,
TreeGrid.setShowCustomIconDrop(java.lang.Boolean)
public java.lang.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.TreeGrid.showCustomIconDrop
for this node. You can
change the name of this property by setting TreeGrid.customIconDropProperty
.
TreeGrid.getCustomIconProperty()
,
TreeGrid.getShowCustomIconDrop()
public void setShowOpenIcon(java.lang.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.TreeGrid.showCustomIconOpen
for this node. You can change the name of this property by setting TreeGrid.customIconOpenProperty
.
Note : This is an advanced setting
showOpenIcon
- Default value is falseTreeGrid.setCustomIconProperty(java.lang.String)
,
TreeGrid.setShowCustomIconOpen(java.lang.Boolean)
public java.lang.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.TreeGrid.showCustomIconOpen
for this node. You can change the name of this property by setting TreeGrid.customIconOpenProperty
.
TreeGrid.getCustomIconProperty()
,
TreeGrid.getShowCustomIconOpen()
public void setTitle(java.lang.String title)
Tree
.
If left unset, the value of name
is used by default. See the
description in Tree.getTitle()
for full details. Note: the
name of this property can be changed by setting Tree.titleProperty
.
title
- Default value is nullTree.setTitleProperty(java.lang.String)
,
Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
public java.lang.String getTitle()
Tree
.
If left unset, the value of name
is used by default. See the
description in Tree.getTitle()
for full details. Note: the
name of this property can be changed by setting Tree.titleProperty
.
Tree.getTitleProperty()
,
Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
public void setID(java.lang.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(java.lang.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