com.guiseframework.model.rdf
Class AbstractRDFResourceTreeNodeModel<V extends com.globalmentor.rdf.RDFResource>

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.rdf.AbstractRDFResourceTreeNodeModel<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, RDFObjectTreeNodeModel<V>, Selectable, TreeNodeModel<V>, Valued<V>, ValueModel<V>, java.lang.Iterable<TreeNodeModel<?>>
Direct Known Subclasses:
RDFResourceTreeNodeModel

public abstract class AbstractRDFResourceTreeNodeModel<V extends com.globalmentor.rdf.RDFResource>
extends DynamicTreeNodeModel<V>
implements RDFObjectTreeNodeModel<V>

Abstract functionality for a tree node model that represents an RDF resource.

Any properties will be dynamically loaded

This class has special support for RDF lists, 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
AbstractRDFResourceTreeNodeModel(java.lang.Class<V> valueClass)
          Value class constructor with no initial value.
AbstractRDFResourceTreeNodeModel(java.lang.Class<V> valueClass, com.globalmentor.rdf.RDFResource rdfProperty, V initialValue)
          Property and initial value constructor.
AbstractRDFResourceTreeNodeModel(java.lang.Class<V> valueClass, V initialValue)
          Initial value constructor.
 
Method Summary
protected  RDFLiteralTreeNodeModel createRDFLiteralTreeNode(com.globalmentor.rdf.RDFResource rdfProperty, com.globalmentor.rdf.RDFLiteral rdfLiteral)
          Creates a child node to represent a property object literal and optional property.
protected  AbstractRDFResourceTreeNodeModel createRDFResourceTreeNode(com.globalmentor.rdf.RDFResource rdfProperty, com.globalmentor.rdf.RDFResource rdfResource)
          Creates a child node to represent a property object resource and optional property.
protected  java.util.List<TreeNodeModel<?>> determineChildren()
          Dynamically determines children.
protected  boolean determineLeaf()
          Dynamically determines whether this node is a leaf.
 com.globalmentor.rdf.RDFResource getProperty()
           
 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.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.TreeNodeModel
add, clear, getDepth, getParent, hasChild, hasChildren, isExpanded, isLeaf, remove, setAllExpanded, setExpanded, setParent
 
Methods inherited from interface com.guiseframework.model.ActionModel
getActionListeners, performAction, performAction
 
Methods inherited from interface com.guiseframework.event.ActionListenable
addActionListener, removeActionListener
 
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
 
Methods inherited from interface com.guiseframework.model.Selectable
isSelected, setSelected
 
Methods inherited from interface java.lang.Iterable
iterator
 

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

AbstractRDFResourceTreeNodeModel

public AbstractRDFResourceTreeNodeModel(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.

AbstractRDFResourceTreeNodeModel

public AbstractRDFResourceTreeNodeModel(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.

AbstractRDFResourceTreeNodeModel

public AbstractRDFResourceTreeNodeModel(java.lang.Class<V> valueClass,
                                        com.globalmentor.rdf.RDFResource rdfProperty,
                                        V initialValue)
Property and initial value constructor.

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

getProperty

public com.globalmentor.rdf.RDFResource getProperty()
Specified by:
getProperty in interface RDFObjectTreeNodeModel<V extends com.globalmentor.rdf.RDFResource>
Returns:
The RDF property of which this RDF object is an object, or null if this object 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 RDF type properties and properties of an RDFListResource.

Specified by:
determineLeaf in class DynamicTreeNodeModel<V extends com.globalmentor.rdf.RDFResource>
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 RDF type properties and properties of an RDFListResource.

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

createRDFLiteralTreeNode

protected RDFLiteralTreeNodeModel createRDFLiteralTreeNode(com.globalmentor.rdf.RDFResource rdfProperty,
                                                           com.globalmentor.rdf.RDFLiteral rdfLiteral)
Creates a child node to represent a property object literal and optional property. This version returns an RDFLiteralTreeNodeModel.

Parameters:
rdfProperty - The property of which the object is a resource, or null if this object should not be considered the object of any property.
rdfLiteral - The literal to represent in the new node.
Returns:
A child node to represent the given property object literal.

createRDFResourceTreeNode

protected AbstractRDFResourceTreeNodeModel createRDFResourceTreeNode(com.globalmentor.rdf.RDFResource rdfProperty,
                                                                     com.globalmentor.rdf.RDFResource rdfResource)
Creates a child node to represent a property object resource and optional property. This version returns an RDFResourceTreeNodeModel.

Parameters:
rdfProperty - The property of which the object is a resource, or null if this object should not be considered the object of any property.
rdfResource - The resource to represent in the new node.
Returns:
A child node to represent the given property object resource.


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