Class IdAndNameSearchableListBox<T>
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- de.knightsoftnet.mtwidgets.client.ui.widget.IdAndNameSearchableListBox<T>
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.TakesValue<T>,com.google.gwt.user.client.ui.HasValue<T>,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,HasAutocomplete,HasAutofocus,HasPlaceholder,HasRequired,HasValidationMessageElement<T,ValueBoxEditor<T>>,HasValidity,org.gwtproject.editor.client.Editor<T>,org.gwtproject.editor.client.HasEditorErrors<T>,org.gwtproject.editor.client.IsEditor<ValueBoxEditor<T>>,org.gwtproject.editor.client.TakesValue<T>
- Direct Known Subclasses:
SortableIdAndNameSearchableListBox
public class IdAndNameSearchableListBox<T> extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.user.client.ui.HasValue<T>, org.gwtproject.editor.client.TakesValue<T>, HasValidationMessageElement<T,ValueBoxEditor<T>>, HasAutofocus, HasRequired, HasValidity, HasPlaceholder, HasAutocomplete
a searchable list box with id and name, based on input text box and HTML5 data list.- Author:
- Manfred Tremmel
-
-
Field Summary
Fields Modifier and Type Field Description protected List<IdAndNameBean<T>>entries
-
Constructor Summary
Constructors Constructor Description IdAndNameSearchableListBox()constructor.IdAndNameSearchableListBox(Collection<? extends IdAndNameBean<T>> pentries)constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistrationaddValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<T> phandler)ValueBoxEditor<T>asEditor()booleancheckValidity()Returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints.protected voidensureDomEventHandlers()voidfillEntryCollections(Collection<? extends IdAndNameBean<T>> pentries)fill entries of the listbox.StringgetAutocomplete()get autocomplete attribute value.StringgetPlaceholder()get place holder text.StringgetValidationMessage()A localized message that describes the validation constraints that the control does not satisfy (if any).com.google.gwt.user.client.ui.HTMLPanelgetValidationMessageElement()get validation message element.elemental2.dom.ValidityStategetValidity()The validity states that this element is in.TgetValue()booleanisAutofocus()get autofocus value.booleanisRequired()Reflects therequiredHTML attribute, indicating that the user must fill in a value before submitting a form.protected voidonEnsureDebugId(String pbaseId)voidsetAutocomplete(String arg)set autocomplete attribute value.voidsetAutofocus(boolean arg)set autofocus value.voidsetCustomValidity(String message)set custom validity value.voidsetPlaceholder(String arg)set place holder text.voidsetRequired(boolean arg)Reflects therequiredHTML attribute, indicating that the user must fill in a value before submitting a form.voidsetValidationMessageElement(com.google.gwt.user.client.ui.HTMLPanel pelement)set validation message element.voidsetValue(T pvalue)voidsetValue(T pvalue, boolean pfireEvents)voidshowErrors(List<org.gwtproject.editor.client.EditorError> perrors)-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.knightsoftnet.mtwidgets.client.ui.widget.features.HasValidationMessageElement
editorErrorMatches, setTitle, showErrors
-
-
-
-
Field Detail
-
entries
protected final List<IdAndNameBean<T>> entries
-
-
Constructor Detail
-
IdAndNameSearchableListBox
public IdAndNameSearchableListBox()
constructor.
-
IdAndNameSearchableListBox
public IdAndNameSearchableListBox(Collection<? extends IdAndNameBean<T>> pentries)
constructor.- Parameters:
pentries- collection of id and name bean entries
-
-
Method Detail
-
fillEntryCollections
public final void fillEntryCollections(Collection<? extends IdAndNameBean<T>> pentries)
fill entries of the listbox.- Parameters:
pentries- list of entries
-
onEnsureDebugId
protected void onEnsureDebugId(String pbaseId)
- Overrides:
onEnsureDebugIdin classcom.google.gwt.user.client.ui.UIObject
-
addValueChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<T> phandler)
- Specified by:
addValueChangeHandlerin interfacecom.google.gwt.event.logical.shared.HasValueChangeHandlers<T>
-
ensureDomEventHandlers
protected void ensureDomEventHandlers()
-
getValue
public T getValue()
-
setValue
public void setValue(T pvalue)
-
setValue
public void setValue(T pvalue, boolean pfireEvents)
- Specified by:
setValuein interfacecom.google.gwt.user.client.ui.HasValue<T>
-
showErrors
public void showErrors(List<org.gwtproject.editor.client.EditorError> perrors)
- Specified by:
showErrorsin interfaceorg.gwtproject.editor.client.HasEditorErrors<T>- Specified by:
showErrorsin interfaceHasValidationMessageElement<T,ValueBoxEditor<T>>
-
asEditor
public ValueBoxEditor<T> asEditor()
- Specified by:
asEditorin interfaceorg.gwtproject.editor.client.IsEditor<T>
-
isAutofocus
public boolean isAutofocus()
Description copied from interface:HasAutofocusget autofocus value.- Specified by:
isAutofocusin interfaceHasAutofocus- Returns:
- true if input field has autofocus
-
setAutofocus
public void setAutofocus(boolean arg)
Description copied from interface:HasAutofocusset autofocus value.- Specified by:
setAutofocusin interfaceHasAutofocus- Parameters:
arg- true if input field has autofocus
-
setValidationMessageElement
public void setValidationMessageElement(com.google.gwt.user.client.ui.HTMLPanel pelement)
Description copied from interface:HasValidationMessageElementset validation message element.- Specified by:
setValidationMessageElementin interfaceHasValidationMessageElement<T,ValueBoxEditor<T>>- Parameters:
pelement- element to set
-
getValidationMessageElement
public com.google.gwt.user.client.ui.HTMLPanel getValidationMessageElement()
Description copied from interface:HasValidationMessageElementget validation message element.- Specified by:
getValidationMessageElementin interfaceHasValidationMessageElement<T,ValueBoxEditor<T>>- Returns:
- element or null if non is set
-
getAutocomplete
public String getAutocomplete()
Description copied from interface:HasAutocompleteget autocomplete attribute value.- Specified by:
getAutocompletein interfaceHasAutocomplete- Returns:
- input field autocomplete attribute value
-
setAutocomplete
public void setAutocomplete(String arg)
Description copied from interface:HasAutocompleteset autocomplete attribute value.- Specified by:
setAutocompletein interfaceHasAutocomplete- Parameters:
arg- input field autocomplete attribute value to set
-
getPlaceholder
public String getPlaceholder()
Description copied from interface:HasPlaceholderget place holder text.- Specified by:
getPlaceholderin interfaceHasPlaceholder- Returns:
- place holder text displayed when value is empty
-
setPlaceholder
public void setPlaceholder(String arg)
Description copied from interface:HasPlaceholderset place holder text.- Specified by:
setPlaceholderin interfaceHasPlaceholder- Parameters:
arg- place holder text displayed when value is empty
-
getValidationMessage
public String getValidationMessage()
Description copied from interface:HasValidityA localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.- Specified by:
getValidationMessagein interfaceHasValidity- Returns:
- localized validation message
-
getValidity
public elemental2.dom.ValidityState getValidity()
Description copied from interface:HasValidityThe validity states that this element is in.- Specified by:
getValidityin interfaceHasValidity- Returns:
- ValidityState
-
checkValidity
public boolean checkValidity()
Description copied from interface:HasValidityReturns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires aninvalidevent at the element. It returns true if the element is not a candidate for constraint validation, or if it satisfies its constraints.- Specified by:
checkValidityin interfaceHasValidity- Returns:
- true if input is valid
-
isRequired
public boolean isRequired()
Description copied from interface:HasRequiredReflects therequiredHTML attribute, indicating that the user must fill in a value before submitting a form.- Specified by:
isRequiredin interfaceHasRequired- Returns:
- required true/false
-
setRequired
public void setRequired(boolean arg)
Description copied from interface:HasRequiredReflects therequiredHTML attribute, indicating that the user must fill in a value before submitting a form.- Specified by:
setRequiredin interfaceHasRequired- Parameters:
arg- required true/false
-
setCustomValidity
public void setCustomValidity(String message)
Description copied from interface:HasValidationMessageElementset custom validity value.- Specified by:
setCustomValidityin interfaceHasValidationMessageElement<T,ValueBoxEditor<T>>- Parameters:
message- message to show
-
-