org.gwtbootstrap3.extras.typeahead.client.ui
Class Typeahead<T>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.FocusWidget
              extended by com.google.gwt.user.client.ui.ValueBoxBase<T>
                  extended by org.gwtbootstrap3.client.ui.base.ValueBoxBase<String>
                      extended by org.gwtbootstrap3.client.ui.base.TextBoxBase
                          extended by org.gwtbootstrap3.client.ui.TextBox
                              extended by org.gwtbootstrap3.extras.typeahead.client.ui.Typeahead<T>
All Implemented Interfaces:
Editor<String>, HasEditorErrors<String>, IsEditor<ValueBoxEditor<String>>, HasAllDragAndDropHandlers, HasAllFocusHandlers, HasAllGestureHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasBlurHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasFocusHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, HasAttachHandlers, HasValueChangeHandlers<String>, HasHandlers, AutoDirectionHandler.Target, HasDirection, HasDirectionEstimator, EventListener, TakesValue<String>, Focusable, HasEnabled, HasFocus, HasName, HasText, HasValue<String>, HasVisibility, IsWidget, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, org.gwtbootstrap3.client.ui.base.HasAutoComplete, org.gwtbootstrap3.client.ui.base.HasId, org.gwtbootstrap3.client.ui.base.HasPlaceholder, org.gwtbootstrap3.client.ui.base.HasResponsiveness, org.gwtbootstrap3.client.ui.base.HasSize<org.gwtbootstrap3.client.ui.constants.InputSize>, org.gwtbootstrap3.client.ui.form.error.HasErrorHandler, org.gwtbootstrap3.client.ui.form.validator.HasBlankValidator<String>, org.gwtbootstrap3.client.ui.form.validator.HasValidators<String>, org.gwtbootstrap3.client.ui.form.validator.ValidationChangedEvent.HasValidationChangedHandlers

public class Typeahead<T>
extends org.gwtbootstrap3.client.ui.TextBox

Twitter typeahead.js https://github.com/twitter/typeahead.js

Author:
Florian Kremser

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.ValueBoxBase
ValueBoxBase.TextAlignment
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.editor.client.Editor
Editor.Ignore, Editor.Path
 
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection
HasDirection.Direction
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Fields inherited from interface org.gwtbootstrap3.client.ui.base.HasPlaceholder
PLACEHOLDER
 
Fields inherited from interface org.gwtbootstrap3.client.ui.base.HasAutoComplete
AUTO_COMPLETE, OFF, ON
 
Constructor Summary
Typeahead()
           
Typeahead(Collection<? extends Dataset<T>> datasets)
           
Typeahead(Dataset<T> dataset)
          A typeahead is composed of one or more datasets.
 
Method Summary
 HandlerRegistration addTypeaheadAutoCompletedHandler(TypeaheadAutoCompletedHandler<T> handler)
           
 HandlerRegistration addTypeaheadClosedHandler(TypeaheadClosedHandler<T> handler)
           
 HandlerRegistration addTypeaheadCursorChangededHandler(TypeaheadCursorChangedHandler<T> handler)
           
 HandlerRegistration addTypeaheadOpenedHandler(TypeaheadOpenedHandler<T> handler)
           
 HandlerRegistration addTypeaheadSelectedHandler(TypeaheadSelectedHandler<T> handler)
           
protected  void configure()
           
protected  void onLoad()
           
protected  void onUnload()
           
 void reconfigure()
           
 void setDatasets(Collection<? extends Dataset<T>> datasets)
           
 void setDatasets(Dataset<T> dataset)
           
 void setHighlight(boolean highlight)
          If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with the tt-highlight class.
 void setHint(boolean hint)
          If false, the typeahead will not show a hint.
 void setMinLength(int minLength)
          The minimum character length needed before suggestions start getting rendered.
 void setValue(String value, boolean fireEvents)
           
 
Methods inherited from class org.gwtbootstrap3.client.ui.TextBox
clear
 
Methods inherited from class org.gwtbootstrap3.client.ui.base.TextBoxBase
getValue
 
Methods inherited from class org.gwtbootstrap3.client.ui.base.ValueBoxBase
addValidationChangedHandler, addValidator, getAllowBlank, getAutoComplete, getErrorHandler, getErrorHandlerType, getId, getPlaceholder, getSize, getValidateOnBlur, reset, setAllowBlank, setAutoComplete, setErrorHandler, setErrorHandlerType, setHiddenOn, setId, setMaxLength, setPlaceholder, setSize, setValidateOnBlur, setValidators, setVisibleOn, showErrors, validate, validate
 
Methods inherited from class com.google.gwt.user.client.ui.ValueBoxBase
addChangeHandler, addValueChangeHandler, asEditor, cancelKey, getCursorPos, getDirection, getDirectionEstimator, getImpl, getName, getSelectedText, getSelectionLength, getText, getValueOrThrow, isReadOnly, onBrowserEvent, removeChangeListener, selectAll, setAlignment, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setValue
 
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex
 
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, isAttached, isOrWasAttached, onDetach, 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, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, 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 com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.dom.client.HasKeyUpHandlers
addKeyUpHandler
 

Constructor Detail

Typeahead

public Typeahead()

Typeahead

public Typeahead(Dataset<T> dataset)
A typeahead is composed of one or more datasets. When an end-user modifies the value of a typeahead, each dataset will attempt to render suggestions for the new value.

Parameters:
dataset - a dataset for providing suggestions

Typeahead

public Typeahead(Collection<? extends Dataset<T>> datasets)
Method Detail

setDatasets

public void setDatasets(Dataset<T> dataset)

setDatasets

public void setDatasets(Collection<? extends Dataset<T>> datasets)

setValue

public void setValue(String value,
                     boolean fireEvents)
Specified by:
setValue in interface HasValue<String>
Overrides:
setValue in class org.gwtbootstrap3.client.ui.base.ValueBoxBase<String>

setHighlight

public void setHighlight(boolean highlight)
If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with the tt-highlight class. Defaults to false.

Parameters:
highlight - true to highlight pattern matches in suggestions

setHint

public void setHint(boolean hint)
If false, the typeahead will not show a hint. Defaults to true.

Parameters:
hint - true to show a hint

setMinLength

public void setMinLength(int minLength)
The minimum character length needed before suggestions start getting rendered. Defaults to 1.

Parameters:
minLength - minimum required input length for matching

addTypeaheadOpenedHandler

public HandlerRegistration addTypeaheadOpenedHandler(TypeaheadOpenedHandler<T> handler)

addTypeaheadClosedHandler

public HandlerRegistration addTypeaheadClosedHandler(TypeaheadClosedHandler<T> handler)

addTypeaheadCursorChangededHandler

public HandlerRegistration addTypeaheadCursorChangededHandler(TypeaheadCursorChangedHandler<T> handler)

addTypeaheadAutoCompletedHandler

public HandlerRegistration addTypeaheadAutoCompletedHandler(TypeaheadAutoCompletedHandler<T> handler)

addTypeaheadSelectedHandler

public HandlerRegistration addTypeaheadSelectedHandler(TypeaheadSelectedHandler<T> handler)

reconfigure

public void reconfigure()

onLoad

protected void onLoad()
Overrides:
onLoad in class ValueBoxBase<String>

onUnload

protected void onUnload()
Overrides:
onUnload in class Widget

configure

protected void configure()


Copyright © 2015. All rights reserved.