|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.cell.client.AbstractCell<C> com.google.gwt.cell.client.CompositeCell<C>
C
- the type that this Cell representspublic class CompositeCell<C>
A Cell
that is composed of other Cell
s.
When this cell is rendered, it will render each component Cell
inside
a span. If the component Cell
uses block level elements (such as a
Div), the component cells will stack vertically.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.google.gwt.cell.client.Cell |
---|
Cell.Context |
Constructor Summary | |
---|---|
CompositeCell(java.util.List<HasCell<C,?>> hasCells)
Construct a new CompositeCell . |
Method Summary | ||
---|---|---|
boolean |
dependsOnSelection()
Check if this cell depends on the selection state. |
|
java.util.Set<java.lang.String> |
getConsumedEvents()
Get the set of events that this cell consumes (see BrowserEvents for useful
constants). |
|
protected Element |
getContainerElement(Element parent)
Get the element that acts as the container for all children. |
|
boolean |
handlesSelection()
Check if this cell handles selection. |
|
boolean |
isEditing(Cell.Context context,
Element parent,
C value)
Returns false. |
|
void |
onBrowserEvent(Cell.Context context,
Element parent,
C value,
NativeEvent event,
ValueUpdater<C> valueUpdater)
Handle a browser event that took place within the cell. |
|
void |
render(Cell.Context context,
C value,
SafeHtmlBuilder sb)
Render a cell as HTML into a SafeHtmlBuilder , suitable for passing
to Element.setInnerHTML(String) on a container element. |
|
protected
|
render(Cell.Context context,
C value,
SafeHtmlBuilder sb,
HasCell<C,X> hasCell)
Render the composite cell as HTML into a SafeHtmlBuilder , suitable
for passing to Element.setInnerHTML(java.lang.String) on a container element. |
|
boolean |
resetFocus(Cell.Context context,
Element parent,
C value)
Reset focus on the Cell. |
|
void |
setValue(Cell.Context context,
Element parent,
C object)
This method may be used by cell containers to set the value on a single cell directly, rather than using Element.setInnerHTML(String) . |
Methods inherited from class com.google.gwt.cell.client.AbstractCell |
---|
onEnterKeyDown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeCell(java.util.List<HasCell<C,?>> hasCells)
CompositeCell
.
hasCells
- the cells that makeup the compositeMethod Detail |
---|
public boolean dependsOnSelection()
Cell
dependsOnSelection
in interface Cell<C>
dependsOnSelection
in class AbstractCell<C>
public java.util.Set<java.lang.String> getConsumedEvents()
Cell
BrowserEvents
for useful
constants). The container that uses this cell should only pass these events
to
Cell.onBrowserEvent(Context, Element, Object, NativeEvent, ValueUpdater)
when the event occurs.
The returned value should not be modified, and may be an unmodifiable set. Changes to the return value may not be reflected in the cell.
getConsumedEvents
in interface Cell<C>
getConsumedEvents
in class AbstractCell<C>
BrowserEvents
public boolean handlesSelection()
Cell
handlesSelection
in interface Cell<C>
handlesSelection
in class AbstractCell<C>
public boolean isEditing(Cell.Context context, Element parent, C value)
AbstractCell
isEditing
in interface Cell<C>
isEditing
in class AbstractCell<C>
context
- the Cell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cell
public void onBrowserEvent(Cell.Context context, Element parent, C value, NativeEvent event, ValueUpdater<C> valueUpdater)
AbstractCell
If you override this method to add support for events, remember to pass the event types that the cell expects into the constructor.
onBrowserEvent
in interface Cell<C>
onBrowserEvent
in class AbstractCell<C>
context
- the Cell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellevent
- the native browser eventvalueUpdater
- a ValueUpdater
, or null if not specifiedpublic void render(Cell.Context context, C value, SafeHtmlBuilder sb)
Cell
SafeHtmlBuilder
, suitable for passing
to Element.setInnerHTML(String)
on a container element.
Note: If your cell contains natively focusable elements, such as buttons or input elements, be sure to set the tabIndex to -1 so that they do not steal focus away from the containing widget.
render
in interface Cell<C>
render
in class AbstractCell<C>
context
- the Cell.Context
of the cellvalue
- the cell value to be renderedsb
- the SafeHtmlBuilder
to be written topublic boolean resetFocus(Cell.Context context, Element parent, C value)
AbstractCell
This method is a no-op and returns false. If your cell is editable or can be focused by the user, override this method to reset focus when the containing widget is refreshed.
resetFocus
in interface Cell<C>
resetFocus
in class AbstractCell<C>
context
- the Cell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cell
public void setValue(Cell.Context context, Element parent, C object)
Cell
Element.setInnerHTML(String)
. See
Cell.setValue(Context, Element, Object)
for a default
implementation that uses Cell.render(Context, Object, SafeHtmlBuilder)
.
setValue
in interface Cell<C>
setValue
in class AbstractCell<C>
context
- the Cell.Context
of the cellparent
- the parent Elementobject
- the value associated with the cellprotected Element getContainerElement(Element parent)
parent
- the parent element of the cell
protected <X> void render(Cell.Context context, C value, SafeHtmlBuilder sb, HasCell<C,X> hasCell)
SafeHtmlBuilder
, suitable
for passing to Element.setInnerHTML(java.lang.String)
on a container element.
Note: If your cell contains natively focusable elements, such as buttons or input elements, be sure to set the tabIndex to -1 so that they do not steal focus away from the containing widget.
context
- the Context
of the cellvalue
- the cell value to be renderedsb
- the SafeHtmlBuilder
to be written tohasCell
- a HasCell
instance containing the cells to be
rendered within this cell
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |