com.guiseframework.component
Class CardTabControl.CardRepresentationStrategy

java.lang.Object
  extended by com.guiseframework.component.CardTabControl.CardRepresentationStrategy
All Implemented Interfaces:
ListSelectControl.ValueRepresentationStrategy<Component>
Enclosing class:
CardTabControl

public static class CardTabControl.CardRepresentationStrategy
extends java.lang.Object
implements ListSelectControl.ValueRepresentationStrategy<Component>

A value representation strategy for representing cards. A label component will be generated based on the card layout information. The value's ID will be the card component's ID.

Author:
Garret Wilson
See Also:
Label

Constructor Summary
CardTabControl.CardRepresentationStrategy(CardLayout cardLayout)
          Card layout constructor.
 
Method Summary
 Label createComponent(ListSelectModel<Component> model, Component value, int index, boolean selected, boolean focused)
          Creates a component for the given list value.
 CardLayout getCardLayout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardTabControl.CardRepresentationStrategy

public CardTabControl.CardRepresentationStrategy(CardLayout cardLayout)
Card layout constructor.

Parameters:
cardLayout - The card layout containing component layout information.
Throws:
java.lang.NullPointerException - if the given card layout is null.
Method Detail

getCardLayout

public final CardLayout getCardLayout()
Returns:
The card layout containing component layout information.

createComponent

public Label createComponent(ListSelectModel<Component> model,
                             Component value,
                             int index,
                             boolean selected,
                             boolean focused)
Creates a component for the given list value. This implementation returns a label with information from the card layout.

Specified by:
createComponent in interface ListSelectControl.ValueRepresentationStrategy<Component>
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, or null if the provided value is null.


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