com.vaadin.ui.
Class TreeTable
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField
com.vaadin.ui.AbstractSelect
com.vaadin.ui.Table
com.vaadin.ui.TreeTable
All Implemented Interfaces:
Buffered, BufferedValidatable, Container, Container.Hierarchical, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Sortable, Container.Viewer, Property, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.Container, Action.ShortcutNotifier, DragSource, DropTarget, ItemClickEvent.ItemClickNotifier, ItemClickEvent.ItemClickSource, MethodEventSource, Paintable, Sizeable, VariableOwner, Component, Component.Focusable, Field, Serializable, EventListener
- extends Table
- implements Container.Hierarchical
public class TreeTable
TreeTable extends the Table
component so that it can also visualize a
hierarchy of its Items in a similar manner that Tree
does. The tree
hierarchy is always displayed in the first actual column of the TreeTable.
The TreeTable supports the usual Table
features like lazy loading, so
it should be no problem to display lots of items at once. Only required rows
and some cache rows are sent to the client.
TreeTable supports standard Container.Hierarchical
container interfaces, but
also a more fine tuned version - Collapsible
. A container
implementing the Collapsible
interface stores the collapsed/expanded
state internally and can this way scale better on the server side than with
standard Hierarchical implementations. Developer must however note that
Collapsible
containers can not be shared among several users as they
share UI state in the container.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.data.Container |
---|
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractSelect |
---|
ITEM_CAPTION_MODE_EXPLICIT, ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID, ITEM_CAPTION_MODE_ICON_ONLY, ITEM_CAPTION_MODE_ID, ITEM_CAPTION_MODE_INDEX, ITEM_CAPTION_MODE_ITEM, ITEM_CAPTION_MODE_PROPERTY, itemIdMapper, items |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
TreeTable()
Creates an empty TreeTable with a default container. |
|
TreeTable(String caption)
Creates an empty TreeTable with a default container. |
|
TreeTable(String caption,
Container dataSource)
Creates a TreeTable instance with given captions and data source. |
Method Summary | |
---|---|
void |
addListener(Tree.CollapseListener listener)
Adds a collapse listener. |
void |
addListener(Tree.ExpandListener listener)
Adds an expand listener. |
boolean |
areChildrenAllowed(Object itemId)
Tests if the Item with given ID can have children. |
void |
changeVariables(Object source,
Map<String,Object> variables)
Invoked when the value of a variable has changed. |
void |
containerItemSetChange(Container.ItemSetChangeEvent event)
Container datasource item set change. |
protected void |
fireCollapseEvent(Object itemId)
Emits a collapse event. |
protected void |
fireExpandEvent(Object itemId)
Emits an expand event. |
protected int |
getAddedRowCount()
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. |
Collection<?> |
getChildren(Object itemId)
Gets the IDs of all Items that are children of the specified Item. |
Container.Hierarchical |
getContainerDataSource()
Gets the viewing data-source container. |
protected int |
getFirstAddedItemIndex()
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. |
protected int |
getFirstUpdatedItemIndex()
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism. |
Object |
getHierarchyColumnId()
|
protected Object |
getIdByIndex(int index)
|
Collection<?> |
getItemIds()
Gets the item Id collection from the container. |
Object |
getParent(Object itemId)
Gets the ID of the parent Item of the specified Item. |
protected int |
getUpdatedRowCount()
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism. |
boolean |
hasChildren(Object itemId)
Tests if the Item specified with itemId has child Items
or if it is a leaf. |
protected int |
indexOfId(Object itemId)
|
boolean |
isAnimationsEnabled()
|
boolean |
isCollapsed(Object itemId)
Checks if Item with given identifier is collapsed in the UI. |
boolean |
isLastId(Object itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the Container. |
protected boolean |
isPartialRowUpdate()
Subclass and override this to enable partial row updates and additions, which bypass the normal caching mechanism. |
boolean |
isRoot(Object itemId)
Tests if the Item specified with itemId is a root Item. |
Object |
lastItemId()
Gets the ID of the last Item in the Container. |
Object |
nextItemId(Object itemId)
Gets the ID of the Item following the Item that corresponds to itemId. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
protected void |
paintRowAttributes(PaintTarget target,
Object itemId)
A method where extended Table implementations may add their custom attributes for rows. |
protected void |
paintRowIcon(PaintTarget target,
Object[][] cells,
int indexInRowbuffer)
|
Object |
prevItemId(Object itemId)
Gets the ID of the Item preceding the Item that corresponds to the itemId. |
void |
removeListener(Tree.CollapseListener listener)
Removes a collapse listener. |
void |
removeListener(Tree.ExpandListener listener)
Removes an expand listener. |
Collection<?> |
rootItemIds()
Gets the IDs of all Items in the container that don't have a parent. |
void |
setAnimationsEnabled(boolean animationsEnabled)
Animations can be enabled by passing true to this method. |
boolean |
setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
Sets the given Item's capability to have children. |
void |
setCollapsed(Object itemId,
boolean collapsed)
Sets the Item specified by given identifier as collapsed or expanded. |
void |
setContainerDataSource(Container newDataSource)
Sets the Container that serves as the data source of the viewer. |
void |
setHierarchyColumn(Object hierarchyColumnId)
Explicitly sets the column in which the TreeTable visualizes the hierarchy. |
boolean |
setParent(Object itemId,
Object newParentId)
Sets the parent of an Item. |
protected boolean |
shouldHideAddedRows()
Subclass and override this to enable removing of rows, bypassing the normal caching and lazy loading mechanism. |
int |
size()
Gets the number of visible Items in the Container. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vaadin.data.Container.Hierarchical |
---|
removeItem |
Methods inherited from interface com.vaadin.data.Container |
---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getType, removeAllItems, removeContainerProperty |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Methods inherited from interface com.vaadin.ui.Field |
---|
getDescription, setCaption, setDescription |
Constructor Detail |
---|
TreeTable
public TreeTable()
Creates an empty TreeTable with a default container.
TreeTable
public TreeTable(String caption)
- Parameters:
caption
- the caption for the TreeTable
Creates an empty TreeTable with a default container.
TreeTable
public TreeTable(String caption,
Container dataSource)
- Parameters:
caption
- the caption for the componentdataSource
- the dataSource that is used to list items in the component
Creates a TreeTable instance with given captions and data source.
Method Detail |
---|
paintRowAttributes
protected void paintRowAttributes(PaintTarget target,
Object itemId)
throws PaintException
- Overrides:
paintRowAttributes
in classTable
- Throws:
PaintException
Description copied from class: Table
A method where extended Table implementations may add their custom attributes for rows.
paintRowIcon
protected void paintRowIcon(PaintTarget target,
Object[][] cells,
int indexInRowbuffer)
throws PaintException
- Overrides:
paintRowIcon
in classTable
- Throws:
PaintException
changeVariables
public void changeVariables(Object source,
Map<String,Object> variables)
- Specified by:
changeVariables
in interfaceVariableOwner
- Overrides:
changeVariables
in classTable
- Parameters:
source
- the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.- See Also:
Select.changeVariables(java.lang.Object, java.util.Map)
Description copied from class: Table
Invoked when the value of a variable has changed.
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classTable
- Parameters:
target
- the Paint Event.- Throws:
PaintException
- if the paint operation failed.
Description copied from class: AbstractSelect
Paints the content of this component.
isPartialRowUpdate
protected boolean isPartialRowUpdate()
- Overrides:
isPartialRowUpdate
in classTable
- Returns:
- true if this update is a partial row update, false if not. For plain Table it is always false.
Description copied from class: Table
Subclass and override this to enable partial row updates and additions, which bypass the normal caching mechanism. This is useful for e.g. TreeTable.
getFirstAddedItemIndex
protected int getFirstAddedItemIndex()
- Overrides:
getFirstAddedItemIndex
in classTable
- Returns:
- The index of the first added item. For plain Table it is always 0.
Description copied from class: Table
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. This is useful for e.g. TreeTable, where expanding a node should only fetch and add the items inside of that node.
getAddedRowCount
protected int getAddedRowCount()
- Overrides:
getAddedRowCount
in classTable
- Returns:
- the number of rows to be added, starting at the index returned by
Table.getFirstAddedItemIndex()
. For plain Table it is always 0.
Description copied from class: Table
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. This is useful for e.g. TreeTable, where expanding a node should only fetch and add the items inside of that node.
getFirstUpdatedItemIndex
protected int getFirstUpdatedItemIndex()
- Overrides:
getFirstUpdatedItemIndex
in classTable
- Returns:
- the index of the first item to be updated. For plain Table it is always 0.
Description copied from class: Table
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism. This is useful for updating the state of certain rows, e.g. in the TreeTable the collapsed state of a single node is updated using this mechanism.
getUpdatedRowCount
protected int getUpdatedRowCount()
- Overrides:
getUpdatedRowCount
in classTable
- Returns:
- the number of rows to update, starting at the index returned by
Table.getFirstUpdatedItemIndex()
. For plain table it is always 0.
Description copied from class: Table
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism. This is useful for updating the state of certain rows, e.g. in the TreeTable the collapsed state of a single node is updated using this mechanism.
shouldHideAddedRows
protected boolean shouldHideAddedRows()
- Overrides:
shouldHideAddedRows
in classTable
- Returns:
- whether the rows to add (see
Table.getFirstAddedItemIndex()
andTable.getAddedRowCount()
) should be added or hidden. For plain Table it is always false.
Description copied from class: Table
Subclass and override this to enable removing of rows, bypassing the
normal caching and lazy loading mechanism. This is useful for e.g.
TreeTable, when you need to hide certain rows as a node is collapsed.
This should return true if the rows pointed to by
Table.getFirstAddedItemIndex()
and Table.getAddedRowCount()
should
be hidden instead of added.
size
public int size()
- Specified by:
size
in interfaceContainer
- Overrides:
size
in classAbstractSelect
- Returns:
- number of Items in the Container
Description copied from interface: Container
Gets the number of visible Items in the Container. Filtering can hide items so that they will not be visible through the container API.
getContainerDataSource
public Container.Hierarchical getContainerDataSource()
- Specified by:
getContainerDataSource
in interfaceContainer.Viewer
- Overrides:
getContainerDataSource
in classAbstractSelect
- Returns:
- data source Container
- See Also:
Container.Viewer.getContainerDataSource()
Description copied from class: AbstractSelect
Gets the viewing data-source container.
setContainerDataSource
public void setContainerDataSource(Container newDataSource)
- Specified by:
setContainerDataSource
in interfaceContainer.Viewer
- Overrides:
setContainerDataSource
in classTable
- Parameters:
newDataSource
- the new data source.- See Also:
Container.Viewer.setContainerDataSource(Container)
Description copied from class: AbstractSelect
Sets the Container that serves as the data source of the viewer. As a side-effect the fields value (selection) is set to null due old selection not necessary exists in new Container.
containerItemSetChange
public void containerItemSetChange(Container.ItemSetChangeEvent event)
- Specified by:
containerItemSetChange
in interfaceContainer.ItemSetChangeListener
- Overrides:
containerItemSetChange
in classTable
- Parameters:
event
- change event text- See Also:
Container.ItemSetChangeListener.containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent)
Description copied from class: Table
Container datasource item set change. Table must flush its buffers on change.
getIdByIndex
protected Object getIdByIndex(int index)
- Overrides:
getIdByIndex
in classTable
indexOfId
protected int indexOfId(Object itemId)
nextItemId
public Object nextItemId(Object itemId)
- Specified by:
nextItemId
in interfaceContainer.Ordered
- Overrides:
nextItemId
in classTable
- Parameters:
itemId
- ID of a visible Item in the Container- Returns:
- ID of the next visible Item or
null
- See Also:
Container.Ordered.nextItemId(java.lang.Object)
Description copied from class: Table
Gets the ID of the Item following the Item that corresponds to itemId.
lastItemId
public Object lastItemId()
- Specified by:
lastItemId
in interfaceContainer.Ordered
- Overrides:
lastItemId
in classTable
- Returns:
- ID of the last visible Item in the Container
- See Also:
Container.Ordered.lastItemId()
Description copied from class: Table
Gets the ID of the last Item in the Container.
prevItemId
public Object prevItemId(Object itemId)
- Specified by:
prevItemId
in interfaceContainer.Ordered
- Overrides:
prevItemId
in classTable
- Parameters:
itemId
- ID of a visible Item in the Container- Returns:
- ID of the previous visible Item or
null
- See Also:
Container.Ordered.prevItemId(java.lang.Object)
Description copied from class: Table
Gets the ID of the Item preceding the Item that corresponds to the itemId.
isLastId
public boolean isLastId(Object itemId)
- Specified by:
isLastId
in interfaceContainer.Ordered
- Overrides:
isLastId
in classTable
- Returns:
true
if the Item is last visible item in the Container,false
if not- See Also:
Container.Ordered.isLastId(java.lang.Object)
Description copied from class: Table
Tests if the Item corresponding to the given Item ID is the last Item in the Container.
getItemIds
public Collection<?> getItemIds()
- Specified by:
getItemIds
in interfaceContainer
- Overrides:
getItemIds
in classAbstractSelect
- Returns:
- the Collection of item ids.
Description copied from class: AbstractSelect
Gets the item Id collection from the container.
areChildrenAllowed
public boolean areChildrenAllowed(Object itemId)
- Specified by:
areChildrenAllowed
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item in the container whose child capability is to be tested- Returns:
true
if the specified Item exists in the Container and it can have children,false
if it's not found from the container or it can't have children.
Description copied from interface: Container.Hierarchical
Tests if the Item with given ID can have children.
getChildren
public Collection<?> getChildren(Object itemId)
- Specified by:
getChildren
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item whose children the caller is interested in- Returns:
- An unmodifiable
collection
containing the IDs of all other Items that are children in the container hierarchy
Description copied from interface: Container.Hierarchical
Gets the IDs of all Items that are children of the specified Item. The returned collection is unmodifiable.
getParent
public Object getParent(Object itemId)
- Specified by:
getParent
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item whose parent the caller wishes to find out.- Returns:
- the ID of the parent Item. Will be
null
if the specified Item is a root element.
Description copied from interface: Container.Hierarchical
Gets the ID of the parent Item of the specified Item.
hasChildren
public boolean hasChildren(Object itemId)
- Specified by:
hasChildren
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item to be tested- Returns:
true
if the specified Item has children,false
if not (is a leaf)
Description copied from interface: Container.Hierarchical
Tests if the Item specified with itemId
has child Items
or if it is a leaf. The Container.Hierarchical.getChildren(Object itemId)
method
always returns null
for leaf Items.
Note that being a leaf does not imply whether or not an Item is allowed to have children.
.
isRoot
public boolean isRoot(Object itemId)
- Specified by:
isRoot
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item whose root status is to be tested- Returns:
true
if the specified Item is a root,false
if not
Description copied from interface: Container.Hierarchical
Tests if the Item specified with itemId
is a root Item.
The hierarchical container can have more than one root and must have
at least one unless it is empty. The Container.Hierarchical.getParent(Object itemId)
method always returns null
for root Items.
rootItemIds
public Collection<?> rootItemIds()
- Specified by:
rootItemIds
in interfaceContainer.Hierarchical
- Returns:
- An unmodifiable
collection
containing IDs of all root elements of the container
Description copied from interface: Container.Hierarchical
Gets the IDs of all Items in the container that don't have a parent.
Such items are called root
Items. The returned
collection is unmodifiable.
setChildrenAllowed
public boolean setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
throws UnsupportedOperationException
- Specified by:
setChildrenAllowed
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the Item in the container whose child capability is to be setareChildrenAllowed
- boolean value specifying if the Item can have children or not- Returns:
true
if the operation succeeded,false
if not- Throws:
UnsupportedOperationException
Description copied from interface: Container.Hierarchical
Sets the given Item's capability to have children. If the Item
identified with itemId
already has children and
is false this method
fails and Container.Hierarchical.areChildrenAllowed(Object)
false
is returned.
The children must be first explicitly removed with
Container.Hierarchical.setParent(Object itemId, Object newParentId)
or
Container.removeItem(Object itemId)
.
This operation is optional. If it is not implemented, the method
always returns false
.
setParent
public boolean setParent(Object itemId,
Object newParentId)
throws UnsupportedOperationException
- Specified by:
setParent
in interfaceContainer.Hierarchical
- Parameters:
itemId
- ID of the item to be set as the child of the Item identified withnewParentId
newParentId
- ID of the Item that's to be the new parent of the Item identified withitemId
- Returns:
true
if the operation succeeded,false
if not- Throws:
UnsupportedOperationException
Description copied from interface: Container.Hierarchical
Sets the parent of an Item. The new parent item must exist and be
able to have children. (
). It is
also possible to detach a node from the hierarchy (and thus make it
root) by setting the parent Container.Hierarchical.areChildrenAllowed(Object)
== truenull
.
This operation is optional.
setCollapsed
public void setCollapsed(Object itemId,
boolean collapsed)
- Parameters:
itemId
- the identifier of the Itemcollapsed
- true if the Item should be collapsed, false if expanded
Sets the Item specified by given identifier as collapsed or expanded. If the Item is collapsed, its children are not displayed to the user.
isCollapsed
public boolean isCollapsed(Object itemId)
- Parameters:
itemId
- the identifier of the checked Item- Returns:
- true if the Item with given id is collapsed
- See Also:
Collapsible.isCollapsed(Object)
Checks if Item with given identifier is collapsed in the UI.
setHierarchyColumn
public void setHierarchyColumn(Object hierarchyColumnId)
- Parameters:
hierarchyColumnId
-
Explicitly sets the column in which the TreeTable visualizes the hierarchy. If hierarchyColumnId is not set, the hierarchy is visualized in the first visible column.
getHierarchyColumnId
public Object getHierarchyColumnId()
- Returns:
- the identifier of column into which the hierarchy will be visualized or null if the column is not explicitly defined.
addListener
public void addListener(Tree.ExpandListener listener)
- Parameters:
listener
- the Listener to be added.
Adds an expand listener.
removeListener
public void removeListener(Tree.ExpandListener listener)
- Parameters:
listener
- the Listener to be removed.
Removes an expand listener.
fireExpandEvent
protected void fireExpandEvent(Object itemId)
- Parameters:
itemId
- the item id.
Emits an expand event.
addListener
public void addListener(Tree.CollapseListener listener)
- Parameters:
listener
- the Listener to be added.
Adds a collapse listener.
removeListener
public void removeListener(Tree.CollapseListener listener)
- Parameters:
listener
- the Listener to be removed.
Removes a collapse listener.
fireCollapseEvent
protected void fireCollapseEvent(Object itemId)
- Parameters:
itemId
- the item id.
Emits a collapse event.
isAnimationsEnabled
public boolean isAnimationsEnabled()
- Returns:
- true if animations are enabled
setAnimationsEnabled
public void setAnimationsEnabled(boolean animationsEnabled)
- Parameters:
animationsEnabled
- true or false whether to enable animations or not.
Animations can be enabled by passing true to this method. Currently expanding rows slide in from the top and collapsing rows slide out the same way. NOTE! not supported in Internet Explorer 6 or 7.