com.guiseframework.component.urf
Class AbstractURFResourceTreeNodeRepresentationStrategy<V extends com.globalmentor.urf.URFResource>

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

public abstract class AbstractURFResourceTreeNodeRepresentationStrategy<V extends com.globalmentor.urf.URFResource>
extends TreeControl.AbstractTreeNodeRepresentationStrategy<V>

An abstract tree node representation strategy representing an URF resource.

Author:
Garret Wilson

Constructor Summary
AbstractURFResourceTreeNodeRepresentationStrategy(com.globalmentor.urf.TURFNamespaceLabelManager namespaceLabelManager)
          Namespace label manager constructor.
 
Method Summary
protected
<N extends V>
java.lang.StringBuilder
buildLabelText(java.lang.StringBuilder stringBuilder, TreeControl treeControl, TreeModel model, TreeNodeModel<N> treeNode, N 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.urf.TURFNamespaceLabelManager getNamespaceLabelManager()
           
protected  boolean isResourceReferenceIncluded()
           
protected  boolean isResourceTypeIncluded()
           
protected  void setResourceReferenceURIIncluded(boolean referenceIncluded)
          Sets whether the resource reference should be included.
protected  void setResourceTypeIncluded(boolean resourceTypeIncluded)
          Sets whether the resource type should be included.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractURFResourceTreeNodeRepresentationStrategy

public AbstractURFResourceTreeNodeRepresentationStrategy(com.globalmentor.urf.TURFNamespaceLabelManager namespaceLabelManager)
Namespace label manager constructor.

Parameters:
namespaceLabelManager - The manager responsible for generating namespace labels..
Throws:
java.lang.NullPointerException - if the given label manager is null.
Method Detail

getNamespaceLabelManager

public com.globalmentor.urf.TURFNamespaceLabelManager getNamespaceLabelManager()
Returns:
The manager responsible for generating namespace labels.

isResourceReferenceIncluded

protected boolean isResourceReferenceIncluded()
Returns:
Whether the resource reference should be included.

setResourceReferenceURIIncluded

protected void setResourceReferenceURIIncluded(boolean referenceIncluded)
Sets whether the resource reference should be included.

Parameters:
referenceIncluded - Whether the resource reference should be included.

isResourceTypeIncluded

protected boolean isResourceTypeIncluded()
Returns:
Whether the resource type should be included.

setResourceTypeIncluded

protected void setResourceTypeIncluded(boolean resourceTypeIncluded)
Sets whether the resource type should be included.

Parameters:
resourceTypeIncluded - Whether the resource type should be included.

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 URF resource.

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 <N extends V> java.lang.StringBuilder buildLabelText(java.lang.StringBuilder stringBuilder,
                                                               TreeControl treeControl,
                                                               TreeModel model,
                                                               TreeNodeModel<N> treeNode,
                                                               N value)
Builds the label to be used for a tree node. This version appends information about the resource.

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.