com.guiseframework.component
Class AbstractListSelectControl.DefaultValueRepresentationStrategy<VV>

java.lang.Object
  extended by com.guiseframework.component.AbstractListSelectControl.ConverterInfoModelValueRepresentationStrategy<VV>
      extended by com.guiseframework.component.AbstractListSelectControl.DefaultValueRepresentationStrategy<VV>
Type Parameters:
VV - The type of value the strategy is to represent.
All Implemented Interfaces:
ListSelectControl.ValueRepresentationStrategy<VV>
Enclosing class:
AbstractListSelectControl<V>

public static class AbstractListSelectControl.DefaultValueRepresentationStrategy<VV>
extends AbstractListSelectControl.ConverterInfoModelValueRepresentationStrategy<VV>

A default list select value representation strategy that creates a Label. A label component will be generated containing the default string representation of a value.

Author:
Garret Wilson
See Also:
Label

Constructor Summary
AbstractListSelectControl.DefaultValueRepresentationStrategy(java.lang.Class<VV> valueClass)
          Value class constructor with a default converter.
AbstractListSelectControl.DefaultValueRepresentationStrategy(Converter<VV,java.lang.String> converter)
          Converter constructor.
 
Method Summary
 Label createComponent(ListSelectModel<VV> model, VV value, int index, boolean selected, boolean focused)
          Creates a component for the given list value.
 
Methods inherited from class com.guiseframework.component.AbstractListSelectControl.ConverterInfoModelValueRepresentationStrategy
getConverter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractListSelectControl.DefaultValueRepresentationStrategy

public AbstractListSelectControl.DefaultValueRepresentationStrategy(java.lang.Class<VV> valueClass)
Value class constructor with a default converter. This implementation uses a DefaultStringLiteralConverter.

Parameters:
valueClass - The class indicating the type of value to convert.
Throws:
java.lang.NullPointerException - if the given value class is null.

AbstractListSelectControl.DefaultValueRepresentationStrategy

public AbstractListSelectControl.DefaultValueRepresentationStrategy(Converter<VV,java.lang.String> converter)
Converter constructor.

Parameters:
converter - The converter to use for displaying the value as a string.
Throws:
java.lang.NullPointerException - if the given converter is null.
Method Detail

createComponent

public Label createComponent(ListSelectModel<VV> model,
                             VV value,
                             int index,
                             boolean selected,
                             boolean focused)
Creates a component for the given list value. This version uses covariant types to specify that a Label is returned.

Specified by:
createComponent in interface ListSelectControl.ValueRepresentationStrategy<VV>
Overrides:
createComponent in class AbstractListSelectControl.ConverterInfoModelValueRepresentationStrategy<VV>
Parameters:
model - The model containing the value.
value - The value for which a component should be created.
index - The index of the value within the list, or -1 if the value is not in the list (e.g. for representing no selection).
selected - true if the value is selected.
focused - true if the value has the focus.
Returns:
A new component to represent the given value.
See Also:
AbstractListSelectControl.ConverterInfoModelValueRepresentationStrategy.getConverter()


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