|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.model.ui.AbstractPresentationModel
com.guiseframework.component.AbstractComponent
com.guiseframework.component.AbstractCompositeComponent
com.guiseframework.component.AbstractMultipleCompositeComponent
com.guiseframework.component.AbstractCompositeStateComponent<T,S>
com.guiseframework.component.AbstractCompositeStateControl<TreeNodeModel<?>,TreeControl.TreeNodeComponentState>
com.guiseframework.component.TreeControl
public class TreeControl
A tree control.
Property change events and action events on one tree node will be repeated to this object's listeners, with the tree node initiating the event accessible via TargetedEvent.getTarget().
| Nested Class Summary | |
|---|---|
static class |
TreeControl.AbstractTreeNodeRepresentationStrategy<V>
An abstract tree node representation strategy. |
static class |
TreeControl.DefaultValueRepresentationStrategy<V>
A default tree node representation strategy. |
static class |
TreeControl.InfoModelTreeNodeRepresentationStrategy
A tree node representation strategy for a label model, generating a label component. |
static class |
TreeControl.TextModelTreeNodeRepresentationStrategy
A tree node representation strategy for a TextModel, generating a TextBox component. |
protected static class |
TreeControl.TreeNodeComponentState
An encapsulation of a component for a tree node along with other metadata, such as whether the component was editable when created. |
static interface |
TreeControl.TreeNodeRepresentationStrategy<V>
A strategy for generating components to represent tree node models. |
protected static class |
TreeControl.TreeNodeTransferable<V>
The transferable object for a tree node. |
| Nested classes/interfaces inherited from class com.guiseframework.component.AbstractCompositeStateComponent |
|---|
AbstractCompositeStateComponent.ComponentState |
| Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent |
|---|
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Control |
|---|
Control.Status |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Field Summary | |
|---|---|
static java.lang.String |
ROOT_NODE_DISPLAYED_PROPERTY
The bound property of whether the root node is displayed. |
static java.lang.String |
TREE_NODE_DRAG_ENABLED_PROPERTY
The bound property of whether the tree node components have dragging enabled. |
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.model.TreeModel |
|---|
ROOT_NODE_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Fields inherited from interface com.guiseframework.component.Control |
|---|
STATUS_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Component |
|---|
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Displayable |
|---|
DISPLAYED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.InfoModel |
|---|
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY |
| Fields inherited from interface com.guiseframework.model.LabelModel |
|---|
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Enableable |
|---|
ENABLED_PROPERTY |
| Constructor Summary | |
|---|---|
TreeControl()
Default constructor with a default tree model. |
|
TreeControl(TreeModel treeModel)
Tree model constructor. |
|
| Method Summary | ||
|---|---|---|
void |
addActionListener(ActionListener actionListener)
Adds an action listener. |
|
protected TreeControl.TreeNodeComponentState |
createComponentState(TreeNodeModel<?> treeNode)
Creates a component state to represent the given object. |
|
protected void |
fireActionPerformed(ActionEvent actionEvent)
Fires a given action event to all registered action listeners. |
|
protected void |
fireActionPerformed(int force,
int option)
Fires an action event to all registered action listeners. |
|
java.lang.Iterable<ActionListener> |
getActionListeners()
|
|
Component |
getComponent(TreeNodeModel<?> treeNode)
Retrieves the component for the given object. |
|
TreeNodeModel<?> |
getRootNode()
|
|
protected TreeModel |
getTreeModel()
|
|
|
getTreeNodeRepresentationStrategy(java.lang.Class<V> valueClass)
Returns the given tree node representation strategy assigned to produce representation components for the given value class. |
|
boolean |
isRootNodeDisplayed()
|
|
boolean |
isTreeNodeDragEnabled()
|
|
void |
performAction()
Performs the action with default force and default option. |
|
void |
performAction(int force,
int option)
Performs the action with the given force and option. |
|
void |
removeActionListener(ActionListener actionListener)
Removes an action listener. |
|
void |
setAllExpanded(boolean newAllExpanded)
Sets whether all tree nodes are expanded. |
|
void |
setRootNode(TreeNodeModel<?> newRootNode)
Sets the root node of the tree model. |
|
void |
setRootNodeDisplayed(boolean newRootNodeDisplayed)
Sets whether the root node is displayed. |
|
void |
setTreeNodeDragEnabled(boolean newTreeNodeDragEnabled)
Sets whether the tree node components have dragging enabled. |
|
|
setTreeNodeRepresentationStrategy(java.lang.Class<V> valueClass,
TreeControl.TreeNodeRepresentationStrategy<? super V> treeNodeRepresentationStrategy)
Installs the given tree node representation strategy to produce representation components for the given value class. |
|
| Methods inherited from class com.guiseframework.component.AbstractCompositeStateControl |
|---|
determineStatus, getEnableable, getStatus, isEnabled, reset, setEnabled, setNotification, setStatus, updateStatus, updateValid |
| Methods inherited from class com.guiseframework.component.AbstractCompositeStateComponent |
|---|
clearComponentStates, determineComponentState, getComponentState, getComponentStates, getObject, putComponentState, removeComponentState |
| Methods inherited from class com.guiseframework.component.AbstractMultipleCompositeComponent |
|---|
addComponent, getChildComponents, hasChildComponents, removeComponent |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
depict, getDepictID, getSession, processEvent |
| Methods inherited from interface com.guiseframework.model.InfoModel |
|---|
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType |
| Methods inherited from interface com.guiseframework.model.LabelModel |
|---|
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType |
| Field Detail |
|---|
public static final java.lang.String ROOT_NODE_DISPLAYED_PROPERTY
public static final java.lang.String TREE_NODE_DRAG_ENABLED_PROPERTY
| Constructor Detail |
|---|
public TreeControl()
public TreeControl(TreeModel treeModel)
treeModel - The component tree model.
java.lang.NullPointerException - if the given tree model is null.| Method Detail |
|---|
protected TreeModel getTreeModel()
public boolean isTreeNodeDragEnabled()
public void setTreeNodeDragEnabled(boolean newTreeNodeDragEnabled)
Boolean.
newTreeNodeDragEnabled - true if each tree node component should allow dragging, else false.TREE_NODE_DRAG_ENABLED_PROPERTYpublic boolean isRootNodeDisplayed()
AbstractPresentationModel.isDisplayed()public void setRootNodeDisplayed(boolean newRootNodeDisplayed)
Boolean.
If the root is requested not to be displayed, the root is automatically expanded.
newRootNodeDisplayed - true if the root node should be displayed, else false.ROOT_NODE_DISPLAYED_PROPERTY,
TreeNodeModel.setExpanded(boolean)
public <V> TreeControl.TreeNodeRepresentationStrategy<? super V> setTreeNodeRepresentationStrategy(java.lang.Class<V> valueClass,
TreeControl.TreeNodeRepresentationStrategy<? super V> treeNodeRepresentationStrategy)
V - The type of value to represent.valueClass - The class of value with which the strategy should be associated.treeNodeRepresentationStrategy - The strategy for generating components to represent values of the given type.
public <V> TreeControl.TreeNodeRepresentationStrategy<? super V> getTreeNodeRepresentationStrategy(java.lang.Class<V> valueClass)
V - The type of value to represent.valueClass - The class of value with which the strategy should be associated.
null if there is no associated representation strategy.TreeControl.DefaultValueRepresentationStrategypublic Component getComponent(TreeNodeModel<?> treeNode)
getComponent in class AbstractCompositeStateComponent<TreeNodeModel<?>,TreeControl.TreeNodeComponentState>treeNode - The object for which a representation component should be returned.
java.lang.IllegalArgumentException - if the given object is not an appropriate object for a component to be created.protected TreeControl.TreeNodeComponentState createComponentState(TreeNodeModel<?> treeNode)
createTypedComponentState(TreeNodeModel).
createComponentState in class AbstractCompositeStateComponent<TreeNodeModel<?>,TreeControl.TreeNodeComponentState>object - The object with which the component state is to be associated.
java.lang.IllegalArgumentException - if the given object is not an appropriate object for a component state to be created.public TreeNodeModel<?> getRootNode()
getRootNode in interface TreeModelpublic void setRootNode(TreeNodeModel<?> newRootNode)
setRootNode in interface TreeModelnewRootNode - The new root node of the tree model.
java.lang.NullPointerException - if the given root node is null.TreeModel.ROOT_NODE_PROPERTYpublic void setAllExpanded(boolean newAllExpanded)
setAllExpanded in interface TreeModelnewAllExpanded - true if all the nodes should be expanded, or false if they should be collapsed.public void addActionListener(ActionListener actionListener)
addActionListener in interface ActionListenableactionListener - The action listener to add.public void removeActionListener(ActionListener actionListener)
removeActionListener in interface ActionListenableactionListener - The action listener to remove.public java.lang.Iterable<ActionListener> getActionListeners()
getActionListeners in interface ActionModelpublic void performAction()
ActionEvent is fired to all registered ActionListeners.
This method delegates to performAction(int, int).
performAction in interface ActionModel
public void performAction(int force,
int option)
ActionEvent is fired to all registered ActionListeners.
performAction in interface ActionModelforce - The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.option - The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiaged by a mouse right button click.
protected void fireActionPerformed(int force,
int option)
fireActionPerformed(ActionEvent).
force - The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.option - The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiaged by a mouse right button click.ActionListener,
ActionEventprotected void fireActionPerformed(ActionEvent actionEvent)
actionEvent - The action event to fire.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||