|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.grid.ListGrid
com.smartgwt.client.widgets.tree.TreeGrid
public class TreeGrid
The SmartGWT system supports hierarchical data (also referred to as tree data due to its "branching" organization) with:
Tree
class, which manipulates hierarchical data sets
TreeDataBinding
.
A TreeGrid works just like a ListGrid
, except one column (specified by
treeField
shows a heirarchical Tree
. A TreeGrid is not limited
to displaying just the Tree
column - you can define additional columns (via
fields
) which will render just like the columns of a ListGrid
, and
support all of the functionality of ListGrid columns, such as
com.smartgwt.client.widgets.grid.ListGridField#formatCellValue
.
Except where explicitly overridden, ListGrid
methods, callbacks, and properties
apply to TreeGrids as well. The ListGrid
defines some methods as taking/returning
${isc.DocUtils.linkForRef('object:ListGridField')} and ListGridRecord
. When using those methods in a TreeGrid,
those types will be ${isc.DocUtils.linkForRef('object:TreeGridField')} and TreeNode
, respectively.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
TreeGrid()
|
|
TreeGrid(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
HandlerRegistration |
addDataArrivedHandler(DataArrivedHandler handler)
Add a dataArrived handler. |
HandlerRegistration |
addFolderClickHandler(FolderClickHandler handler)
Add a folderClick handler. |
HandlerRegistration |
addFolderClosedHandler(FolderClosedHandler handler)
Add a folderClosed handler. |
HandlerRegistration |
addFolderContextClickHandler(FolderContextClickHandler handler)
Add a folderContextClick handler. |
HandlerRegistration |
addFolderDropHandler(FolderDropHandler handler)
Add a onFolderDrop handler. |
HandlerRegistration |
addFolderOpenedHandler(FolderOpenedHandler handler)
Add a folderOpened handler. |
HandlerRegistration |
addLeafClickHandler(LeafClickHandler handler)
Add a leafClick handler. |
HandlerRegistration |
addLeafContextClickHandler(LeafContextClickHandler handler)
Add a leafContextClick handler. |
HandlerRegistration |
addNodeClickHandler(NodeClickHandler handler)
Add a nodeClick handler. |
HandlerRegistration |
addNodeContextClickHandler(NodeContextClickHandler handler)
Add a nodeContextClick handler. |
HandlerRegistration |
addRecordDropHandler(RecordDropHandler handler)
This ListGrid suporclass event does not fire on a TreeGrid, use addFolderDropHandler(com.smartgwt.client.widgets.tree.events.FolderDropHandler) instead. |
java.lang.Boolean |
canEditCell()
Overridden to disallow editing of the name field of this grid's data
tree. |
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
void |
fetchData()
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. |
void |
fetchData(Criteria criteria)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. |
void |
fetchData(Criteria criteria,
DSCallback callback)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. |
void |
fetchData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. |
void |
filterData(Criteria criteria)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
AnimationAcceleration |
getAnimateFolderEffect()
When animating folder opening / closing, this property can be set to apply an animated acceleration effect.designates the speed of the animation in pixels shown (or hidden) per second. |
java.lang.Boolean |
getAnimateFolders()
If true, when folders are opened / closed children will be animated into view. |
int |
getAnimateFolderSpeed()
When animating folder opening / closing, this property designates the speed of the animation in pixels shown (or hidden) per second. |
int |
getAnimateFolderTime()
When animating folder opening / closing, if animateFolderSpeed is not
set, this property designates the duration of the animation in ms. |
java.lang.Boolean |
getAutoFetchAsFilter()
With ${isc.DocUtils.linkForRef('loadDataOnDemand:true')}, TreeGrids fetch data by selecting the child nodes of each parent, which should be exact match, so default to autoFetchAsFilter:false. See autoFetchAsFilter for details. |
java.lang.Boolean |
getCanAcceptDroppedRecords()
Indicates whether records can be dropped into this listGrid. |
java.lang.Boolean |
getCanDragRecordsOut()
Indicates whether records can be dragged from this listGrid and dropped elsewhere. |
java.lang.Boolean |
getCanDropOnLeaves()
Whether drops are allowed on leaf nodes. |
java.lang.Boolean |
getCanReorderRecords()
Indicates whether records can be reordered by dragging within this listGrid. |
java.lang.Boolean |
getCanReparentNodes()
If set this property allows the user to reparent nodes by dragging them from their current folder to a new folder. Backcompat: For backwards compatibility with versions prior to SmartGWT 1.5, if this property is unset, but this.canAcceptDroppedRecords is true, we
allow nodes to be dragged to different folders. |
java.lang.String |
getCantDragIntoChildMessage()
Message displayed when user attempts to drop a node into a child of itself. |
java.lang.String |
getCantDragIntoSelfMessage()
Message displayed when user attempts to drop a dragged node onto itself. |
java.lang.String |
getClosedIconSuffix()
This suffix will be appended to the folderIcon for closed folders.
If showOpenIcons is set to false this suffix will also be
appended to open folders' icons. |
java.lang.String |
getConnectorImage()
The base filename for connector icons shown when showConnectors is true.
Connector icons are rendered into the title field of each row and show the dotted
hierarchy lines between siblings of the same parent node. |
java.lang.String |
getCustomIconDropProperty()
For folder nodes showing custom icons (set via the customIconProperty ),
this property allows the developer to specify on a per-node basis whether a
drop state icon (with dropIconSuffix ) should be displayed when the
user drop-hovers over this folder.Set node[treeGrid.customIconDropProperty] to true to show the drop state
icons, or false to suppress this.If not specified this this behavior is determined by treeGrid.showCustomIconDrop
for this node. |
java.lang.String |
getCustomIconOpenProperty()
For folder nodes showing custom icons (set via the customIconProperty ),
this property allows the developer to specify on a per-node basis whether a
open state icon should be displayed when the folder is open.
Set node[treeGrid.customIconOpenProperty] to true to show the open state
icons, or false to suppress this.If not specified, this behavior is determined by grid.showCustomIconOpen
for this node. |
java.lang.String |
getCustomIconProperty()
This property allows the developer to customize the icon displayed next to a node. Set node[grid.customIconProperty] to the URL of the desired icon to display and
it will be shown instead of the standard nodeIcon for this node.Note that if showCustomIconOpen and/or showCustomIconDrop
is true for this grid, customized icons for folder nodes will be appended with the
dropIconSuffix or openIconSuffix suffixes on state change
as with the standard folderIcon for this treeGrid. |
Tree |
getData()
A Tree object containing of nested TreeNode s to
display as rows in this TreeGrid. |
DisplayNodeType |
getDisplayNodeType()
Specifies the type of nodes displayed in the treeGrid. |
TreeNode |
getDropFolder()
When the user is dragging a droppable element over this grid, this method returns the folder which would contain the item if dropped. |
java.lang.String |
getDropIconSuffix()
If showDropIcons is true, this suffix will be appended to the
folderIcon when the user drop-hovers over some folder. |
int |
getEventRow()
Returns the row number of the most recent mouse event. |
int |
getEventRow(int y)
Returns the row number of the most recent mouse event. |
java.lang.String |
getExtraIcon(TreeNode node)
Get an additional icon to show between the open icon and folder/node icon for a particular node. |
java.lang.String |
getFolderIcon()
The URL of the base icon for all folder nodes in this treeGrid. |
protected java.lang.String |
getIcon(TreeNode node,
boolean defaultState)
Get the appropriate icon for a node. |
int |
getIconSize()
The standard size (same height and width, in pixels) of node icons in this treeGrid. |
int |
getIndentSize()
The amount of indentation (in pixels) to add to a node's icon/title for each level down in this tree's hierarchy. |
java.lang.Boolean |
getLoadDataOnDemand()
For databound treeGrid instances, should the entire tree of data be loaded on initial fetch, or should folders load their children as they are opened. |
java.lang.String |
getManyItemsImage()
The filename of the icon displayed use as the default drag tracker when for multiple files and/or folders are being dragged. |
java.lang.String |
getNodeIcon()
The filename of the default icon for all leaf nodes in this grid. |
protected java.lang.String |
getNodeTitle(TreeNode node,
int recordNum,
ListGridField field)
Returns the title to show for a node in the tree column. |
java.lang.Integer |
getOpenerIconSize()
Width and height in pixels of the opener icons, that is, the icons which show the open or closed state of the node, typically a [+] or [-] symbol. |
java.lang.String |
getOpenerImage()
The base filename of the opener icon for the folder node when 'showConnectors' is false for this TreeGrid. The opener icon is displayed beside the folder icon in the Tree column for folder nodes. Clicking on this icon will toggle the open state of the folder. The filenames for these icons are assembled from this base filename and the state of the node, as follows: If the openerImage is set to {baseName}.{extension} ,
{baseName}_opened.{extension} will be displayed next to opened folders, and
{baseName}_closed.{extension} will be displayed next to closed folders, or
if this page is in RTL mode, {baseName}_opened_rtl.{extension} and
{baseName}_closed_rtl.{extension} will be used. |
java.lang.String |
getOpenIcon(TreeNode node)
Get the appropriate open/close opener icon for a node. |
java.lang.String |
getOpenIconSuffix()
If showOpenIcons is true, this suffix will be appended to the
folderIcon for open folders in this grid. |
java.lang.String |
getOpenState()
Returns a snapshot of the current open state of this grid's data as a String object.This object can be passed to getOpenState() to open the same set of folders
within the treeGrid's data (assuming the nodes are still present in the data).
|
static TreeGrid |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.String |
getParentAlreadyContainsChildMessage()
Message displayed when user attempts to drag a node into a parent that already contains a child of the same name. |
ListGridRecord |
getRecord(int recordNum)
Return the pointer to a particular record by record number. |
ListGridRecord[] |
getRecords()
|
java.lang.String |
getSelectedPaths()
Returns a snapshot of the current selection within this treeGrid as a String object.This object can be passed to setSelectedPaths(java.lang.String) to reset this grid's selection
the current state (assuming the same data is present in the grid). |
ListGridRecord |
getSelectedRecord()
Return the first selected record in this component. This method is appropriate if is "single" , or if you only care about the first selected record in a multiple-record selection. |
java.lang.Boolean |
getSeparateFolders()
Specifies whether folders and leaves should be segregated in the treeGrid display. With separateFolders:true and sortDirection:"descending", folders are displayed before their sibling leaves; with sortDirection:"ascending", leaves are displayed before their sibling folders. |
java.lang.Boolean |
getShowConnectors()
Should this treeGrid show connector lines illustrating the tree's hierachy? |
java.lang.Boolean |
getShowCustomIconDrop()
Should folder nodes showing custom icons (set via the customIconProperty ),
show drop state images when the user is drop-hovering over the folder.
If true, the dropIconSuffix will be appended to the image URL
(so "customFolder.gif" might be replaced with
"customFolder_drop.gif" ).Can be overridden at the node level via the customIconDropProperty property. |
java.lang.Boolean |
getShowCustomIconOpen()
Should folder nodes showing custom icons (set via the customIconProperty ),
show open state images when the folder is opened.
If true, the openIconSuffix will be appended to the image URL
(so "customFolder.gif" might be replaced with
"customFolder_open.gif" ).Note that the closedIconSuffix is never appended to custom folder icons.Can be overridden at the node level via the customIconOpenProperty property. |
java.lang.Boolean |
getShowDropIcons()
If true, when the user drags a droppable target over a folder in this TreeGrid, show a different icon folder icon. This is achieved by appending the dropIconSuffix onto the
folderIcon URL (for example "[SKIN]/folder.gif" may be
replaced by "[SKIN]/folder_drop.gif" ). |
java.lang.Boolean |
getShowFullConnectors()
If showConnectors is true, this property determines whether we should show
showing vertical continuation lines for each level of indenting within the tree. |
java.lang.Boolean |
getShowOpenIcons()
If true, show a different icon for open folders than closed folders.
This is achieved by appending the openIconSuffix onto the
folderIcon URL [for example "[SKIN]/folder.gif" might be
replaced by "[SKIN]/folder_open.gif" .Note If this property is set to false the same icon is shown for
open folders as for closed folders, unless a custom folder icon was specified. |
java.lang.Boolean |
getShowRoot()
Specifies whether the root node should be displayed in the treeGrid. |
Tree |
getTree()
Synonmy for {#link #getData) |
java.lang.String |
getTreeFieldTitle()
Visible title for the tree column (field). |
java.lang.String |
getTreeRootValue()
For databound trees, use this attribute to supply a ${isc.DocUtils.linkForRef('ResultTree.rootValue')} for this component's generated data object. |
protected void |
onInit()
|
void |
recordDoubleClick()
Handle a doubleClick on a tree node - override of ListGrid stringMethod of same name. |
void |
setAnimateFolderEffect(AnimationAcceleration animateFolderEffect)
When animating folder opening / closing, this property can be set to apply an animated acceleration effect.designates the speed of the animation in pixels shown (or hidden) per second. |
void |
setAnimateFolders(java.lang.Boolean animateFolders)
If true, when folders are opened / closed children will be animated into view. |
void |
setAnimateFolderSpeed(int animateFolderSpeed)
When animating folder opening / closing, this property designates the speed of the animation in pixels shown (or hidden) per second. |
void |
setAnimateFolderTime(int animateFolderTime)
When animating folder opening / closing, if animateFolderSpeed is not
set, this property designates the duration of the animation in ms. |
void |
setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter)
With ${isc.DocUtils.linkForRef('loadDataOnDemand:true')}, TreeGrids fetch data by selecting the child nodes of each parent, which should be exact match, so default to autoFetchAsFilter:false. See autoFetchAsFilter for details. |
void |
setCanAcceptDroppedRecords(java.lang.Boolean canAcceptDroppedRecords)
Indicates whether records can be dropped into this listGrid. |
void |
setCanDragRecordsOut(java.lang.Boolean canDragRecordsOut)
Indicates whether records can be dragged from this listGrid and dropped elsewhere. |
void |
setCanDropOnLeaves(java.lang.Boolean canDropOnLeaves)
Whether drops are allowed on leaf nodes. |
void |
setCanReorderRecords(java.lang.Boolean canReorderRecords)
Indicates whether records can be reordered by dragging within this listGrid. |
void |
setCanReparentNodes(java.lang.Boolean canReparentNodes)
If set this property allows the user to reparent nodes by dragging them from their current folder to a new folder. Backcompat: For backwards compatibility with versions prior to SmartGWT 1.5, if this property is unset, but this.canAcceptDroppedRecords is true, we
allow nodes to be dragged to different folders. |
void |
setCantDragIntoChildMessage(java.lang.String cantDragIntoChildMessage)
Message displayed when user attempts to drop a node into a child of itself. |
void |
setCantDragIntoSelfMessage(java.lang.String cantDragIntoSelfMessage)
Message displayed when user attempts to drop a dragged node onto itself. |
void |
setClosedIconSuffix(java.lang.String closedIconSuffix)
This suffix will be appended to the folderIcon for closed folders.
If showOpenIcons is set to false this suffix will also be
appended to open folders' icons. |
void |
setConnectorImage(java.lang.String connectorImage)
The base filename for connector icons shown when showConnectors is true.
Connector icons are rendered into the title field of each row and show the dotted
hierarchy lines between siblings of the same parent node. |
void |
setCustomIconDropProperty(java.lang.String customIconDropProperty)
For folder nodes showing custom icons (set via the customIconProperty ),
this property allows the developer to specify on a per-node basis whether a
drop state icon (with dropIconSuffix ) should be displayed when the
user drop-hovers over this folder.Set node[treeGrid.customIconDropProperty] to true to show the drop state
icons, or false to suppress this.If not specified this this behavior is determined by treeGrid.showCustomIconDrop
for this node. |
void |
setCustomIconOpenProperty(java.lang.String customIconOpenProperty)
For folder nodes showing custom icons (set via the customIconProperty ),
this property allows the developer to specify on a per-node basis whether a
open state icon should be displayed when the folder is open.
Set node[treeGrid.customIconOpenProperty] to true to show the open state
icons, or false to suppress this.If not specified, this behavior is determined by grid.showCustomIconOpen
for this node. |
void |
setCustomIconProperty(java.lang.String customIconProperty)
This property allows the developer to customize the icon displayed next to a node. Set node[grid.customIconProperty] to the URL of the desired icon to display and
it will be shown instead of the standard nodeIcon for this node.Note that if showCustomIconOpen and/or showCustomIconDrop
is true for this grid, customized icons for folder nodes will be appended with the
dropIconSuffix or openIconSuffix suffixes on state change
as with the standard folderIcon for this treeGrid. |
void |
setData(Tree data)
A Tree object containing of nested TreeNode s to
display as rows in this TreeGrid. |
void |
setDisplayNodeType(DisplayNodeType displayNodeType)
Specifies the type of nodes displayed in the treeGrid. |
void |
setDropIconSuffix(java.lang.String dropIconSuffix)
If showDropIcons is true, this suffix will be appended to the
folderIcon when the user drop-hovers over some folder. |
void |
setFields(TreeGridField... fields)
An array of field objects, specifying the order, layout, dynamic calculation, and sorting behavior of each field in the treeGrid object. |
void |
setFolderIcon(java.lang.String folderIcon)
The URL of the base icon for all folder nodes in this treeGrid. |
void |
setIconSize(int iconSize)
The standard size (same height and width, in pixels) of node icons in this treeGrid. |
void |
setIndentSize(int indentSize)
The amount of indentation (in pixels) to add to a node's icon/title for each level down in this tree's hierarchy. |
void |
setInitialData(TreeNode[] data)
You can specify the initial set of data for a databound TreeGrid using this property. |
void |
setLoadDataOnDemand(java.lang.Boolean loadDataOnDemand)
For databound treeGrid instances, should the entire tree of data be loaded on initial fetch, or should folders load their children as they are opened. |
void |
setManyItemsImage(java.lang.String manyItemsImage)
The filename of the icon displayed use as the default drag tracker when for multiple files and/or folders are being dragged. |
void |
setNodeIcon(java.lang.String nodeIcon)
The filename of the default icon for all leaf nodes in this grid. |
void |
setOpenerIconSize(java.lang.Integer openerIconSize)
Width and height in pixels of the opener icons, that is, the icons which show the open or closed state of the node, typically a [+] or [-] symbol. |
void |
setOpenerImage(java.lang.String openerImage)
The base filename of the opener icon for the folder node when 'showConnectors' is false for this TreeGrid. The opener icon is displayed beside the folder icon in the Tree column for folder nodes. Clicking on this icon will toggle the open state of the folder. The filenames for these icons are assembled from this base filename and the state of the node, as follows: If the openerImage is set to {baseName}.{extension} ,
{baseName}_opened.{extension} will be displayed next to opened folders, and
{baseName}_closed.{extension} will be displayed next to closed folders, or
if this page is in RTL mode, {baseName}_opened_rtl.{extension} and
{baseName}_closed_rtl.{extension} will be used. |
void |
setOpenIconSuffix(java.lang.String openIconSuffix)
If showOpenIcons is true, this suffix will be appended to the
folderIcon for open folders in this grid. |
void |
setOpenState(java.lang.String openState)
Reset this set of open folders within this grid's data to match the String object passed in.Used to restore previous state retrieved from the grid by a call to getOpenState() .
|
void |
setParentAlreadyContainsChildMessage(java.lang.String parentAlreadyContainsChildMessage)
Message displayed when user attempts to drag a node into a parent that already contains a child of the same name. |
void |
setSelectedPaths(java.lang.String selectedPaths)
Reset this grid's selection to match the String object passed in.Used to restore previous state retrieved from the grid by a call to getSelectedPaths() .
|
void |
setSeparateFolders(java.lang.Boolean separateFolders)
Specifies whether folders and leaves should be segregated in the treeGrid display. With separateFolders:true and sortDirection:"descending", folders are displayed before their sibling leaves; with sortDirection:"ascending", leaves are displayed before their sibling folders. |
void |
setShowConnectors(java.lang.Boolean showConnectors)
Should this treeGrid show connector lines illustrating the tree's hierachy? |
void |
setShowCustomIconDrop(java.lang.Boolean showCustomIconDrop)
Should folder nodes showing custom icons (set via the customIconProperty ),
show drop state images when the user is drop-hovering over the folder.
If true, the dropIconSuffix will be appended to the image URL
(so "customFolder.gif" might be replaced with
"customFolder_drop.gif" ).Can be overridden at the node level via the customIconDropProperty property. |
void |
setShowCustomIconOpen(java.lang.Boolean showCustomIconOpen)
Should folder nodes showing custom icons (set via the customIconProperty ),
show open state images when the folder is opened.
If true, the openIconSuffix will be appended to the image URL
(so "customFolder.gif" might be replaced with
"customFolder_open.gif" ).Note that the closedIconSuffix is never appended to custom folder icons.Can be overridden at the node level via the customIconOpenProperty property. |
void |
setShowDropIcons(java.lang.Boolean showDropIcons)
If true, when the user drags a droppable target over a folder in this TreeGrid, show a different icon folder icon. This is achieved by appending the dropIconSuffix onto the
folderIcon URL (for example "[SKIN]/folder.gif" may be
replaced by "[SKIN]/folder_drop.gif" ). |
void |
setShowFullConnectors(java.lang.Boolean showFullConnectors)
If showConnectors is true, this property determines whether we should show
showing vertical continuation lines for each level of indenting within the tree. |
void |
setShowOpenIcons(java.lang.Boolean showOpenIcons)
If true, show a different icon for open folders than closed folders.
This is achieved by appending the openIconSuffix onto the
folderIcon URL [for example "[SKIN]/folder.gif" might be
replaced by "[SKIN]/folder_open.gif" .Note If this property is set to false the same icon is shown for
open folders as for closed folders, unless a custom folder icon was specified. |
void |
setShowRoot(java.lang.Boolean showRoot)
Specifies whether the root node should be displayed in the treeGrid. |
void |
setTreeFieldTitle(java.lang.String treeFieldTitle)
Visible title for the tree column (field). |
void |
setTreeRootValue(java.lang.Integer treeRootValue)
For databound trees, use this attribute to supply a ${isc.DocUtils.linkForRef('ResultTree.rootValue')} for this component's generated data object. |
void |
setTreeRootValue(java.lang.String treeRootValue)
For databound trees, use this attribute to supply a ${isc.DocUtils.linkForRef('ResultTree.rootValue')} for this component's generated data object. |
java.lang.Boolean |
willAcceptDrop()
This method overrides ListGrid.willAcceptDrop() and works as follows:
First, ListGrid.willAcceptDrop() (the superclass definition) is consulted. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent |
---|
getOrCreateJsObj |
Constructor Detail |
---|
public TreeGrid()
public TreeGrid(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static TreeGrid getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class ListGrid
public void setAnimateFolders(java.lang.Boolean animateFolders)
animateFolders
- animateFolders Default value is truepublic java.lang.Boolean getAnimateFolders()
public void setAnimateFolderTime(int animateFolderTime)
animateFolderSpeed
is not
set, this property designates the duration of the animation in ms.
animateFolderTime
- animateFolderTime Default value is 100public int getAnimateFolderTime()
animateFolderSpeed
is not
set, this property designates the duration of the animation in ms.
public void setAnimateFolderSpeed(int animateFolderSpeed)
animateFolderTime
property, which allows the developer to specify a
duration for the animation rather than a speed.
animateFolderSpeed
- animateFolderSpeed Default value is 1000public int getAnimateFolderSpeed()
animateFolderTime
property, which allows the developer to specify a
duration for the animation rather than a speed.
public void setAnimateFolderEffect(AnimationAcceleration animateFolderEffect)
animateFolderEffect
- animateFolderEffect Default value is nullpublic AnimationAcceleration getAnimateFolderEffect()
public void setData(Tree data)
Tree
object containing of nested TreeNode
s to
display as rows in this TreeGrid.
The data
property will typically not be explicitly specified for
databound TreeGrids, where the data is returned from the server via databound component
methods such as fetchData()
Set the Tree
object this TreeGrid will view and manipulate.
data
- Tree to show. Default value is nullpublic Tree getData()
Tree
object containing of nested TreeNode
s to
display as rows in this TreeGrid.
The data
property will typically not be explicitly specified for
databound TreeGrids, where the data is returned from the server via databound component
methods such as fetchData()
public void setLoadDataOnDemand(java.lang.Boolean loadDataOnDemand)
If unset the default loadDataOnDemand
setting will be used.
Note that when using loadDataOnDemand
, every node returned by the server is
assumed be a folder which may load further children. See
defaultIsFolder
for how to control this behavior.
loadDataOnDemand
- loadDataOnDemand Default value is nullpublic java.lang.Boolean getLoadDataOnDemand()
If unset the default loadDataOnDemand
setting will be used.
Note that when using loadDataOnDemand
, every node returned by the server is
assumed be a folder which may load further children. See
defaultIsFolder
for how to control this behavior.
public void setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter) throws java.lang.IllegalStateException
autoFetchAsFilter
for details.
setAutoFetchAsFilter
in interface DataBoundComponent
setAutoFetchAsFilter
in class ListGrid
autoFetchAsFilter
- autoFetchAsFilter Default value is false
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getAutoFetchAsFilter()
autoFetchAsFilter
for details.
getAutoFetchAsFilter
in interface DataBoundComponent
getAutoFetchAsFilter
in class ListGrid
public void setTreeFieldTitle(java.lang.String treeFieldTitle) throws java.lang.IllegalStateException
treeFieldTitle
- treeFieldTitle Default value is "Name"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getTreeFieldTitle()
public void setShowRoot(java.lang.Boolean showRoot) throws java.lang.IllegalStateException
This property is only available for "children" modelType trees, hence is not allowed for
trees that load data from the server dynamically via fetchData()
.
To get the equivalent of a visible "root" node in a tree that loads data dynamically,
add a singular, top-level parent to the data. However, note that this top-level parent
will technically be the only child of root, and the implicit root object will be
returned by Tree.getRoot()
.
showRoot
- showRoot Default value is false
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowRoot()
This property is only available for "children" modelType trees, hence is not allowed for
trees that load data from the server dynamically via fetchData()
.
To get the equivalent of a visible "root" node in a tree that loads data dynamically,
add a singular, top-level parent to the data. However, note that this top-level parent
will technically be the only child of root, and the implicit root object will be
returned by Tree.getRoot()
.
public void setSeparateFolders(java.lang.Boolean separateFolders) throws java.lang.IllegalStateException
separateFolders
- separateFolders Default value is false
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getSeparateFolders()
public void setDisplayNodeType(DisplayNodeType displayNodeType)
displayNodeType
- displayNodeType Default value is Tree.FOLDERS_AND_LEAVESpublic DisplayNodeType getDisplayNodeType()
public void setCanDragRecordsOut(java.lang.Boolean canDragRecordsOut)
setCanDragRecordsOut
in class ListGrid
canDragRecordsOut
- canDragRecordsOut Default value is falsepublic java.lang.Boolean getCanDragRecordsOut()
getCanDragRecordsOut
in class ListGrid
public void setCanAcceptDroppedRecords(java.lang.Boolean canAcceptDroppedRecords)
setCanAcceptDroppedRecords
in class ListGrid
canAcceptDroppedRecords
- canAcceptDroppedRecords Default value is falsepublic java.lang.Boolean getCanAcceptDroppedRecords()
getCanAcceptDroppedRecords
in class ListGrid
public void setCanReorderRecords(java.lang.Boolean canReorderRecords)
Note : This is an advanced setting
setCanReorderRecords
in class ListGrid
canReorderRecords
- canReorderRecords Default value is falsepublic java.lang.Boolean getCanReorderRecords()
getCanReorderRecords
in class ListGrid
public void setCanDropOnLeaves(java.lang.Boolean canDropOnLeaves)
Dropping is ordinarily not allowed on leaf nodes unless canReorderRecords
is
set.
The default action for a drop on a leaf node is to place the node in that leaf's parent
folder. This can be customized by overriding com.smartgwt.client.widgets.tree.TreeGrid#folderDrop
.
Note : This is an advanced setting
canDropOnLeaves
- canDropOnLeaves Default value is falsepublic java.lang.Boolean getCanDropOnLeaves()
Dropping is ordinarily not allowed on leaf nodes unless canReorderRecords
is
set.
The default action for a drop on a leaf node is to place the node in that leaf's parent
folder. This can be customized by overriding com.smartgwt.client.widgets.tree.TreeGrid#folderDrop
.
public void setCanReparentNodes(java.lang.Boolean canReparentNodes)
this.canAcceptDroppedRecords
is true, we
allow nodes to be dragged to different folders.
canReparentNodes
- canReparentNodes Default value is nullpublic java.lang.Boolean getCanReparentNodes()
this.canAcceptDroppedRecords
is true, we
allow nodes to be dragged to different folders.
public void setParentAlreadyContainsChildMessage(java.lang.String parentAlreadyContainsChildMessage) throws java.lang.IllegalStateException
parentAlreadyContainsChildMessage
- parentAlreadyContainsChildMessage Default value is "This item already contains a child item with that name."
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getParentAlreadyContainsChildMessage()
public void setCantDragIntoSelfMessage(java.lang.String cantDragIntoSelfMessage) throws java.lang.IllegalStateException
cantDragIntoSelfMessage
- cantDragIntoSelfMessage Default value is "You can't drag an item into itself."
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getCantDragIntoSelfMessage()
public void setCantDragIntoChildMessage(java.lang.String cantDragIntoChildMessage) throws java.lang.IllegalStateException
cantDragIntoChildMessage
- cantDragIntoChildMessage Default value is "You can't drag an item into one of it's children."
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getCantDragIntoChildMessage()
public void setIndentSize(int indentSize)
indentSize
- indentSize Default value is 20public int getIndentSize()
public void setIconSize(int iconSize)
iconSize
- iconSize Default value is 16public int getIconSize()
public void setOpenerIconSize(java.lang.Integer openerIconSize)
If showConnectors
is true, the opener icon includes the connector line, and
defaults to cellHeight
.
Otherwise, openerIconSize
defaults to iconSize
.
openerIconSize
- openerIconSize Default value is nullpublic java.lang.Integer getOpenerIconSize()
If showConnectors
is true, the opener icon includes the connector line, and
defaults to cellHeight
.
Otherwise, openerIconSize
defaults to iconSize
.
public void setFolderIcon(java.lang.String folderIcon)
openIconSuffix
, closedIconSuffix
or
dropIconSuffix
appended to indicate state changes if appropriate -
see documentation on showOpenIcons
and showDropIcons
.
folderIcon
- folderIcon Default value is "[SKIN]folder.gif"public java.lang.String getFolderIcon()
openIconSuffix
, closedIconSuffix
or
dropIconSuffix
appended to indicate state changes if appropriate -
see documentation on showOpenIcons
and showDropIcons
.
public void setDropIconSuffix(java.lang.String dropIconSuffix)
showDropIcons
is true, this suffix will be appended to the
folderIcon
when the user drop-hovers over some folder.
dropIconSuffix
- dropIconSuffix Default value is "drop"public java.lang.String getDropIconSuffix()
showDropIcons
is true, this suffix will be appended to the
folderIcon
when the user drop-hovers over some folder.
public void setOpenIconSuffix(java.lang.String openIconSuffix)
showOpenIcons
is true, this suffix will be appended to the
folderIcon
for open folders in this grid.
openIconSuffix
- openIconSuffix Default value is "open"public java.lang.String getOpenIconSuffix()
showOpenIcons
is true, this suffix will be appended to the
folderIcon
for open folders in this grid.
public void setClosedIconSuffix(java.lang.String closedIconSuffix)
folderIcon
for closed folders.
If showOpenIcons
is set to false
this suffix will also be
appended to open folders' icons.
closedIconSuffix
- closedIconSuffix Default value is "closed"public java.lang.String getClosedIconSuffix()
folderIcon
for closed folders.
If showOpenIcons
is set to false
this suffix will also be
appended to open folders' icons.
public void setNodeIcon(java.lang.String nodeIcon)
customIconProperty
directly on
the node.
Set the icon for a particular treenode to a specified URL
nodeIcon
- tree node. Default value is "[SKIN]file.gif"public java.lang.String getNodeIcon()
customIconProperty
directly on
the node.
public void setShowOpenIcons(java.lang.Boolean showOpenIcons)
open
folders than closed folders.
This is achieved by appending the openIconSuffix
onto the
folderIcon
URL [for example "[SKIN]/folder.gif"
might be
replaced by "[SKIN]/folder_open.gif"
.false
the same icon is shown for
open folders as for closed folders, unless a custom folder icon was specified. This will be
determined by folderIcon
plus the closedIconSuffix
.
showOpenIcons
- showOpenIcons Default value is truepublic java.lang.Boolean getShowOpenIcons()
open
folders than closed folders.
This is achieved by appending the openIconSuffix
onto the
folderIcon
URL [for example "[SKIN]/folder.gif"
might be
replaced by "[SKIN]/folder_open.gif"
.false
the same icon is shown for
open folders as for closed folders, unless a custom folder icon was specified. This will be
determined by folderIcon
plus the closedIconSuffix
.
public void setShowDropIcons(java.lang.Boolean showDropIcons)
dropIconSuffix
onto the
folderIcon
URL (for example "[SKIN]/folder.gif"
may be
replaced by "[SKIN]/folder_drop.gif"
).
showDropIcons
- showDropIcons Default value is truepublic java.lang.Boolean getShowDropIcons()
dropIconSuffix
onto the
folderIcon
URL (for example "[SKIN]/folder.gif"
may be
replaced by "[SKIN]/folder_drop.gif"
).
public void setCustomIconProperty(java.lang.String customIconProperty)
node[grid.customIconProperty]
to the URL of the desired icon to display and
it will be shown instead of the standard nodeIcon
for this node.showCustomIconOpen
and/or showCustomIconDrop
is true for this grid, customized icons for folder nodes will be appended with the
dropIconSuffix
or openIconSuffix
suffixes on state change
as with the standard folderIcon
for this treeGrid. Also note that for
custom folder icons, the closedIconSuffix
will never be appened.
customIconProperty
- customIconProperty Default value is "icon"public java.lang.String getCustomIconProperty()
node[grid.customIconProperty]
to the URL of the desired icon to display and
it will be shown instead of the standard nodeIcon
for this node.showCustomIconOpen
and/or showCustomIconDrop
is true for this grid, customized icons for folder nodes will be appended with the
dropIconSuffix
or openIconSuffix
suffixes on state change
as with the standard folderIcon
for this treeGrid. Also note that for
custom folder icons, the closedIconSuffix
will never be appened.
public void setShowCustomIconOpen(java.lang.Boolean showCustomIconOpen)
customIconProperty
),
show open state images when the folder is opened.
If true, the openIconSuffix
will be appended to the image URL
(so "customFolder.gif"
might be replaced with
"customFolder_open.gif"
).closedIconSuffix
is never appended to custom folder icons.customIconOpenProperty
property.
Note : This is an advanced setting
showCustomIconOpen
- showCustomIconOpen Default value is falsepublic java.lang.Boolean getShowCustomIconOpen()
customIconProperty
),
show open state images when the folder is opened.
If true, the openIconSuffix
will be appended to the image URL
(so "customFolder.gif"
might be replaced with
"customFolder_open.gif"
).closedIconSuffix
is never appended to custom folder icons.customIconOpenProperty
property.
public void setShowCustomIconDrop(java.lang.Boolean showCustomIconDrop)
customIconProperty
),
show drop state images when the user is drop-hovering over the folder.
If true, the dropIconSuffix
will be appended to the image URL
(so "customFolder.gif"
might be replaced with
"customFolder_drop.gif"
).customIconDropProperty
property.
Note : This is an advanced setting
showCustomIconDrop
- showCustomIconDrop Default value is falsepublic java.lang.Boolean getShowCustomIconDrop()
customIconProperty
),
show drop state images when the user is drop-hovering over the folder.
If true, the dropIconSuffix
will be appended to the image URL
(so "customFolder.gif"
might be replaced with
"customFolder_drop.gif"
).customIconDropProperty
property.
public void setCustomIconOpenProperty(java.lang.String customIconOpenProperty)
customIconProperty
),
this property allows the developer to specify on a per-node basis whether a
open state icon should be displayed when the folder is open.
Set node[treeGrid.customIconOpenProperty]
to true to show the open state
icons, or false to suppress this.grid.showCustomIconOpen
for this node.
Note : This is an advanced setting
customIconOpenProperty
- customIconOpenProperty Default value is "showOpenIcon"public java.lang.String getCustomIconOpenProperty()
customIconProperty
),
this property allows the developer to specify on a per-node basis whether a
open state icon should be displayed when the folder is open.
Set node[treeGrid.customIconOpenProperty]
to true to show the open state
icons, or false to suppress this.grid.showCustomIconOpen
for this node.
public void setCustomIconDropProperty(java.lang.String customIconDropProperty)
customIconProperty
),
this property allows the developer to specify on a per-node basis whether a
drop state icon (with dropIconSuffix
) should be displayed when the
user drop-hovers over this folder.node[treeGrid.customIconDropProperty]
to true to show the drop state
icons, or false to suppress this.treeGrid.showCustomIconDrop
for this node.
Note : This is an advanced setting
customIconDropProperty
- customIconDropProperty Default value is "showDropIcon"public java.lang.String getCustomIconDropProperty()
customIconProperty
),
this property allows the developer to specify on a per-node basis whether a
drop state icon (with dropIconSuffix
) should be displayed when the
user drop-hovers over this folder.node[treeGrid.customIconDropProperty]
to true to show the drop state
icons, or false to suppress this.treeGrid.showCustomIconDrop
for this node.
public void setManyItemsImage(java.lang.String manyItemsImage)
manyItemsImage
- manyItemsImage Default value is "[SKIN]folder_file.gif"public java.lang.String getManyItemsImage()
public void setShowConnectors(java.lang.Boolean showConnectors)
For the set of images used to show connectors, see connectorImage
.
Note: in order for connector images to be perfectly connected, all styles for cells must have no top or bottom border or padding. If you see small gaps in connector lines, check your CSS files. See the example below for an example of correct configuration, including example CSS.
showConnectors
- showConnectors Default value is falsepublic java.lang.Boolean getShowConnectors()
For the set of images used to show connectors, see connectorImage
.
Note: in order for connector images to be perfectly connected, all styles for cells must have no top or bottom border or padding. If you see small gaps in connector lines, check your CSS files. See the example below for an example of correct configuration, including example CSS.
public void setShowFullConnectors(java.lang.Boolean showFullConnectors)
showConnectors
is true, this property determines whether we should show
showing vertical continuation lines for each level of indenting within the tree. Setting to
false will show only the hierachy lines are only shown for the most indented path ("sparse"
connectors).
showFullConnectors
- showFullConnectors Default value is truepublic java.lang.Boolean getShowFullConnectors()
showConnectors
is true, this property determines whether we should show
showing vertical continuation lines for each level of indenting within the tree. Setting to
false will show only the hierachy lines are only shown for the most indented path ("sparse"
connectors).
public void setOpenerImage(java.lang.String openerImage) throws java.lang.IllegalStateException
{baseName}.{extension}
,
{baseName}_opened.{extension}
will be displayed next to opened folders, and
{baseName}_closed.{extension}
will be displayed next to closed folders, or
if this page is in RTL mode, {baseName}_opened_rtl.{extension}
and
{baseName}_closed_rtl.{extension}
will be used.
openerImage
- openerImage Default value is "[SKIN]opener.gif"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getOpenerImage()
{baseName}.{extension}
,
{baseName}_opened.{extension}
will be displayed next to opened folders, and
{baseName}_closed.{extension}
will be displayed next to closed folders, or
if this page is in RTL mode, {baseName}_opened_rtl.{extension}
and
{baseName}_closed_rtl.{extension}
will be used.
public void setConnectorImage(java.lang.String connectorImage) throws java.lang.IllegalStateException
showConnectors
is true.
Connector icons are rendered into the title field of each row and show the dotted
hierarchy lines between siblings of the same parent node. For each node, a connector icon
may be shown:showFullConnectors
is true).showFullConnectors
governs whether connector lines will be
displayed for all indent levels, or just for the innermost level of the tree.
The filenames for these icons are assembled from this base filename and the state of the
node. Assuming the connectorImage is set to {baseName}.{extension}
, the
full set of images to be displayed will be:
{baseName}_ancestor[_rtl].{extension}
if showFullConnectors
is true, this is the URL for the vertical continuation image to be displayed at the
appropriate indent levels for ancestor nodes with subsequent children.
For nodes with no children:
{baseName}_single[_rtl].{extension}
: Shown when there is no connector line
attached to the parent or previous sibling, and no connector line to the next sibling. For
showFullConnectors
trees, there will always be a
connector leading to the parent or previous sibling if its present in the tree so this
icon can only be displayed for the first row.{baseName}_start[_rtl].{extension}
: Shown when the there is no connector
line attached to the parent or previous sibling, but there is a connector to the next
sibling. As with _single
this will only ever be used for the first row if
showFullConnectors
is true{baseName}_end[_rtl].{extension}
: Shown if we are not showing a connector
line attached to the next sibling of this node (but are showing a connection to the previous
sibling or parent).{baseName}_middle[_rtl].{extension}
: Shown where the we have a connector
line leading to both the previous sibling (or parent) and the next sibling.
showFullConnectors
is false, open
folders will never show a connector to subsequent siblings:
{baseName}_opened_single[_rtl].{extension}
opened folder node with
children when no connector line is shown attaching to either the folder's previous sibling
or parent, or to any subsequent siblings.{baseName}_opened_start[_rtl].{extension}
: opened folder with children
when the there is no connector line attached to the parent or previous sibling, but there
is a connector to the next sibling.{baseName}_opened_end[_rtl].{extension}
: opened folder with children
if we are not showing a connector line attached to the next sibling of this node (but are
showing a connection to the previous sibling or parent).{baseName}_opened_middle[_rtl].{extension}
: opened folder with children
where the we have a connector line leading to both the previous sibling (or parent) and the
next sibling.
{baseName}_closed_single[_rtl].{extension}
closed folder node with
children when no connector line is shown attaching to either the folder's previous sibling
or parent, or to any subsequent siblings.{baseName}_closed_start[_rtl].{extension}
: closed folder with children
when the there is no connector line attached to the parent or previous sibling, but there
is a connector to the next sibling.{baseName}_closed_end[_rtl].{extension}
: closed folder with children
if we are not showing a connector line attached to the next sibling of this node (but are
showing a connection to the previous sibling or parent).{baseName}_closed_middle[_rtl].{extension}
: closed folder with children
where the we have a connector line leading to both the previous sibling (or parent) and the
next sibling.
connectorImage
- connectorImage Default value is "[SKIN]connector.gif"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getConnectorImage()
showConnectors
is true.
Connector icons are rendered into the title field of each row and show the dotted
hierarchy lines between siblings of the same parent node. For each node, a connector icon
may be shown:showFullConnectors
is true).showFullConnectors
governs whether connector lines will be
displayed for all indent levels, or just for the innermost level of the tree.
The filenames for these icons are assembled from this base filename and the state of the
node. Assuming the connectorImage is set to {baseName}.{extension}
, the
full set of images to be displayed will be:
{baseName}_ancestor[_rtl].{extension}
if showFullConnectors
is true, this is the URL for the vertical continuation image to be displayed at the
appropriate indent levels for ancestor nodes with subsequent children.
For nodes with no children:
{baseName}_single[_rtl].{extension}
: Shown when there is no connector line
attached to the parent or previous sibling, and no connector line to the next sibling. For
showFullConnectors
trees, there will always be a
connector leading to the parent or previous sibling if its present in the tree so this
icon can only be displayed for the first row.{baseName}_start[_rtl].{extension}
: Shown when the there is no connector
line attached to the parent or previous sibling, but there is a connector to the next
sibling. As with _single
this will only ever be used for the first row if
showFullConnectors
is true{baseName}_end[_rtl].{extension}
: Shown if we are not showing a connector
line attached to the next sibling of this node (but are showing a connection to the previous
sibling or parent).{baseName}_middle[_rtl].{extension}
: Shown where the we have a connector
line leading to both the previous sibling (or parent) and the next sibling.
showFullConnectors
is false, open
folders will never show a connector to subsequent siblings:
{baseName}_opened_single[_rtl].{extension}
opened folder node with
children when no connector line is shown attaching to either the folder's previous sibling
or parent, or to any subsequent siblings.{baseName}_opened_start[_rtl].{extension}
: opened folder with children
when the there is no connector line attached to the parent or previous sibling, but there
is a connector to the next sibling.{baseName}_opened_end[_rtl].{extension}
: opened folder with children
if we are not showing a connector line attached to the next sibling of this node (but are
showing a connection to the previous sibling or parent).{baseName}_opened_middle[_rtl].{extension}
: opened folder with children
where the we have a connector line leading to both the previous sibling (or parent) and the
next sibling.
{baseName}_closed_single[_rtl].{extension}
closed folder node with
children when no connector line is shown attaching to either the folder's previous sibling
or parent, or to any subsequent siblings.{baseName}_closed_start[_rtl].{extension}
: closed folder with children
when the there is no connector line attached to the parent or previous sibling, but there
is a connector to the next sibling.{baseName}_closed_end[_rtl].{extension}
: closed folder with children
if we are not showing a connector line attached to the next sibling of this node (but are
showing a connection to the previous sibling or parent).{baseName}_closed_middle[_rtl].{extension}
: closed folder with children
where the we have a connector line leading to both the previous sibling (or parent) and the
next sibling.
public java.lang.String getOpenState()
String
object.getOpenState()
to open the same set of folders
within the treeGrid's data (assuming the nodes are still present in the data).
public void setOpenState(java.lang.String openState)
String
object passed in.getOpenState()
.
openState
- Object describing the desired set of open folders.public java.lang.String getSelectedPaths()
String
object.setSelectedPaths(java.lang.String)
to reset this grid's selection
the current state (assuming the same data is present in the grid).
public void setSelectedPaths(java.lang.String selectedPaths)
String
object passed in.getSelectedPaths()
.
selectedPaths
- Object describing the desired selection state of the gridpublic java.lang.Boolean canEditCell()
name
field of this grid's data
tree. Also disallows editing of the auto-generated tree field, which displays the result
of Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
on the node.
public void recordDoubleClick()
com.smartgwt.client.widgets.tree.TreeGrid#toggleFolder
on it. If
the node is a leaf, calls com.smartgwt.client.widgets.tree.TreeGrid#openLeaf
on it.
public java.lang.Boolean willAcceptDrop()
ListGrid.willAcceptDrop()
and works as follows:
ListGrid.willAcceptDrop()
(the superclass definition) is consulted. If it
returns false, then this method returns false immediately.canReorderRecords
is truecanAcceptDroppedRecords
is true and the dragTarget gives us a valid set of records to drop into place.canAcceptDrop:false
canAcceptDrop
set to false
canReparentNodes
is true, and the user is dragging a node from one folder
to another, this method will return true to allow the change of parent folder.
willAcceptDrop
in class ListGrid
public int getEventRow()
getEventRow
in class ListGrid
public int getEventRow(int y)
getEventRow
in class ListGrid
y
- optional y-coordinate to obtain row number, in lieue of the y coordinate of the last mouse event
public java.lang.String getOpenIcon(TreeNode node)
node
- tree node in question
public java.lang.String getExtraIcon(TreeNode node)
node
- tree node in question
public HandlerRegistration addFolderOpenedHandler(FolderOpenedHandler handler)
This method is called when a folder is opened either via the user manipulating the
expand/collapse control in the UI or via com.smartgwt.client.widgets.tree.TreeGrid#openFolder
. You can return
false
to cancel the open.
addFolderOpenedHandler
in interface HasFolderOpenedHandlers
handler
- the folderOpened handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addFolderClosedHandler(FolderClosedHandler handler)
This method is called when a folder is closed either via the user manipulating the
expand/collapse control in the UI or via com.smartgwt.client.widgets.tree.TreeGrid#closeFolder
. You can return
false
to cancel the close.
addFolderClosedHandler
in interface HasFolderClosedHandlers
handler
- the folderClosed handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addFolderClickHandler(FolderClickHandler handler)
This method is called when a folder record is clicked on.
addFolderClickHandler
in interface HasFolderClickHandlers
handler
- the folderClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addLeafClickHandler(LeafClickHandler handler)
This method is called when a leaf record is clicked on.
addLeafClickHandler
in interface HasLeafClickHandlers
handler
- the leafClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addNodeClickHandler(NodeClickHandler handler)
This method is called when a leaf or folder record is clicked on. Note that if you set
up a callback for nodeClick()
and e.g. addLeafClickHandler(com.smartgwt.client.widgets.tree.events.LeafClickHandler)
, then
both will fire (in that order) if a leaf is clicked on.
addNodeClickHandler
in interface HasNodeClickHandlers
handler
- the nodeClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addFolderContextClickHandler(FolderContextClickHandler handler)
This method is called when a context click occurs on a folder record.
addFolderContextClickHandler
in interface HasFolderContextClickHandlers
handler
- the folderContextClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addLeafContextClickHandler(LeafContextClickHandler handler)
This method is called when a context click occurs on a leaf record.
addLeafContextClickHandler
in interface HasLeafContextClickHandlers
handler
- the leafContextClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addNodeContextClickHandler(NodeContextClickHandler handler)
This method is called when a context click occurs on a leaf or folder record. Note that
if you set up a callback for nodeContextClick()
and
e.g. addLeafContextClickHandler(com.smartgwt.client.widgets.tree.events.LeafContextClickHandler)
, then both will fire (in that order) if a leaf
is contextclicked - unless nodeContextClick()
returns false, in which case
no further contextClick callbacks will be called.
addNodeContextClickHandler
in interface HasNodeContextClickHandlers
handler
- the nodeContextClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addDataArrivedHandler(DataArrivedHandler handler)
Notification method fired whenever this TreeGrid recieves new data nodes from the
dataSource. Only applies to databound TreeGrids where data
is a
com.smartgwt.client..ResultTree
- either explicitly created and applied via setData(com.smartgwt.client.widgets.tree.Tree)
or
automatically generated via a fetchData()
call.
handler
- the dataArrived handler
HandlerRegistration
used to remove this handlerprotected void onInit()
onInit
in class ListGrid
protected java.lang.String getNodeTitle(TreeNode node, int recordNum, ListGridField field)
name
attribute, then the current node[field.name]
is returned.
Otherwise, the result of calling Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
on the node is called.
node
- The node for which the title is being requested.recordNum
- The index of the node.field
- The field for which the title is being requested.
protected java.lang.String getIcon(TreeNode node, boolean defaultState)
By default icons are derived from folderIcon
and nodeIcon
.
Custom icons for individual nodes can be overriden by setting the customIconProperty
on a node.
If you want to suppress icons altogether, provide an override of this method that simply returns null.
Note that the full icon URL will be derived by applying Canvas.getImgURL(java.lang.String)
to the
value returned from this method.
Note: This is an override point
node
- tree node in question
public TreeNode getDropFolder()
public void setFields(TreeGridField... fields)
If dataSource
is also
set, this value acts as a set of overrides as explained in fields
.
fields
- fields Default value is nullpublic Tree getTree()
public ListGridRecord[] getRecords()
getRecords
in class ListGrid
public void setInitialData(TreeNode[] data) throws java.lang.IllegalStateException
parentId
linked ${isc.DocUtils.linkForRef('object:TreeNode')}s in a format
equivalent to that documented on data
.
initialData
- initialData Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void fetchData()
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. This method will create a
com.smartgwt.client..ResultTree
to manage tree data, which will subsequently be available as
treeGrid.data
. DataSource records returned by the "fetch" operation are linked into a tree
structure according to primaryKey
and foreignKey
declarations on DataSource fields. See the
TreeDataBinding
topic for complete details.
By default, the created ResultTree will use folder-by-folder load on demand, asking the server for the children of each folder as the user opens it.
The com.smartgwt.client..ResultTree
created by fetchData()
can be
customized by setting dataProperties
to an
Object containing properties and methods to apply to the created ResultTree. For example, the property that
determines whether a node is a folder (isFolderProperty
) can be customized, or level-by-level loading can be disabled via loadDataOnDemand
.
The callback passed to
fetchData
will fire once, the first time that data is loaded from the server. If using
folder-by-folder load on demand, use the com.smartgwt.client..ResultTree#dataArrived
notification to be
notified each time new nodes are loaded.
Note that, if criteria are passed to fetchData()
, they
will be passed every time a new "fetch" operation is sent to the server. This allows you to retrieve multiple
different tree structures from the same DataSource. However note that the server is expected to always respond
with an intact tree - returned nodes which do not have parents are dropped from the dataset and not displayed.
fetchData
in interface DataBoundComponent
fetchData
in class ListGrid
public void fetchData(Criteria criteria)
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. This method will create a
com.smartgwt.client..ResultTree
to manage tree data, which will subsequently be available as
treeGrid.data
. DataSource records returned by the "fetch" operation are linked into a tree
structure according to primaryKey
and foreignKey
declarations on DataSource fields. See the
TreeDataBinding
topic for complete details.
By default, the created ResultTree will use folder-by-folder load on demand, asking the server for the children of each folder as the user opens it.
The com.smartgwt.client..ResultTree
created by fetchData()
can be
customized by setting dataProperties
to an
Object containing properties and methods to apply to the created ResultTree. For example, the property that
determines whether a node is a folder (isFolderProperty
) can be customized, or level-by-level loading can be disabled via loadDataOnDemand
.
The callback passed to
fetchData
will fire once, the first time that data is loaded from the server. If using
folder-by-folder load on demand, use the com.smartgwt.client..ResultTree#dataArrived
notification to be
notified each time new nodes are loaded.
Note that, if criteria are passed to fetchData()
, they
will be passed every time a new "fetch" operation is sent to the server. This allows you to retrieve multiple
different tree structures from the same DataSource. However note that the server is expected to always respond
with an intact tree - returned nodes which do not have parents are dropped from the dataset and not displayed.
fetchData
in interface DataBoundComponent
fetchData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void fetchData(Criteria criteria, DSCallback callback)
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. This method will create a
com.smartgwt.client..ResultTree
to manage tree data, which will subsequently be available as
treeGrid.data
. DataSource records returned by the "fetch" operation are linked into a tree
structure according to primaryKey
and foreignKey
declarations on DataSource fields. See the
TreeDataBinding
topic for complete details.
By default, the created ResultTree will use folder-by-folder load on demand, asking the server for the children of each folder as the user opens it.
The com.smartgwt.client..ResultTree
created by fetchData()
can be
customized by setting dataProperties
to an
Object containing properties and methods to apply to the created ResultTree. For example, the property that
determines whether a node is a folder (isFolderProperty
) can be customized, or level-by-level loading can be disabled via loadDataOnDemand
.
The callback passed to
fetchData
will fire once, the first time that data is loaded from the server. If using
folder-by-folder load on demand, use the com.smartgwt.client..ResultTree#dataArrived
notification to be
notified each time new nodes are loaded.
Note that, if criteria are passed to fetchData()
, they
will be passed every time a new "fetch" operation is sent to the server. This allows you to retrieve multiple
different tree structures from the same DataSource. However note that the server is expected to always respond
with an intact tree - returned nodes which do not have parents are dropped from the dataset and not displayed.
fetchData
in interface DataBoundComponent
fetchData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was requiredpublic void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component as a tree. This method will create a
com.smartgwt.client..ResultTree
to manage tree data, which will subsequently be available as
treeGrid.data
. DataSource records returned by the "fetch" operation are linked into a tree
structure according to primaryKey
and foreignKey
declarations on DataSource fields. See the
TreeDataBinding
topic for complete details.
By default, the created ResultTree will use folder-by-folder load on demand, asking the server for the children of each folder as the user opens it.
The com.smartgwt.client..ResultTree
created by fetchData()
can be
customized by setting dataProperties
to an
Object containing properties and methods to apply to the created ResultTree. For example, the property that
determines whether a node is a folder (isFolderProperty
) can be customized, or level-by-level loading can be disabled via loadDataOnDemand
.
The callback passed to
fetchData
will fire once, the first time that data is loaded from the server. If using
folder-by-folder load on demand, use the com.smartgwt.client..ResultTree#dataArrived
notification to be
notified each time new nodes are loaded.
Note that, if criteria are passed to fetchData()
, they
will be passed every time a new "fetch" operation is sent to the server. This allows you to retrieve multiple
different tree structures from the same DataSource. However note that the server is expected to always respond
with an intact tree - returned nodes which do not have parents are dropped from the dataset and not displayed.
fetchData
in interface DataBoundComponent
fetchData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was requiredrequestProperties
- additional properties to set on the DSRequest
that will be issuedpublic void filterData(Criteria criteria)
This
method behaves exactly like fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
filterData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void filterData(Criteria criteria, DSCallback callback)
This
method behaves exactly like fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
filterData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was required; see com.smartgwt.client..DataBoundComponent#fetchData
for detailspublic void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
This
method behaves exactly like fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
filterData
in class ListGrid
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
com.smartgwt.client..DataBoundComponent#fetchData
for detailsrequestProperties
- for databound components only - optional additional
properties to set on the DSRequest that will be issuedpublic ListGridRecord getSelectedRecord()
selectionType
is "single"
, or if you only care about the first selected record in a multiple-record selection. To access all selected records, use ListGrid.getSelection()
instead.
getSelectedRecord
in class ListGrid
public ListGridRecord getRecord(int recordNum)
com.smartgwt.client.widgets.grid.ListGrid#getCellRecord
.
getRecord
in class ListGrid
recordNum
- row index of record to return.
public void setTreeRootValue(java.lang.String treeRootValue) throws java.lang.IllegalStateException
This property allows you to have a particular component navigate a tree starting from any given node as the root.
Note : This is an advanced setting
treeRootValue
- treeRootValue Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void setTreeRootValue(java.lang.Integer treeRootValue) throws java.lang.IllegalStateException
This property allows you to have a particular component navigate a tree starting from any given node as the root.
Note : This is an advanced setting
treeRootValue
- treeRootValue Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getTreeRootValue()
This property allows you to have a particular component navigate a tree starting from any given node as the root.
public HandlerRegistration addFolderDropHandler(FolderDropHandler handler)
Notification method fired when treeNode(s) are dropped into a folder of this TreeGrid.
This method fires before the standard com.smartgwt.client.widgets.tree.TreeGrid#folderDrop
processing occurs
and returning false will suppress that default behavior.
addFolderDropHandler
in interface HasFolderDropHandlers
handler
- the onFolderDrop handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addRecordDropHandler(RecordDropHandler handler) throws java.lang.UnsupportedOperationException
addFolderDropHandler(com.smartgwt.client.widgets.tree.events.FolderDropHandler)
instead.
addRecordDropHandler
in interface HasRecordDropHandlers
addRecordDropHandler
in class ListGrid
handler
- the onRecordDrop handler
HandlerRegistration
used to remove this handler
java.lang.UnsupportedOperationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |