Class ClickableRenderer<T,​W extends com.google.gwt.user.client.ui.Widget>

  • Type Parameters:
    T - the presentation (column) type
    W - the widget type
    All Implemented Interfaces:
    com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.shared.EventHandler, Renderer<T>
    Direct Known Subclasses:
    ButtonRenderer, ImageRenderer, MultiSelectionRenderer

    public abstract class ClickableRenderer<T,​W extends com.google.gwt.user.client.ui.Widget>
    extends WidgetRenderer<T,​W>
    implements com.google.gwt.event.dom.client.ClickHandler
    An abstract superclass for renderers that render clickable widgets. Click handlers can be added to a renderer to listen to click events emitted by all widgets rendered by the renderer.
    Since:
    7.4
    Author:
    Vaadin Ltd
    • Constructor Detail

      • ClickableRenderer

        public ClickableRenderer()
    • Method Detail

      • createWidget

        public abstract W createWidget()
        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.

        Implementation note: It is the implementing method's responsibility to add this as a click handler of the returned widget, or a widget nested therein, in order to make click events propagate properly to handlers registered via addClickHandler.

        Specified by:
        createWidget in class WidgetRenderer<T,​W extends com.google.gwt.user.client.ui.Widget>
        Returns:
        widget to attach to a cell. All returned instances should be new widget instances without a parent.
      • addClickHandler

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

        Note that the row type of the click handler must match the row type of the containing Grid.

        Parameters:
        handler - the click handler to be added
      • onClick

        public void onClick​(com.google.gwt.event.dom.client.ClickEvent event)
        Specified by:
        onClick in interface com.google.gwt.event.dom.client.ClickHandler