com.guiseframework.component.rdf
Class AbstractRDFObjectTreeNodeRepresentationStrategy<V extends com.globalmentor.rdf.RDFObject>

java.lang.Object
  extended by com.guiseframework.component.TreeControl.AbstractTreeNodeRepresentationStrategy<V>
      extended by com.guiseframework.component.rdf.AbstractRDFObjectTreeNodeRepresentationStrategy<V>
Type Parameters:
V - The type of value the strategy is to represent.
All Implemented Interfaces:
TreeControl.TreeNodeRepresentationStrategy<V>
Direct Known Subclasses:
AbstractRDFResourceTreeNodeRepresentationStrategy, RDFLiteralTreeNodeRepresentationStrategy

public abstract class AbstractRDFObjectTreeNodeRepresentationStrategy<V extends com.globalmentor.rdf.RDFObject>
extends TreeControl.AbstractTreeNodeRepresentationStrategy<V>

An abstract tree node representation strategy representing an RDF object.

Author:
Garret Wilson

Constructor Summary
AbstractRDFObjectTreeNodeRepresentationStrategy(com.globalmentor.rdf.RDFXMLGenerator rdfXMLifier)
          RDF XMLifier constructor.
 
Method Summary
protected  java.lang.StringBuilder buildLabelText(java.lang.StringBuilder stringBuilder, TreeControl treeControl, TreeModel model, TreeNodeModel<? extends V> treeNode, V value)
          Builds the label to be used for a tree node.
<N extends V>
Label
createComponent(TreeControl treeControl, TreeModel model, TreeNodeModel<N> treeNode, boolean editable, boolean selected, boolean focused)
          Creates a component to represent the given tree node.
protected
<N extends V>
InfoModel
createInfoModel(TreeControl treeControl, TreeModel model, TreeNodeModel<N> treeNode)
          Creates an info model for the representation label.
 com.globalmentor.rdf.RDFXMLGenerator getXMLGenerator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRDFObjectTreeNodeRepresentationStrategy

public AbstractRDFObjectTreeNodeRepresentationStrategy(com.globalmentor.rdf.RDFXMLGenerator rdfXMLifier)
RDF XMLifier constructor.

Parameters:
rdfXMLifier - The RDF XMLifier to use for creating labels.
Throws:
java.lang.NullPointerException - if the given RDF XMLifier is null.
Method Detail

getXMLGenerator

public com.globalmentor.rdf.RDFXMLGenerator getXMLGenerator()
Returns:
The RDF XMLifier to use for creating labels.

createComponent

public <N extends V> Label createComponent(TreeControl treeControl,
                                           TreeModel model,
                                           TreeNodeModel<N> treeNode,
                                           boolean editable,
                                           boolean selected,
                                           boolean focused)
Creates a component to represent the given tree node. This implementation returns a label with an appropriate string value to represent the RDF object.

Type Parameters:
N - The type of value contained in the node.
Parameters:
treeControl - The component containing the model.
model - The model containing the value.
treeNode - The node containing the value.
editable - Whether values in this column are editable.
selected - true if the value is selected.
focused - true if the value has the focus.
Returns:
A new component to represent the given value.

createInfoModel

protected <N extends V> InfoModel createInfoModel(TreeControl treeControl,
                                                  TreeModel model,
                                                  TreeNodeModel<N> treeNode)
Creates an info model for the representation label.

Type Parameters:
N - The type of value contained in the node.
Parameters:
treeControl - The component containing the model.
model - The model containing the value.
treeNode - The node containing the value.
Returns:
The label model to use for the label.

buildLabelText

protected java.lang.StringBuilder buildLabelText(java.lang.StringBuilder stringBuilder,
                                                 TreeControl treeControl,
                                                 TreeModel model,
                                                 TreeNodeModel<? extends V> treeNode,
                                                 V value)
Builds the label to be used for a tree node. If the tree node is an RDFObjectTreeNodeModel, this version prepends a representation of its property.

Type Parameters:
N - The type of value contained in the node.
Parameters:
stringBuilder - The string builder to hold the label text.
treeControl - The component containing the model.
model - The model containing the value.
treeNode - The node containing the value.
value - The value contained in the node.
Returns:
The string builder used to construct the label.


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