public class DropDownPicker<T> extends SmallImgButton implements IControl<T>
SmallImgButton that has built in click handler that popups select list with predefined data to choose from.| Modifier and Type | Class and Description |
|---|---|
static class |
DropDownPicker.HAlign |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_COMBO_SIZE |
| Constructor and Description |
|---|
DropDownPicker()
DropDownPicker constructor.
|
DropDownPicker(List<T> data)
DropDownPicker constructor.
|
DropDownPicker(List<T> data,
int size)
DropDownPicker constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createContent() |
NodeBase |
getAlignmentBase()
see
m_alignmentBase |
DropDownPicker.HAlign |
getHalign()
Horizontal alignment of dropdown popup.
|
int |
getOffsetX()
Returns custom offset x relative to picker btn.
|
int |
getOffsetY()
Returns custom offset y relative to
getAlignmentBase() control. |
INotifyEvent<DropDownPicker<T>,ComboLookup<T>> |
getOnBeforeShow() |
IValueChanged<DropDownPicker<T>> |
getOnValueChanged() |
Select |
getSelectControl() |
int |
getSize()
Returns size of drop down list.
|
T |
getValue()
Returns the current value of this input component.
|
T |
getValueSafe()
Like
IControl.getValue() this returns the value of the component, but this returns null
if the value was invalid. |
boolean |
hasData() |
boolean |
isMandatory()
Returns T if this control is a mandatory input.
|
boolean |
isReadOnly()
Returns T if the control is currently in readonly mode.
|
void |
setAlignmentBase(NodeBase halignmentBase)
see
m_alignmentBase |
void |
setData(List<T> data) |
void |
setHalign(DropDownPicker.HAlign halign)
Sets picker select list horizontal alignment.
|
void |
setMandatory(boolean mandatory)
Make the control mandatory.
|
void |
setOffsetX(int offsetX)
Specify custom offset x relative to picker btn.
|
void |
setOffsetY(int offsetY)
Specify custom offset y relative to picker btn.
|
void |
setOnBeforeShow(INotifyEvent<DropDownPicker<T>,ComboLookup<T>> onBeforeShow) |
void |
setOnValueChanged(IValueChanged<?> onValueChanged) |
void |
setReadOnly(boolean ro)
Sets the input to readonly-mode.
|
void |
setSize(int size) |
void |
setValue(T value)
Set a new value into this control.
|
getComponentInfo, getSrc, setSrcgetAccessKey, getButtonValue, getDisabledBecause, getType, isDisabled, setAccessKey, setButtonValue, setDisabled, setDisabled, setDisabledBecause, setType, visitadd, add, add, addTable, addTableForLayout, addTableForLayout, appendTreeErrors, canContain, createFrame, delegateTo, disableAllChildControlsDeep, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChildren, getDelegate, getErrorFence, getTextContents, hasError, internalAdd, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalCreateFrame, internalGetNodeCount, internalGetOldChildren, internalOnBeforeRender, internalShelve, internalUnshelve, iterator, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setErrorFence, setErrorFence, setText, setValue, undelegatedAdd, undelegatedGetChild$, acceptRequestParameter, addBinding, addCssClass, addGlobalMessage, addNotificationListener, afterCreateContent, alignToLeft, alignToLeft, alignToMiddle, alignToMiddle, alignTopToBottom, alignTopToBottom, alignToRight, alignToRight, alignToTop, alignToTop, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, appendJQuerySelector, appendJsCustomUpdatesContributor, appendShowOverflowTextAsTitleJs, appendStatement, beforeCreateContent, bind, bind, bindErrors, build, calcTestID, changed, changedJavascriptState, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, clearValidationFailure, componentHandleWebAction, componentHandleWebDataRequest, createStatement, findComponentBundle, findParent, getActualID, getAllocationTracepoint, getBindingErrors, getBindingList, getBrowserWindowSize, getCalculatedTestID, getClicked, getClientBounds, getComponentBundle, getComponentDataURL, getComponentDataURL, getComponentJSONURL, getCreateJS, getCssClass, getErrorList, getErrorLocation, getFocusID, getMessage, getOnClickJS, getOnMouseDownJS, getOnSizeAndPositionChange, getPage, getParent, getParent, getParent, getParentOfTypes, getSharedContext, getSharedContextFactory, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTestRepeatId, getThemedResourceRURL, getTitle, getUserObject, handleDrop, hasCssClass, hasParent, internalGetOldParent, internalGetParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalOnValueChanged, internalRenderJavascriptDelta, internalRenderJavascriptState, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetLogAllocations, internalSetTag, isAttached, isBuilt, isFocusable, isFocusRequested, isRendersOwnClose, isStretchHeight, lc, notify, notifyParentOrOpenerPage, onAddedToPage, onBeforeFullRender, onBeforeRender, onForceRebuild, onHeaderContributors, onRemoveFromPage, onShelve, onUnshelve, refresh, remove, removeBinding, removeCssClass, renderJavascriptDelta, renderJavascriptState, renderJavascriptState, replaceWith, setBrowserWindowSize, setCalculcatedId, setCalculcatedId, setClicked, setClientBounds, setComponentBundle, setCssClass, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setOnSizeAndPositionChange, setOverrideTitle, setSpecialAttribute, setStretchHeight, setTestID, setTestRepeatID, setTitle, setUserObject, toStringgetBackgroundAttachment, 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, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, 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, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndexclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetErrorLocation, hasError, isDisabled, setErrorLocationsetDisabled, setTestIDclearMessage, getMessage, setMessageforEach, spliteratorpublic static final int DEFAULT_COMBO_SIZE
public DropDownPicker()
public DropDownPicker(@Nonnull List<T> data)
data - data for picker popuppublic void createContent()
throws Exception
createContent in class SmallImgButtonExceptionpublic int getSize()
public void setSize(int size)
public int getOffsetX()
public void setOffsetX(int offsetX)
getAlignmentBase() control.offsetX - public int getOffsetY()
getAlignmentBase() control. To set horizontal alignment rule see setHalign(HAlign).public void setOffsetY(int offsetY)
offsetX - public void setValue(@Nullable T value)
IControl@Nullable public T getValue()
IControlValidationException. This means that this
call either delivers correct input (as defined by it's converter and validators), null
(when empty) or throws an exception. When a ValidationException occurs the framework
mostly ignores it - it does not produce a stacktrace or error in the client. Instead
the resulting error as posted by the error handling framework gets displayed on the
form when the request completes.
To get the value of a component while ignoring exceptions call IControl.getValueSafe().
@Nullable public INotifyEvent<DropDownPicker<T>,ComboLookup<T>> getOnBeforeShow()
public void setOnBeforeShow(@Nullable INotifyEvent<DropDownPicker<T>,ComboLookup<T>> onBeforeShow)
public boolean isMandatory()
IControlisMandatory in interface IControl<T>public void setMandatory(boolean mandatory)
IControlsetMandatory in interface IControl<T>@Nonnull public DropDownPicker.HAlign getHalign()
HAlign#Left.public void setHalign(@Nonnull DropDownPicker.HAlign halign)
DropDownPicker.HAlign.LEFT position list to be left aligned with getAlignmentBase() component.DropDownPicker.HAlign.MIDDLE position list to be center aligned with getAlignmentBase() component.DropDownPicker.HAlign.RIGHT position list to be right aligned with getAlignmentBase() component.getAlignmentBase(), this defaults to drop down button.
In order to affect offset to this aligment rules use setOffsetY(int) and setOffsetX(int).halign - @Nullable public NodeBase getAlignmentBase()
m_alignmentBasehalignmentBase - public void setAlignmentBase(@Nullable NodeBase halignmentBase)
m_alignmentBasehalignmentBase - public boolean hasData()
@Nullable public IValueChanged<DropDownPicker<T>> getOnValueChanged()
getOnValueChanged in interface IHasChangeListenerpublic void setOnValueChanged(@Nullable IValueChanged<?> onValueChanged)
setOnValueChanged in interface IHasChangeListenerpublic T getValueSafe()
IControlIControl.getValue() this returns the value of the component, but this returns null
if the value was invalid. For this method NULL either means the value was invalid OR
it's content was empty. To distinguish between the two call IControl.hasError() or use
IControl.getValue() instead of this call.getValueSafe in interface IControl<T>public boolean isReadOnly()
IControlisReadOnly in interface IControl<T>public void setReadOnly(boolean ro)
IControlsetReadOnly in interface IControl<T>Copyright © 2017 etc.to. All rights reserved.