|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.gwt.cell.client.IconCellDecorator<C>
C - the type that this Cell representspublic class IconCellDecorator<C>
A Cell decorator that adds an icon to another Cell.
| Nested Class Summary | |
|---|---|
(package private) static interface |
IconCellDecorator.Template
|
| Nested classes/interfaces inherited from interface com.google.gwt.cell.client.Cell |
|---|
Cell.Context |
| Constructor Summary | |
|---|---|
IconCellDecorator(ImageResource icon,
Cell<C> cell)
Construct a new IconCellDecorator. |
|
IconCellDecorator(ImageResource icon,
Cell<C> cell,
HasVerticalAlignment.VerticalAlignmentConstant valign,
int spacing)
Construct a new IconCellDecorator. |
|
| 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 SafeHtml |
getIconHtml(C value)
Get the safe HTML string that represents the icon. |
(package private) SafeHtml |
getImageHtml(ImageResource res,
HasVerticalAlignment.VerticalAlignmentConstant valign,
boolean isPlaceholder)
Get the HTML representation of an image. |
boolean |
handlesSelection()
Check if this cell handles selection. |
boolean |
isEditing(Cell.Context context,
Element parent,
C value)
Returns true if the cell is currently editing the data identified by the given element and key. |
protected boolean |
isIconUsed(C value)
Check if the icon should be used for the value. |
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. |
boolean |
resetFocus(Cell.Context context,
Element parent,
C value)
Reset focus on the Cell. |
void |
setValue(Cell.Context context,
Element parent,
C value)
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IconCellDecorator(ImageResource icon,
Cell<C> cell)
IconCellDecorator. The icon and the content will be
middle aligned by default.
icon - the icon to usecell - the cell to decorate
public IconCellDecorator(ImageResource icon,
Cell<C> cell,
HasVerticalAlignment.VerticalAlignmentConstant valign,
int spacing)
IconCellDecorator.
icon - the icon to usecell - the cell to decoratevalign - the vertical alignment attribute of the contentsspacing - the pixel space between the icon and the cell| Method Detail |
|---|
public boolean dependsOnSelection()
Cell
dependsOnSelection in interface Cell<C>public java.util.Set<java.lang.String> getConsumedEvents()
CellBrowserEvents 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>BrowserEventspublic boolean handlesSelection()
Cell
handlesSelection in interface Cell<C>
public boolean isEditing(Cell.Context context,
Element parent,
C value)
Cell
isEditing in interface Cell<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)
Cell
onBrowserEvent in interface Cell<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 specified
public void render(Cell.Context context,
C value,
SafeHtmlBuilder sb)
CellSafeHtmlBuilder, 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>context - the Cell.Context of the cellvalue - the cell value to be renderedsb - the SafeHtmlBuilder to be written to
public boolean resetFocus(Cell.Context context,
Element parent,
C value)
Cell
resetFocus in interface Cell<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 value)
CellElement.setInnerHTML(String). See
Cell.setValue(Context, Element, Object) for a default
implementation that uses Cell.render(Context, Object, SafeHtmlBuilder).
setValue in interface Cell<C>context - the Cell.Context of the cellparent - the parent Elementvalue - the value associated with the cellprotected SafeHtml getIconHtml(C value)
value - the value being rendered
protected boolean isIconUsed(C value)
value - the value being rendered
SafeHtml getImageHtml(ImageResource res,
HasVerticalAlignment.VerticalAlignmentConstant valign,
boolean isPlaceholder)
res - the ImageResource to render as HTMLvalign - the vertical alignmentisPlaceholder - if true, do not include the background image
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||