|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.Identifiable
com.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractField
com.itmill.toolkit.ui.Select
com.itmill.toolkit.ui.Tree
public class Tree
MenuTree component. MenuTree can be used to select an item (or multiple items) from a hierarchical set of items.
| Nested Class Summary | |
|---|---|
class |
Tree.CollapseEvent
Collapse event |
static interface |
Tree.CollapseListener
Collapse event listener. |
class |
Tree.ExpandEvent
Event to fired when a node is expanded. |
static interface |
Tree.ExpandListener
Expand event listener. |
| Nested classes/interfaces inherited from class com.itmill.toolkit.ui.Select |
|---|
Select.OptionsStream |
| Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractField |
|---|
AbstractField.ReadOnlyStatusChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Container |
|---|
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Sortable, Container.Viewer |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field |
|---|
Field.ValueChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered |
|---|
Buffered.SourceException |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.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.itmill.toolkit.ui.Select |
|---|
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.itmill.toolkit.data.Container |
|---|
NULL_ITEM_ID |
| Constructor Summary | |
|---|---|
Tree()
Creates a new empty tree. |
|
Tree(String caption)
Creates a new empty tree with caption. |
|
Tree(String caption,
Container dataSource)
Creates a new tree with caption and connect it to a Container. |
|
| Method Summary | |
|---|---|
void |
addActionHandler(Action.Handler actionHandler)
Adds an action handler. |
void |
addListener(Tree.CollapseListener listener)
Adds the collapse listener. |
void |
addListener(Tree.ExpandListener listener)
Adds the expand listener. |
boolean |
areChildrenAllowed(Object itemId)
Tests if the Item with given ID can have any children. |
void |
changeVariables(Object source,
Map variables)
Called when one or more variables handled by the implementing class are changed. |
boolean |
collapseItem(Object itemId)
Collapses an item. |
boolean |
collapseItemsRecursively(Object startItemId)
Collapses the items recursively. |
boolean |
expandItem(Object itemId)
Expands an item. |
boolean |
expandItemsRecursively(Object startItemId)
Expands the items recursively Expands all the children recursively starting from an item. |
protected void |
fireCollapseEvent(Object itemId)
Emits collapse event. |
protected void |
fireExpandEvent(Object itemId)
Emits the expand event. |
void |
focus()
Focusing to this component is not supported. |
Collection |
getChildren(Object itemId)
Gets the IDs of all Items that are children of the specified Item. |
Object |
getParent(Object itemId)
Gets the ID of the parent Item of the specified Item. |
String |
getTag()
Gets the UIDL tag corresponding to the component. |
Collection |
getVisibleItemIds()
Gets the visible item ids. |
boolean |
hasChildren(Object itemId)
Tests if the Item specified with itemId has any child
Items, that is, is it a leaf Item. |
boolean |
isExpanded(Object itemId)
Check is an item is expanded |
boolean |
isRoot(Object itemId)
Tests if the Item specified with itemId is a root Item. |
boolean |
isSelectable()
Getter for property selectable. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
removeActionHandler(Action.Handler actionHandler)
Removes an action handler. |
void |
removeListener(Tree.CollapseListener listener)
Removes the collapse listener. |
void |
removeListener(Tree.ExpandListener listener)
Removes the expand listener. |
Collection |
rootItemIds()
Gets the IDs of all Items in the container that don't have a parent. |
boolean |
setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
Sets the given Item's capability to have children. |
void |
setContainerDataSource(Container newDataSource)
Sets the Container that serves as the data source of the viewer. |
void |
setLazyLoading(boolean useLazyLoading)
Tree does not support lazy options loading mode. |
void |
setNewItemsAllowed(boolean allowNewOptions)
Adding new items is not supported. |
boolean |
setParent(Object itemId,
Object newParentId)
Sets the parent of an Item. |
void |
setSelectable(boolean selectable)
Setter for property selectable. |
| Methods inherited from class com.itmill.toolkit.ui.AbstractComponent |
|---|
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
| Methods inherited from class com.itmill.toolkit.terminal.Identifiable |
|---|
getDebugId, getUIID, setDebugId, setUIID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.itmill.toolkit.data.Container |
|---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
| Methods inherited from interface com.itmill.toolkit.ui.Field |
|---|
getDescription, setCaption, setDescription |
| Methods inherited from interface com.itmill.toolkit.ui.Component |
|---|
addListener, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isVisible, removeListener, setEnabled, setParent, setStyle, setVisible |
| Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
| Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
|---|
dependsOn, getDirectDependencies, isImmediate, removeDirectDependency |
| Constructor Detail |
|---|
public Tree()
public Tree(String caption)
caption -
public Tree(String caption,
Container dataSource)
caption - dataSource - | Method Detail |
|---|
public boolean isExpanded(Object itemId)
itemId - the item id.
public boolean expandItem(Object itemId)
itemId - the item id.
public boolean expandItemsRecursively(Object startItemId)
startItemId -
public boolean collapseItem(Object itemId)
itemId - the item id.
public boolean collapseItemsRecursively(Object startItemId)
startItemId -
public boolean isSelectable()
The tree is selectable by default.
public void setSelectable(boolean selectable)
The tree is selectable by default.
selectable - the New value of property selectable.public String getTag()
getTag in class SelectAbstractComponent.getTag()
public void changeVariables(Object source,
Map variables)
changeVariables in interface VariableOwnerchangeVariables in class Selectsource - 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.VariableOwner.changeVariables(Object
source, Map variables)
public void paintContent(PaintTarget target)
throws PaintException
paintContent in class Selecttarget - the Paint Event.
PaintException - if the paint operation failed.AbstractComponent.paintContent(PaintTarget)public boolean areChildrenAllowed(Object itemId)
areChildrenAllowed in interface Container.HierarchicalitemId - ID of the Item in the container whose child capability is
to be tested
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.Container.Hierarchical.areChildrenAllowed(Object)public Collection getChildren(Object itemId)
getChildren in interface Container.HierarchicalitemId - ID of the Item whose children the caller is interested in
collection
containing the IDs of all other Items that are children in
the container hierarchyContainer.Hierarchical.getChildren(Object)public Object getParent(Object itemId)
getParent in interface Container.HierarchicalitemId - ID of the Item whose parent the caller wishes to find out.
null if the
specified Item is a root element.Container.Hierarchical.getParent(Object)public boolean hasChildren(Object itemId)
itemId has any child
Items, that is, is it a leaf Item.
hasChildren in interface Container.HierarchicalitemId - ID of the Item whose leaf status is to be tested
true if the specified Item is a leaf,
false if notContainer.Hierarchical.hasChildren(Object)public boolean isRoot(Object itemId)
itemId is a root Item.
isRoot in interface Container.HierarchicalitemId - ID of the Item whose root status is to be tested
true if the specified Item is a root,
false if notContainer.Hierarchical.isRoot(Object)public Collection rootItemIds()
rootItemIds in interface Container.Hierarchicalcollection
containing IDs of all root elements of the containerContainer.Hierarchical.rootItemIds()
public boolean setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
Container.Hierarchical
Sets the given Item's capability to have children. If the Item
identified with itemId already has children and
areChildrenAllowed is false this method fails and
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.
setChildrenAllowed in interface Container.HierarchicalitemId - 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
true if the operation succeeded,
false if not
public boolean setParent(Object itemId,
Object newParentId)
setParent in interface Container.HierarchicalitemId - ID of the item to be set as the child of the Item
identified with newParentIdnewParentId - ID of the Item that's to be the new parent of the Item
identified with itemId
true if the operation succeeded,
false if notContainer.Hierarchical.setParent(Object,
Object)public void setContainerDataSource(Container newDataSource)
setContainerDataSource in interface Container.ViewersetContainerDataSource in class SelectnewDataSource - the new data source.Container.Viewer.setContainerDataSource(Container)public void addListener(Tree.ExpandListener listener)
listener - the Listener to be added.public void removeListener(Tree.ExpandListener listener)
listener - the Listener to be removed.protected void fireExpandEvent(Object itemId)
itemId - the item id.public void addListener(Tree.CollapseListener listener)
listener - the Listener to be added.public void removeListener(Tree.CollapseListener listener)
listener - the Listener to be removed.protected void fireCollapseEvent(Object itemId)
itemId - the item id.public void addActionHandler(Action.Handler actionHandler)
addActionHandler in interface Action.ContaineractionHandler - the new handler to be added.Action.Container.addActionHandler(Action.Handler)public void removeActionHandler(Action.Handler actionHandler)
removeActionHandler in interface Action.ContaineractionHandler - the handler to be removed.Action.Container.removeActionHandler(Action.Handler)public Collection getVisibleItemIds()
getVisibleItemIds in class SelectSelect.getVisibleItemIds()
public void setNewItemsAllowed(boolean allowNewOptions)
throws UnsupportedOperationException
setNewItemsAllowed in class SelectallowNewOptions - the New value of property allowNewOptions.
UnsupportedOperationException - if set to true.Select.setNewItemsAllowed(boolean)
public void focus()
throws UnsupportedOperationException
focus in interface Component.Focusablefocus in class AbstractFieldUnsupportedOperationException - if invoked.AbstractField.focus()public void setLazyLoading(boolean useLazyLoading)
setLazyLoading in class SelectSelect.setLazyLoading(boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||