|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.ui.AbstractComponent | +--org.millstone.base.ui.AbstractField | +--org.millstone.base.ui.Select | +--org.millstone.base.ui.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 inherited from class org.millstone.base.ui.AbstractField |
AbstractField.ReadOnlyStatusChangeEvent, AbstractField.ValueChangeEvent |
Nested classes inherited from class org.millstone.base.data.Container |
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer |
Nested classes inherited from class org.millstone.base.data.Buffered |
Buffered.SourceException |
Nested classes inherited from class org.millstone.base.data.Property |
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeEvent, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Nested classes inherited from class org.millstone.base.ui.Component |
Component.Listener |
Nested classes inherited from class org.millstone.base.terminal.Paintable |
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
Fields inherited from class org.millstone.base.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 org.millstone.base.data.Container |
NULL_ITEM_ID |
Constructor Summary | |
Tree()
Create new empty tree |
|
Tree(java.lang.String caption)
Create new empty tree with caption. |
|
Tree(java.lang.String caption,
Container dataSource)
Create 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)
Add collapse listener |
void |
addListener(Tree.ExpandListener listener)
Add expand listener |
boolean |
areChildrenAllowed(java.lang.Object itemId)
Tests if the Item with given ID can have any children. |
void |
changeVariables(java.lang.Object source,
java.util.Map variables)
Invoked when the value of a variable has changed. |
boolean |
collapseItem(java.lang.Object itemId)
Collapse an item. |
boolean |
collapseItemsRecursively(java.lang.Object startItemId)
Collapse items recursively Collapse all the children recursively starting from an item. |
boolean |
expandItem(java.lang.Object itemId)
Expand an item. |
boolean |
expandItemsRecursively(java.lang.Object startItemId)
Expand items recursively Expands all the children recursively starting from an item. |
protected void |
fireCollapseEvent(java.lang.Object itemId)
Emit collapse event. |
protected void |
fireExpandEvent(java.lang.Object itemId)
Emit expand event. |
void |
focus()
Focusing to this component is not supported. |
java.util.Collection |
getChildren(java.lang.Object itemId)
Gets the IDs of all Items that are children of the specified Item. |
java.lang.Object |
getParent(java.lang.Object itemId)
Gets the ID of the parent Item of the specified Item. |
java.lang.String |
getTag()
Get component UIDL tag. |
java.util.Collection |
getVisibleItemIds()
Get the visible item ids. |
boolean |
hasChildren(java.lang.Object itemId)
Tests if the Item specified with itemId has any
child Items, that is, is it a leaf Item. |
boolean |
isExpanded(java.lang.Object itemId)
Check is an item is expanded |
boolean |
isRoot(java.lang.Object itemId)
Tests if the Item specified with itemId is a root
Item. |
boolean |
isSelectable()
Getter for property selectable. |
void |
paintContent(PaintTarget target)
Paint the content of this component. |
void |
removeActionHandler(Action.Handler actionHandler)
Removes an action handler. |
void |
removeListener(Tree.CollapseListener listener)
Remove collapse listener |
void |
removeListener(Tree.ExpandListener listener)
Remove expand listener |
java.util.Collection |
rootItemIds()
Gets the IDs of all Items in the container that don't have a parent. |
boolean |
setChildrenAllowed(java.lang.Object itemId,
boolean areChildrenAllowed)
Sets the given Item's capability to have children. |
void |
setContainerDataSource(Container newDataSource)
Set the container as data-source for viewing. |
void |
setNewItemsAllowed(boolean allowNewOptions)
Adding new items is not supported. |
boolean |
setParent(java.lang.Object itemId,
java.lang.Object newParentId)
Sets the parent of an Item. |
void |
setSelectable(boolean selectable)
Setter for property selectable. |
Methods inherited from class org.millstone.base.ui.AbstractField |
addListener, addListener, addValidator, commit, constructField, discard, fireReadOnlyStatusChange, fireValueChange, getErrorMessage, getPropertyDataSource, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setWriteThrough, toString, validate, valueChange |
Methods inherited from class org.millstone.base.ui.AbstractComponent |
addListener, addListener, addListener, addListener, attach, childRequestedRepaint, dependsOn, detach, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.millstone.base.data.Container |
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
Constructor Detail |
public Tree()
public Tree(java.lang.String caption)
public Tree(java.lang.String caption, Container dataSource)
Method Detail |
public boolean isExpanded(java.lang.Object itemId)
public boolean expandItem(java.lang.Object itemId)
public boolean expandItemsRecursively(java.lang.Object startItemId)
public boolean collapseItem(java.lang.Object itemId)
public boolean collapseItemsRecursively(java.lang.Object startItemId)
public boolean isSelectable()
The tree is selectable by default.
public void setSelectable(boolean selectable)
The tree is selectable by default.
selectable
- New value of property selectable.public java.lang.String getTag()
Select
getTag
in class Select
AbstractComponent.getTag()
public void changeVariables(java.lang.Object source, java.util.Map variables)
Select
changeVariables
in interface VariableOwner
changeVariables
in class Select
VariableOwner.changeVariables(Object source, Map variables)
public void paintContent(PaintTarget target) throws PaintException
Select
paintContent
in class Select
PaintException
- The paint operation failed.AbstractComponent.paintContent(PaintTarget)
public boolean areChildrenAllowed(java.lang.Object itemId)
Container.Hierarchical
Managed
interface,
the items created with newItem
can have children by
default.
areChildrenAllowed
in interface Container.Hierarchical
itemId
- 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 java.util.Collection getChildren(java.lang.Object itemId)
Container.Hierarchical
getChildren
in interface Container.Hierarchical
itemId
- 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 java.lang.Object getParent(java.lang.Object itemId)
Container.Hierarchical
getParent
in interface Container.Hierarchical
itemId
- 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(java.lang.Object itemId)
Container.Hierarchical
Tests if the Item specified with itemId
has any
child Items, that is, is it a leaf Item. 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.
.
hasChildren
in interface Container.Hierarchical
itemId
- 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(java.lang.Object itemId)
Container.Hierarchical
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.
isRoot
in interface Container.Hierarchical
itemId
- 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 java.util.Collection rootItemIds()
Container.Hierarchical
root
Items. The
returned collection is unmodifiable.
rootItemIds
in interface Container.Hierarchical
collection
containing IDs of all
root elements of the containerContainer.Hierarchical.rootItemIds()
public boolean setChildrenAllowed(java.lang.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.Hierarchical
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
true
if the operation succeeded,
false
if notContainer.Hierarchical.setChildrenAllowed(Object, boolean)
public boolean setParent(java.lang.Object itemId, java.lang.Object newParentId)
Container.Hierarchical
Sets the parent of an Item. The new parent item must exist
and be able to have children.
(canHaveChildren(newParentId) == true
). It is also
possible to detach a node from the hierarchy (and thus make it
root) by setting the parent null
.
This operation is optional.
setParent
in interface Container.Hierarchical
itemId
- ID of the item to be set as the child of the Item
identified with newParentId
newParentId
- 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)
Select
setContainerDataSource
in interface Container.Viewer
setContainerDataSource
in class Select
newDataSource
- The new data source ItemContainer.Viewer.setContainerDataSource(Container)
public void addListener(Tree.ExpandListener listener)
listener
- Listener to be added.public void removeListener(Tree.ExpandListener listener)
listener
- Listener to be removed.protected void fireExpandEvent(java.lang.Object itemId)
public void addListener(Tree.CollapseListener listener)
listener
- Listener to be added.public void removeListener(Tree.CollapseListener listener)
listener
- Listener to be removed.protected void fireCollapseEvent(java.lang.Object itemId)
public void addActionHandler(Action.Handler actionHandler)
Action.Container.addActionHandler(Action.Handler)
public void removeActionHandler(Action.Handler actionHandler)
Action.Container.removeActionHandler(Action.Handler)
public java.util.Collection getVisibleItemIds()
Select
getVisibleItemIds
in class Select
Select.getVisibleItemIds()
public void setNewItemsAllowed(boolean allowNewOptions) throws java.lang.UnsupportedOperationException
setNewItemsAllowed
in class Select
allowNewOptions
- New value of property allowNewOptions.
java.lang.UnsupportedOperationException
- if set to true.Select.setNewItemsAllowed(boolean)
public void focus() throws java.lang.UnsupportedOperationException
focus
in class AbstractField
java.lang.UnsupportedOperationException
- if invoked.AbstractField.focus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |