C
- the type that the Cell representspublic class CellWidget<C> extends Widget implements HasKeyProvider<C>, HasValue<C>, IsEditor<LeafValueEditor<C>>
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Modifier | Constructor and Description |
---|---|
|
CellWidget(Cell<C> cell)
Construct a new
CellWidget with the specified cell and an initial
value of null . |
|
CellWidget(Cell<C> cell,
C initialValue)
Construct a new
CellWidget with the specified cell and initial
value. |
|
CellWidget(Cell<C> cell,
C initialValue,
ProvidesKey<C> keyProvider)
Construct a new
CellWidget with the specified cell, initial value,
and key provider. |
protected |
CellWidget(Cell<C> cell,
C initialValue,
ProvidesKey<C> keyProvider,
Element elem)
Creates a
CellWidget with the specified cell, initial value, key
provider, using the specified element as the wrapper around the cell. |
|
CellWidget(Cell<C> cell,
ProvidesKey<C> keyProvider)
Construct a new
CellWidget with the specified cell and key
provider, and an initial value of null . |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<C> handler)
Adds a
ValueChangeEvent handler. |
LeafValueEditor<C> |
asEditor()
Returns the Editor encapsulated by the view object.
|
Cell<C> |
getCell()
Get the
Cell wrapped by this widget. |
ProvidesKey<C> |
getKeyProvider()
Return the key provider.
|
C |
getValue()
Gets this object's value.
|
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received.
|
void |
redraw()
Redraw the widget.
|
void |
setValue(C value)
Sets this object's value without firing any events.
|
void |
setValue(C value,
boolean fireEvents)
Sets this object's value.
|
void |
setValue(C value,
boolean fireEvents,
boolean redraw)
Sets this object's value and optionally redraw the widget.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
fireEvent
public CellWidget(Cell<C> cell)
CellWidget
with the specified cell and an initial
value of null
.cell
- the cell to wrappublic CellWidget(Cell<C> cell, ProvidesKey<C> keyProvider)
CellWidget
with the specified cell and key
provider, and an initial value of null
.cell
- the cell to wrapkeyProvider
- the key provider used to get keys from valuespublic CellWidget(Cell<C> cell, C initialValue)
CellWidget
with the specified cell and initial
value.cell
- the cell to wrapinitialValue
- the initial value of the Cellpublic CellWidget(Cell<C> cell, C initialValue, ProvidesKey<C> keyProvider)
CellWidget
with the specified cell, initial value,
and key provider.cell
- the cell to wrapinitialValue
- the initial value of the CellkeyProvider
- the key provider used to get keys from valuesprotected CellWidget(Cell<C> cell, C initialValue, ProvidesKey<C> keyProvider, Element elem)
CellWidget
with the specified cell, initial value, key
provider, using the specified element as the wrapper around the cell.cell
- the cell to wrapinitialValue
- the initial value of the CellkeyProvider
- the key provider used to get keys from valueselem
- the browser element to usepublic HandlerRegistration addValueChangeHandler(ValueChangeHandler<C> handler)
HasValueChangeHandlers
ValueChangeEvent
handler.addValueChangeHandler
in interface HasValueChangeHandlers<C>
handler
- the handlerpublic LeafValueEditor<C> asEditor()
IsEditor
asEditor
in interface IsEditor<LeafValueEditor<C>>
Editor
of type Epublic Cell<C> getCell()
Cell
wrapped by this widget.Cell
being wrappedpublic ProvidesKey<C> getKeyProvider()
HasKeyProvider
getKeyProvider
in interface HasKeyProvider<C>
ProvidesKey
instancepublic C getValue()
HasValue
getValue
in interface TakesValue<C>
getValue
in interface HasValue<C>
TakesValue.setValue(V)
public void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
event
- the event receivedpublic void redraw()
public void setValue(C value)
It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.
Widgets must accept null as a valid value. By convention, setting a widget to
null clears value, calling getValue() on a cleared widget returns null. Widgets
that can not be cleared (e.g. CheckBox
) must find another valid meaning
for null input.
This method will redraw the widget if the new value does not equal the existing value.
setValue
in interface TakesValue<C>
setValue
in interface HasValue<C>
value
- the object's new valueTakesValue.getValue()
public void setValue(C value, boolean fireEvents)
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.
This method will redraw the widget if the new value does not equal the existing value.
public void setValue(C value, boolean fireEvents, boolean redraw)
ValueChangeEvent
when
fireEvents is true and the new value does not equal the existing value.
Redraws the widget when redraw is true and the new value does not equal the
existing value.value
- the object's new valuefireEvents
- fire events if true and value is newredraw
- redraw the widget if true and value is newCopyright © 2018. All rights reserved.