com.sencha.gxt.widget.core.client.cell
Class CellComponent<C>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.cell.CellComponent<C>
Type Parameters:
C - the type that the Cell represents
All Implemented Interfaces:
Editor<C>, LeafValueEditor<C>, HasAttachHandlers, HasResizeHandlers, HasValueChangeHandlers<C>, HasHandlers, EventListener, TakesValue<C>, HasValue<C>, HasVisibility, IsWidget, HasKeyProvider<C>, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId
Direct Known Subclasses:
CellButtonBase, CellField, ColorPalette, Field, ProgressBar

public class CellComponent<C>
extends Component
implements HasKeyProvider<C>, HasValue<C>, LeafValueEditor<C>

A Component that wraps a Cell.

It is important to not that a single cell instance should not be used in a single CellComponent instance.

Subclasses should be aware that redraw() calls are deferred before the component is "rendered". The component is rendered when getElement is called for the first time, typically, when the component is added to a panel or container. To force a redraw use redraw(boolean).


Nested Class Summary
 
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
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Method Summary
 HandlerRegistration addValueChangeHandler(ValueChangeHandler<C> handler)
           
 Cell<C> getCell()
          Get the Cell wrapped by this widget.
 XElement getElement()
          Gets a handle to the object's underlying DOM element.
 ProvidesKey<C> getKeyProvider()
           
 C getValue()
           
 void onBrowserEvent(Event event)
           
 void redraw()
          Redraw the widget.
 void setValue(C value)
          
 void setValue(C value, boolean fireEvents)
          
 void setValue(C value, boolean fireEvents, boolean redraw)
          Sets this object's value and optionally redraw the widget.
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Method Detail

addValueChangeHandler

public HandlerRegistration addValueChangeHandler(ValueChangeHandler<C> handler)
Specified by:
addValueChangeHandler in interface HasValueChangeHandlers<C>

getCell

public Cell<C> getCell()
Get the Cell wrapped by this widget.

Returns:
the Cell being wrapped

getElement

public XElement getElement()
Description copied from class: Component
Gets a handle to the object's underlying DOM element. This method should not be overridden. It is non-final solely to support legacy code that depends upon overriding it. If it is overridden, the subclass implementation must not return a different element than was previously set using UIObject.setElement(com.google.gwt.user.client.Element).

Overrides:
getElement in class Component
Returns:
the object's browser element

getKeyProvider

public ProvidesKey<C> getKeyProvider()
Specified by:
getKeyProvider in interface HasKeyProvider<C>

getValue

public C getValue()
Specified by:
getValue in interface TakesValue<C>
Specified by:
getValue in interface HasValue<C>

onBrowserEvent

public void onBrowserEvent(Event event)
Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Component

redraw

public void redraw()
Redraw the widget.


setValue

public void setValue(C value)

This method will redraw the widget if the new value does not equal the existing value.

Specified by:
setValue in interface TakesValue<C>
Specified by:
setValue in interface HasValue<C>

setValue

public void setValue(C value,
                     boolean fireEvents)

This method will redraw the widget if the new value does not equal the existing value.

Specified by:
setValue in interface HasValue<C>

setValue

public void setValue(C value,
                     boolean fireEvents,
                     boolean redraw)
Sets this object's value and optionally redraw the widget. Fires 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.

Parameters:
value - the object's new value
fireEvents - fire events if true and value is new
redraw - redraw the widget if true and value is new


Copyright © 2012. All Rights Reserved.