public class

ValueListBox

extends Composite
implements IsEditor<E extends Editor<?>> HasConstrainedValue<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
         ↳ com.google.gwt.user.client.ui.ValueListBox<T>

Class Overview

Implementation of HasConstrainedValue based on a SelectElement.

A Renderer is used to get user-presentable strings to display in the select element.

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
ValueListBox(Renderer<T> renderer)
ValueListBox(Renderer<T> renderer, ProvidesKey<T> keyProvider)
Public Methods
HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
Adds a ValueChangeEvent handler.
TakesValueEditor<T> asEditor()
Returns a TakesValueEditor backed by the ValueListBox.
T getValue()
Gets this object's value.
void setAcceptableValues(Collection<T> newValues)
Set the acceptable values.
void setValue(T value, boolean fireEvents)
Sets this object's value.
void setValue(T value)
Set the value and display it in the select element.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.Composite
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.editor.client.IsEditor
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.logical.shared.HasValueChangeHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.TakesValue
From interface com.google.gwt.user.client.ui.HasConstrainedValue
From interface com.google.gwt.user.client.ui.HasValue
From interface com.google.gwt.user.client.ui.IsWidget

Public Constructors

public ValueListBox (Renderer<T> renderer)

public ValueListBox (Renderer<T> renderer, ProvidesKey<T> keyProvider)

Public Methods

public HandlerRegistration addValueChangeHandler (ValueChangeHandler<T> handler)

Adds a ValueChangeEvent handler.

Parameters
handler the handler
Returns
  • the registration for the event

public TakesValueEditor<T> asEditor ()

Returns a TakesValueEditor backed by the ValueListBox.

Returns

public T getValue ()

Gets this object's value.

Returns
  • the object's value

public void setAcceptableValues (Collection<T> newValues)

Set the acceptable values.

Parameters
newValues the acceptible values

public void setValue (T value, boolean fireEvents)

Sets this object's value. Fires ValueChangeEvent when fireEvents is true and the new value does not equal the existing value.

It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.

Parameters
value the object's new value
fireEvents fire events if true and value is new

public void setValue (T value)

Set the value and display it in the select element. Add the value to the acceptable set if it is not already there.

Parameters
value the object's new value