com.guiseframework.model.urf
Class URFResourceDynamicTreeNodeModel<V extends com.globalmentor.urf.URFResource>

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.model.AbstractModel
          extended by com.guiseframework.model.AbstractValueModel<V>
              extended by com.guiseframework.model.DefaultValueModel<V>
                  extended by com.guiseframework.model.DefaultTreeNodeModel<V>
                      extended by com.guiseframework.model.DynamicTreeNodeModel<V>
                          extended by com.guiseframework.model.urf.AbstractURFDynamicTreeNodeModel<V>
                              extended by com.guiseframework.model.urf.URFResourceDynamicTreeNodeModel<V>
Type Parameters:
V - The type of value contained in the tree node.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, ActionListenable, ActionModel, Model, Selectable, TreeNodeModel<V>, Valued<V>, ValueModel<V>, java.lang.Iterable<TreeNodeModel<?>>

public class URFResourceDynamicTreeNodeModel<V extends com.globalmentor.urf.URFResource>
extends AbstractURFDynamicTreeNodeModel<V>

A dynamic tree node model that represents an URF resource.

Any properties will be dynamically loaded

This class has special support for URF lists and sets, the contents of which are by default displayed as children of the given resource.

Author:
Garret Wilson

Field Summary
static java.lang.String RESOURCE_CHILDREN_INCLUDED_PROPERTY
          The bound property of whether resource children are included in the node.
static java.lang.String RESOURCE_PROPERTIES_INCLUDED_PROPERTY
          The bound property of whether resource properties are included in the node.
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Fields inherited from interface com.guiseframework.model.TreeNodeModel
EXPANDED_PROPERTY
 
Fields inherited from interface com.guiseframework.model.ValueModel
VALIDATOR_PROPERTY, VALUE_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.model.Selectable
SELECTED_PROPERTY
 
Constructor Summary
URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass)
          Value class constructor with no initial value.
URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass, java.net.URI propertyURI, V initialValue)
          Property and initial value constructor.
URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass, V initialValue)
          Initial value constructor.
 
Method Summary
protected  java.util.List<TreeNodeModel<?>> determineChildren()
          Dynamically determines children.
protected  boolean determineLeaf()
          Dynamically determines whether this node is a leaf.
 java.net.URI getPropertyURI()
           
 boolean isResourceChildrenIncluded()
           
 boolean isResourcePropertiesIncluded()
           
 void setResourceChildrenIncluded(boolean newChildrenIncluded)
          Sets whether resource children are included in the node.
 void setResourcePropertiesIncluded(boolean newPropertiesIncluded)
          Sets whether resource properties are included in the node.
 
Methods inherited from class com.guiseframework.model.urf.AbstractURFDynamicTreeNodeModel
createURFResourceTreeNode
 
Methods inherited from class com.guiseframework.model.DynamicTreeNodeModel
clear, isLeaf, setExpanded
 
Methods inherited from class com.guiseframework.model.DefaultTreeNodeModel
add, addActionListener, fireActionPerformed, fireActionPerformed, getActionListeners, getChildren, getDepth, getParent, getTreeNodeList, hasChild, hasChildren, isExpanded, isSelected, iterator, performAction, performAction, remove, removeActionListener, setAllExpanded, setChildren, setParent, setSelected
 
Methods inherited from class com.guiseframework.model.DefaultValueModel
clearValue, getDefaultValue, getValue, resetValue, setValue
 
Methods inherited from class com.guiseframework.model.AbstractValueModel
createPropertyVetoException, getValidator, getValueClass, isValidValue, setValidator, validateValue
 
Methods inherited from class com.guiseframework.model.AbstractModel
getEventListenerManager, getPlainText
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.model.ValueModel
clearValue, getDefaultValue, getValidator, getValue, getValueClass, isValidValue, resetValue, setValidator, setValue, validateValue
 
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
 

Field Detail

RESOURCE_CHILDREN_INCLUDED_PROPERTY

public static final java.lang.String RESOURCE_CHILDREN_INCLUDED_PROPERTY
The bound property of whether resource children are included in the node.


RESOURCE_PROPERTIES_INCLUDED_PROPERTY

public static final java.lang.String RESOURCE_PROPERTIES_INCLUDED_PROPERTY
The bound property of whether resource properties are included in the node.

Constructor Detail

URFResourceDynamicTreeNodeModel

public URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass)
Value class constructor with no initial value.

Parameters:
valueClass - The class indicating the type of value held in the model.

URFResourceDynamicTreeNodeModel

public URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass,
                                       V initialValue)
Initial value constructor.

Parameters:
valueClass - The class indicating the type of value held in the model.
initialValue - The initial value, which will not be validated.

URFResourceDynamicTreeNodeModel

public URFResourceDynamicTreeNodeModel(java.lang.Class<V> valueClass,
                                       java.net.URI propertyURI,
                                       V initialValue)
Property and initial value constructor.

Parameters:
valueClass - The class indicating the type of value held in the model.
propertyURI - The URI of the URF property of which this URF resource is an object, or null if this resource should not be considered the object of any property.
initialValue - The initial value, which will not be validated.
Method Detail

getPropertyURI

public java.net.URI getPropertyURI()
Returns:
The URI of the URF property of which this URF resource is an object, or null if this resource should not be considered the object of any property.

isResourceChildrenIncluded

public boolean isResourceChildrenIncluded()
Returns:
Whether resource children are included in the node.

setResourceChildrenIncluded

public void setResourceChildrenIncluded(boolean newChildrenIncluded)
Sets whether resource children are included in the node. This is a bound property of type Boolean.

Parameters:
newChildrenIncluded - true if resource children should be included as children of this node.
See Also:
RESOURCE_CHILDREN_INCLUDED_PROPERTY

isResourcePropertiesIncluded

public boolean isResourcePropertiesIncluded()
Returns:
Whether resource properties are included in the node.

setResourcePropertiesIncluded

public void setResourcePropertiesIncluded(boolean newPropertiesIncluded)
Sets whether resource properties are included in the node. This is a bound property of type Boolean.

Parameters:
newPropertiesIncluded - true if resource properties should be included as children of this node.
See Also:
RESOURCE_PROPERTIES_INCLUDED_PROPERTY

determineLeaf

protected boolean determineLeaf()
Dynamically determines whether this node is a leaf. This version determines if resource properties are included and there are properties, or if resource children are included and there are children. This version ignores URF type properties and properties of a URFCollectionResource.

Specified by:
determineLeaf in class DynamicTreeNodeModel<V extends com.globalmentor.urf.URFResource>
Returns:
Whether this node should be considered a leaf with no children.

determineChildren

protected java.util.List<TreeNodeModel<?>> determineChildren()
Dynamically determines children. This version ignores URF type properties and properties of an URFCollectionResource.

Specified by:
determineChildren in class DynamicTreeNodeModel<V extends com.globalmentor.urf.URFResource>
Returns:
The dynamically loaded list of children.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.