T
- the type of the associated gridpublic class MultiSelectionRenderer<T> extends ClickableRenderer<Boolean,com.google.gwt.user.client.ui.CheckBox>
ClickableRenderer.RendererClickEvent<R>, ClickableRenderer.RendererClickHandler<R>
Constructor and Description |
---|
MultiSelectionRenderer(Grid<T> grid) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.user.client.ui.CheckBox |
createWidget()
Creates a widget to attach to a cell.
|
void |
destroy()
Called when the renderer is deemed to be destroyed and no longer used by
the Grid.
|
Collection<String> |
getConsumedEvents()
Returns the events that the renderer should consume.
|
protected boolean |
isSelected(int logicalRow) |
boolean |
onBrowserEvent(CellReference<?> cell,
com.google.gwt.dom.client.NativeEvent event)
Called whenever a registered event is triggered in the column the
renderer renders.
|
void |
render(RendererCellReference cell,
Boolean data,
com.google.gwt.user.client.ui.CheckBox checkBox)
Renders a cell with a widget.
|
protected void |
setSelected(int logicalRow,
boolean select) |
addClickHandler, onClick
getWidget, getWidget, init, render
destroy, onActivate, setContentVisible
public void destroy()
ComplexRenderer
destroy
in class ComplexRenderer<Boolean>
public com.google.gwt.user.client.ui.CheckBox createWidget()
ClickableRenderer
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
.
createWidget
in class ClickableRenderer<Boolean,com.google.gwt.user.client.ui.CheckBox>
public void render(RendererCellReference cell, Boolean data, com.google.gwt.user.client.ui.CheckBox checkBox)
WidgetRenderer
For optimal performance, work done in this method should be kept to a
minimum since it will be called continuously while the user is scrolling.
The renderer can use Widget.setLayoutData(Object)
to store cell
data that might be needed in e.g. event listeners.
render
in class WidgetRenderer<Boolean,com.google.gwt.user.client.ui.CheckBox>
cell
- The cell to render. Note that the cell is a flyweight and
should not be stored and used outside of this method as its
contents will change.data
- the data of the cellcheckBox
- the widget embedded in the cellpublic Collection<String> getConsumedEvents()
ComplexRenderer
#onBrowserEvent(Cell, NativeEvent)
when they occur.getConsumedEvents
in class ComplexRenderer<Boolean>
BrowserEvents
public boolean onBrowserEvent(CellReference<?> cell, com.google.gwt.dom.client.NativeEvent event)
ComplexRenderer
The events that triggers this needs to be returned by the
ComplexRenderer.getConsumedEvents()
method.
Returns boolean telling if the event has been completely handled and should not cause any other actions.
onBrowserEvent
in class ComplexRenderer<Boolean>
cell
- Object containing information about the cell the event was
triggered on.event
- The original DOM eventprotected boolean isSelected(int logicalRow)
protected void setSelected(int logicalRow, boolean select)
Copyright © 2023 Vaadin Ltd. All rights reserved.