com.vaadin.client.ui.grid.renderers
Class ButtonRenderer<T>

java.lang.Object
  extended by com.vaadin.client.ui.grid.renderers.ComplexRenderer<T>
      extended by com.vaadin.client.ui.grid.renderers.WidgetRenderer<java.lang.String,Button>
          extended by com.vaadin.client.ui.grid.renderers.ButtonRenderer<T>
Type Parameters:
T - the row type
All Implemented Interfaces:
Renderer<java.lang.String>

public class ButtonRenderer<T>
extends WidgetRenderer<java.lang.String,Button>

A Renderer that displays buttons with textual captions. The values of the corresponding column are used as the captions. Click handlers can be added to the renderer, invoked when any of the rendered buttons is clicked.

Since:
Author:
Vaadin Ltd

Nested Class Summary
static class ButtonRenderer.RendererClickEvent<T>
          An event fired when a button rendered by a ButtonRenderer is clicked.
static interface ButtonRenderer.RendererClickHandler<T>
          A handler for renderer click events.
 
Constructor Summary
ButtonRenderer()
           
 
Method Summary
 com.google.web.bindery.event.shared.HandlerRegistration addClickHandler(ButtonRenderer.RendererClickHandler<T> handler)
          Adds a click handler to this button renderer.
 Button createWidget()
          Creates a widget to attach to a cell.
 void onClick(ClickEvent event)
           
 void render(FlyweightCell cell, java.lang.String text, Button button)
          Renders a cell with a widget.
 
Methods inherited from class com.vaadin.client.ui.grid.renderers.WidgetRenderer
getCell, getWidget, init, render
 
Methods inherited from class com.vaadin.client.ui.grid.renderers.ComplexRenderer
destroy, destroy, getConsumedEvents, onActivate, onBrowserEvent, setContentVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonRenderer

public ButtonRenderer()
Method Detail

createWidget

public Button createWidget()
Description copied from class: WidgetRenderer
Creates a widget to attach to a cell. The widgets will be attached to the cell after the cell element has been attached to DOM.

Specified by:
createWidget in class WidgetRenderer<java.lang.String,Button>
Returns:
widget to attach to a cell. All returned instances should be new widget instances without a parent.

render

public void render(FlyweightCell cell,
                   java.lang.String text,
                   Button button)
Description copied from class: WidgetRenderer
Renders a cell with a widget. This provides a way to update any information in the widget that is cell specific. Do not detach the Widget here, it will be done automatically by the Grid when the widget is no longer needed.

Specified by:
render in class WidgetRenderer<java.lang.String,Button>
Parameters:
cell - the cell to render
text - the data of the cell
button - the widget embedded in the cell

addClickHandler

public com.google.web.bindery.event.shared.HandlerRegistration addClickHandler(ButtonRenderer.RendererClickHandler<T> handler)
Adds a click handler to this button renderer. The handler is invoked every time one of the buttons rendered by this renderer is clicked.

Parameters:
handler - the click handler to be added

onClick

public void onClick(ClickEvent event)


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.