com.google.gwt.cell.client
Class ActionCell<C>

java.lang.Object
  extended by com.google.gwt.cell.client.AbstractCell<C>
      extended by com.google.gwt.cell.client.ActionCell<C>
Type Parameters:
C - the type that this Cell represents
All Implemented Interfaces:
Cell<C>

public class ActionCell<C>
extends AbstractCell<C>

A cell that renders a button and takes a delegate to perform actions on mouseUp.

Note: This class is new and its interface subject to change.


Nested Class Summary
static interface ActionCell.Delegate<T>
          The delegate that will handle events from the cell.
 
Constructor Summary
ActionCell(java.lang.String message, ActionCell.Delegate<C> delegate)
          Construct a new ActionCell.
 
Method Summary
 boolean consumesEvents()
          Returns true if the cell is interested in browser events.
 java.lang.Void onBrowserEvent(Element parent, C value, java.lang.Object viewData, NativeEvent event, ValueUpdater<C> valueUpdater)
          Handle a browser event that took place within the cell.
 void render(C value, java.lang.Object viewData, java.lang.StringBuilder sb)
          Render a cell as HTML into a StringBuilder, suitable for passing to Element.setInnerHTML(java.lang.String) on a container element.
 
Methods inherited from class com.google.gwt.cell.client.AbstractCell
dependsOnSelection, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionCell

public ActionCell(java.lang.String message,
                  ActionCell.Delegate<C> delegate)
Construct a new ActionCell.

Parameters:
message - the message to display on the button
delegate - the delegate that will handle events
Method Detail

consumesEvents

public boolean consumesEvents()
Description copied from interface: Cell
Returns true if the cell is interested in browser events. The default implementation returns false.

Specified by:
consumesEvents in interface Cell<C>
Overrides:
consumesEvents in class AbstractCell<C>

onBrowserEvent

public java.lang.Void onBrowserEvent(Element parent,
                                     C value,
                                     java.lang.Object viewData,
                                     NativeEvent event,
                                     ValueUpdater<C> valueUpdater)
Description copied from interface: Cell
Handle a browser event that took place within the cell. The default implementation returns null.

Specified by:
onBrowserEvent in interface Cell<C>
Overrides:
onBrowserEvent in class AbstractCell<C>
Parameters:
parent - the parent Element
value - the value associated with the cell
viewData - the view data associated with the cell, or null
event - the native browser event
valueUpdater - a ValueUpdater, or null
Returns:
a view data object which may be the one passed in or a new object

render

public void render(C value,
                   java.lang.Object viewData,
                   java.lang.StringBuilder sb)
Description copied from interface: Cell
Render a cell as HTML into a StringBuilder, suitable for passing to Element.setInnerHTML(java.lang.String) on a container element.

Specified by:
render in interface Cell<C>
Specified by:
render in class AbstractCell<C>
Parameters:
value - the cell value to be rendered
viewData - view data associated with the cell
sb - the StringBuilder to be written to