com.vaadin.v7.client.renderers.ButtonRenderer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-compatibility-client Show documentation
Show all versions of vaadin-compatibility-client Show documentation
Vaadin 7 compatibility package for Vaadin 8
/*
* Copyright (C) 2000-2023 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.v7.client.renderers;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.ui.Button;
import com.vaadin.v7.client.widget.grid.RendererCellReference;
/**
* 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 7.4
* @author Vaadin Ltd
*/
public class ButtonRenderer extends ClickableRenderer {
@Override
public Button createWidget() {
Button b = GWT.create(Button.class);
b.addClickHandler(this);
b.setStylePrimaryName("v-nativebutton");
return b;
}
@Override
public void render(RendererCellReference cell, String text, Button button) {
button.setText(text);
}
}