to.etc.domui.component.input
Class ComboFixed<T>

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.InputNodeContainer
                  extended by to.etc.domui.dom.html.Select
                      extended by to.etc.domui.component.input.ComboComponentBase<ValueLabelPair<T>,T>
                          extended by to.etc.domui.component.input.ComboFixed<T>
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, IBindable, INodeErrorDelegate, IActionControl, IControl<T>, IDisplayControl<T>, IHasChangeListener, IHasModifiedIndication, IInputNode<T>
Direct Known Subclasses:
ComboFixedClientFilter

public class ComboFixed<T>
extends ComboComponentBase<ValueLabelPair<T>,T>

Simple combobox handling [String, Object] pairs where the string is the presented label value and the Object represents the values selected. Please see UIControlUtil for factory methods that help you to create ComboFixed instances easily.

Author:
Frits Jalvingh Created on Nov 26, 2009

Constructor Summary
ComboFixed()
          Generic constructor.
ComboFixed(java.lang.Class<? extends IComboDataSet<ValueLabelPair<T>>> dataSetClass)
           
ComboFixed(java.lang.Class<? extends IComboDataSet<ValueLabelPair<T>>> set, INodeContentRenderer<ValueLabelPair<T>> r)
           
ComboFixed(IComboDataSet<ValueLabelPair<T>> dataSet)
           
ComboFixed(IListMaker<ValueLabelPair<T>> maker)
           
ComboFixed(java.util.List<ValueLabelPair<T>> in)
          Use the specified list of pairs directly.
 
Method Summary
static
<T> ComboFixed<T>
createCombo(IObjectToStringConverter<T> converter, T... items)
          Create a combo for a manually specified list of objects.
static
<T> ComboFixed<T>
createCombo(T... items)
          Create a combo for a manually specified list of objects.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(java.lang.Class<?> base, java.lang.String property)
          Returns a combo for all of the list-of-value items for the specified property.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(java.lang.Class<?> base, java.lang.String property, T... domainvalues)
          Create a combobox having only the specified enum labels.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(java.lang.Class<T> clz)
          Create a combo for all members of an enum.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(PropertyMetaModel<?> pmm)
          Returns a combo for all of the list-of-value items for the specified property.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(PropertyMetaModel<?> pmm, T... domainvalues)
          Create a combobox having only the specified enum labels.
static
<T extends java.lang.Enum<T>>
ComboFixed<T>
createEnumCombo(T... items)
          Create a combobox having only the specified enum labels.
protected  T listToValue(ValueLabelPair<T> in)
           
 
Methods inherited from class to.etc.domui.component.input.ComboComponentBase
bind, createContent, getContentRenderer, getContentRendererClass, getData, getEmptyOption, getEmptyText, getListMaker, getPropertyMetaModel, getValue, getValueSafe, getValueTransformer, hasError, internalGetCurrentValue, internalOnUserInput, internalSetCurrentValue, isBound, provideData, renderOptionLabel, setContentRenderer, setContentRendererClass, setData, setEmptyOption, setEmptyText, setListMaker, setPropertyMetaModel, setValue, setValueTransformer
 
Methods inherited from class to.etc.domui.dom.html.Select
acceptRequestParameter, addExtraButton, canContain, clearSelected, getOption, getSelectedIndex, getSize, internalSetSelectedIndex, isDisabled, isModified, isMultiple, onAddedToPage, onRemoveFromPage, setDisabled, setModified, setMultiple, setReadOnly, setSelectedIndex, setSize, visit
 
Methods inherited from class to.etc.domui.dom.html.InputNodeContainer
callOnValueChanged, getOnValueChanged, isMandatory, isReadOnly, setMandatory, setOnValueChanged
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, addCssClass, addGlobalMessage, afterCreateContent, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, componentHandleWebAction, findComponentBundle, getActualID, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetTag, isBuilt, isFocusRequested, onBeforeFullRender, onForceRebuild, onHeaderContributors, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setTestID, setTitle, setUserObject, stretchHeight, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface to.etc.domui.dom.html.IControl
getErrorLocation, isDisabled, isMandatory, isReadOnly, setErrorLocation, setMandatory, setReadOnly
 
Methods inherited from interface to.etc.domui.dom.html.IDisplayControl
setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IActionControl
setDisabled, setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IHasChangeListener
getOnValueChanged, setOnValueChanged
 
Methods inherited from interface to.etc.domui.dom.errors.INodeErrorDelegate
clearMessage, getMessage, setMessage
 
Methods inherited from interface to.etc.domui.dom.html.IHasModifiedIndication
isModified, setModified
 

Constructor Detail

ComboFixed

public ComboFixed()
Generic constructor.


ComboFixed

public ComboFixed(java.lang.Class<? extends IComboDataSet<ValueLabelPair<T>>> set,
                  INodeContentRenderer<ValueLabelPair<T>> r)

ComboFixed

public ComboFixed(java.lang.Class<? extends IComboDataSet<ValueLabelPair<T>>> dataSetClass)

ComboFixed

public ComboFixed(IComboDataSet<ValueLabelPair<T>> dataSet)

ComboFixed

public ComboFixed(IListMaker<ValueLabelPair<T>> maker)

ComboFixed

public ComboFixed(java.util.List<ValueLabelPair<T>> in)
Use the specified list of pairs directly.

Parameters:
in -
Method Detail

listToValue

protected T listToValue(ValueLabelPair<T> in)
                 throws java.lang.Exception
Overrides:
listToValue in class ComboComponentBase<ValueLabelPair<T>,T>
Returns:
Throws:
java.lang.Exception

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(java.lang.Class<T> clz)
Create a combo for all members of an enum. It uses the enums labels as description. Since this has no known property it cannot use per-property translations!!

Type Parameters:
T -
Parameters:
clz -
Returns:

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(java.lang.Class<?> base,
                                                                          java.lang.String property)
Returns a combo for all of the list-of-value items for the specified property.

Type Parameters:
T -
Parameters:
base - The class
property - The property on the class.
Returns:

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(PropertyMetaModel<?> pmm)
Returns a combo for all of the list-of-value items for the specified property.

Type Parameters:
T -
Parameters:
pmm -
Returns:

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(T... items)
Create a combobox having only the specified enum labels.

Type Parameters:
T -
Parameters:
items -
Returns:

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(java.lang.Class<?> base,
                                                                          java.lang.String property,
                                                                          T... domainvalues)
Create a combobox having only the specified enum labels.

Type Parameters:
T -
Parameters:
base -
property -
domainvalues -
Returns:

createEnumCombo

public static <T extends java.lang.Enum<T>> ComboFixed<T> createEnumCombo(PropertyMetaModel<?> pmm,
                                                                          T... domainvalues)
Create a combobox having only the specified enum labels.

Type Parameters:
T -
Parameters:
pmm -
domainvalues -
Returns:

createCombo

public static <T> ComboFixed<T> createCombo(T... items)
Create a combo for a manually specified list of objects. It calls toString on them to get a String value.

Type Parameters:
T -
Parameters:
items -
Returns:

createCombo

public static <T> ComboFixed<T> createCombo(@Nonnull
                                            IObjectToStringConverter<T> converter,
                                            T... items)
Create a combo for a manually specified list of objects. Use the specified converter to convert to a string.

Type Parameters:
T -
Parameters:
converter -
items -
Returns: