Class CellWidget<C>
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.cellview.client.CellWidget<C>
- Type Parameters:
C- the type that the Cell represents
- All Implemented Interfaces:
IsEditor<LeafValueEditor<C>>,HasAttachHandlers,HasValueChangeHandlers<C>,HasHandlers,EventListener,TakesValue<C>,HasValue<C>,HasVisibility,IsWidget,HasKeyProvider<C>
public class CellWidget<C>
extends Widget
implements HasKeyProvider<C>, HasValue<C>, IsEditor<LeafValueEditor<C>>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled -
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionCellWidget(Cell<C> cell) Construct a newCellWidgetwith the specified cell and an initial value ofnull.CellWidget(Cell<C> cell, C initialValue) Construct a newCellWidgetwith the specified cell and initial value.CellWidget(Cell<C> cell, ProvidesKey<C> keyProvider) Construct a newCellWidgetwith the specified cell and key provider, and an initial value ofnull.CellWidget(Cell<C> cell, C initialValue, ProvidesKey<C> keyProvider) Construct a newCellWidgetwith the specified cell, initial value, and key provider.protectedCellWidget(Cell<C> cell, C initialValue, ProvidesKey<C> keyProvider, Element elem) Creates aCellWidgetwith the specified cell, initial value, key provider, using the specified element as the wrapper around the cell. -
Method Summary
Modifier and TypeMethodDescriptionaddValueChangeHandler(ValueChangeHandler<C> handler) Adds aValueChangeEventhandler.asEditor()Returns the Editor encapsulated by the view object.getCell()Get theCellwrapped by this widget.Return the key provider.getValue()Gets this object's value.voidonBrowserEvent(Event event) Fired whenever a browser event is received.voidredraw()Redraw the widget.voidSets this object's value without firing any events.voidSets this object's value.voidSets this object's value and optionally redraw the widget.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, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
CellWidget
Construct a newCellWidgetwith the specified cell and an initial value ofnull.- Parameters:
cell- the cell to wrap
-
CellWidget
Construct a newCellWidgetwith the specified cell and key provider, and an initial value ofnull.- Parameters:
cell- the cell to wrapkeyProvider- the key provider used to get keys from values
-
CellWidget
Construct a newCellWidgetwith the specified cell and initial value.- Parameters:
cell- the cell to wrapinitialValue- the initial value of the Cell
-
CellWidget
Construct a newCellWidgetwith the specified cell, initial value, and key provider.- Parameters:
cell- the cell to wrapinitialValue- the initial value of the CellkeyProvider- the key provider used to get keys from values
-
CellWidget
Creates aCellWidgetwith the specified cell, initial value, key provider, using the specified element as the wrapper around the cell.- Parameters:
cell- the cell to wrapinitialValue- the initial value of the CellkeyProvider- the key provider used to get keys from valueselem- the browser element to use
-
-
Method Details
-
asEditor
Description copied from interface:IsEditorReturns the Editor encapsulated by the view object. -
getCell
Get theCellwrapped by this widget.- Returns:
- the
Cellbeing wrapped
-
getKeyProvider
Description copied from interface:HasKeyProviderReturn the key provider.- Specified by:
getKeyProviderin interfaceHasKeyProvider<C>- Returns:
- the
ProvidesKeyinstance
-
getValue
Description copied from interface:HasValueGets this object's value. -
onBrowserEvent
Description copied from interface:EventListenerFired whenever a browser event is received.- Specified by:
onBrowserEventin interfaceEventListener- Overrides:
onBrowserEventin classWidget- Parameters:
event- the event received
-
redraw
public void redraw()Redraw the widget. -
setValue
Sets this object's value without firing any events. This should be identical to calling setValue(value, false).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
Sets this object's value. FiresValueChangeEventwhen 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.
-
setValue
Sets this object's value and optionally redraw the widget. FiresValueChangeEventwhen 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.- Parameters:
value- the object's new valuefireEvents- fire events if true and value is newredraw- redraw the widget if true and value is new