Class ItemGrid<T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
-
- com.vaadin.flow.component.customfield.CustomField<T>
-
- org.vaadin.miki.superfields.itemgrid.ItemGrid<T>
-
- Type Parameters:
T- Type of item stored in the grid.
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T>,com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T>,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.data.binder.HasItems<T>,Serializable,HasHelperPositionable,HasId,WithHelperMixin<ItemGrid<T>>,WithHelperPositionableMixin<ItemGrid<T>>,WithIdMixin<ItemGrid<T>>,WithItemsMixin<T,ItemGrid<T>>,WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T,ItemGrid<T>>
@Tag("item-grid") public class ItemGrid<T> extends com.vaadin.flow.component.customfield.CustomField<T> implements com.vaadin.flow.data.binder.HasItems<T>, com.vaadin.flow.component.HasStyle, WithItemsMixin<T,ItemGrid<T>>, WithIdMixin<ItemGrid<T>>, WithHelperMixin<ItemGrid<T>>, WithHelperPositionableMixin<ItemGrid<T>>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T,ItemGrid<T>>Grid of items, with defined number of columns. Each cell in the grid corresponds to a single element from the underlying collection of data. Note: currently this is not lazy-loading the data and not reacting to changes in the underlying data set.- Since:
- 2020-04-14
- Author:
- miki
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_COLUMN_COUNTDefault number of columns.static StringDEFAULT_SELECTED_ITEM_CLASS_NAMEStyle that by default indicates a selected item.-
Fields inherited from interface org.vaadin.miki.markers.HasHelperPositionable
HELPER_ABOVE_THEME_VARIANT
-
-
Constructor Summary
Constructors Constructor Description ItemGrid(CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)Creates the component with givenCellGenerator,CellSelectionHandlerand items.ItemGrid(CellGenerator<T> generator, T... items)Creates the component with given items andCellGenerator, but with defaultCellSelectionHandler.ItemGrid(T... items)Creates the component with given items, using defaultCellGeneratorandCellSelectionHandler.ItemGrid(T defaultValue, Supplier<C> mainContainerSupplier, CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)Creates the component with givenCellGenerator,CellSelectionHandlerand items, overriding default (empty) value.ItemGrid(T defaultValue, CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)Creates the component with givenCellGenerator,CellSelectionHandlerand items, overriding default (empty) value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanarePaddingCellsClickable()Checks whether the padding cells (if any present) are clickable.protected CellInformation<T>buildPaddingCell(int row, int column)protected CellInformation<T>buildValueCell(T item, int row, int column)protected voidclickCell(CellInformation<T> information)Reacts to cell being clicked in the browser.static <V> com.vaadin.flow.component.ComponentdefaultCellGenerator(V item, int row, int col)DefaultCellGenerator.static <V> voiddefaultCellSelectionHandler(CellSelectionEvent<V> event)DefaultCellSelectionHandler.static com.vaadin.flow.component.html.DivdefaultMainContainerSupplier()Default supplier for the main layout of the grid.static com.vaadin.flow.component.html.DivdefaultRowComponentGenerator(int rowNumber)DefaultRowComponentGenerator.protected TgenerateModelValue()Stream<com.vaadin.flow.component.Component>getCellComponents()Returns aStreamof allComponents in the cells.CellGenerator<T>getCellGenerator()Returns currentCellGeneratorused to generate cells.List<CellInformation<T>>getCellInformation()Returns a list with information about each cell.Optional<CellInformation<T>>getCellInformation(int row, int column)ReturnsCellInformationthat corresponds to the cell of given coordinates.Optional<CellInformation<T>>getCellInformation(T value)ReturnsCellInformationthat corresponds to the provided value.CellSelectionHandler<T>getCellSelectionHandler()Returns currentCellSelectionHandlerused to react to selection changes.List<CellInformation<T>>getColumnCellInformation(int column)Returns a list withCellInformationfor each cell in given column.intgetColumnCount()Returns the current number of columns.CellGenerator<T>getPaddingCellGenerator()Returns the cell generator used for constructing padding cells.List<CellInformation<T>>getRowCellInformation(int row)Returns a list withCellInformationfor each cell in given row.RowComponentGenerator<?>getRowComponentGenerator()Returns currentRowComponentGenerator.longgetRowCount()Returns the number of rows (even incomplete) currently in the grid.RowPaddingStrategygetRowPaddingStrategy()Returns currentRowPaddingStrategy.Optional<CellInformation<T>>getSelectedCellInformation()ReturnsCellInformationabout currently selected cell.protected voidregisterClickEvents(CellInformation<T> information)Adds a click listener to the dom element of theComponentinside givenCellInformation.protected voidrepaintAllItems()Repaints all current items.protected voidrepaintAllItems(Collection<T> itemCollection)Repaints all items in the collection.voidsetCellGenerator(CellGenerator<T> cellGenerator)Sets newCellGenerator.voidsetCellSelectionHandler(CellSelectionHandler<T> cellSelectionHandler)Sets newCellSelectionHandler.voidsetColumnCount(int columnCount)Sets the new number of columns.voidsetItems(Collection<T> collection)voidsetPaddingCellGenerator(CellGenerator<T> paddingCellGenerator)Sets cell generator for padding cells.voidsetPaddingCellsClickable(boolean paddingCellsClickable)Enables or disables click events on padding cells.protected voidsetPresentationValue(T t)voidsetRowComponentGenerator(RowComponentGenerator<?> rowComponentGenerator)Sets newRowComponentGeneratorinvoked every time a new row for grid cells is needed.voidsetRowPaddingStrategy(RowPaddingStrategy rowPaddingStrategy)Sets newRowPaddingStrategy.intsize()Returns the number of cells.ItemGrid<T>withCellGenerator(CellGenerator<T> generator)ChainssetCellGenerator(CellGenerator)and returns itself.ItemGrid<T>withCellSelectionHandler(CellSelectionHandler<T> handler)ChainssetCellSelectionHandler(CellSelectionHandler)and returns itself.ItemGrid<T>withColumnCount(int columnCount)ChainssetColumnCount(int)and returns itself.ItemGrid<T>withPaddingCellGenerator(CellGenerator<T> paddingCellGenerator)ChainssetPaddingCellGenerator(CellGenerator)and returns itself.ItemGrid<T>withPaddingCellsClickable(boolean paddingCellsClickable)ChainssetPaddingCellsClickable(boolean)and returns itself.ItemGrid<T>withRowComponentGenerator(RowComponentGenerator<?> generator)ChainssetRowComponentGenerator(RowComponentGenerator)and returns itself.ItemGrid<T>withRowPaddingStrategy(RowPaddingStrategy rowPaddingStrategy)ChainssetRowPaddingStrategy(RowPaddingStrategy)and returns itself.-
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getErrorMessage, getLabel, isInvalid, onAttach, remove, removeThemeVariants, setErrorMessage, setInvalid, setLabel, updateValue
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
-
Methods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
-
Methods inherited from interface org.vaadin.miki.markers.HasHelperPositionable
isHelperAbove, setHelperAbove, setHelperAbove, setHelperBelow
-
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
-
Methods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
Methods inherited from interface org.vaadin.miki.markers.WithHelperMixin
withHelperComponent, withHelperText
-
Methods inherited from interface org.vaadin.miki.markers.WithHelperPositionableMixin
withHelperAbove, withHelperAbove, withHelperBelow
-
Methods inherited from interface org.vaadin.miki.markers.WithIdMixin
withId
-
Methods inherited from interface org.vaadin.miki.markers.WithItemsMixin
withItems, withItems, withItems
-
Methods inherited from interface org.vaadin.miki.markers.WithValueMixin
withValue
-
-
-
-
Field Detail
-
DEFAULT_COLUMN_COUNT
public static final int DEFAULT_COLUMN_COUNT
Default number of columns.- See Also:
- Constant Field Values
-
DEFAULT_SELECTED_ITEM_CLASS_NAME
public static final String DEFAULT_SELECTED_ITEM_CLASS_NAME
Style that by default indicates a selected item. This is only needed when defaultsetCellSelectionHandler(CellSelectionHandler)is used.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ItemGrid
@SafeVarargs public ItemGrid(T... items)
Creates the component with given items, using defaultCellGeneratorandCellSelectionHandler.- Parameters:
items- Items to add to the component.
-
ItemGrid
@SafeVarargs public ItemGrid(CellGenerator<T> generator, T... items)
Creates the component with given items andCellGenerator, but with defaultCellSelectionHandler.- Parameters:
generator-CellGeneratorto use.items- Items to add to the component.
-
ItemGrid
@SafeVarargs public ItemGrid(CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)
Creates the component with givenCellGenerator,CellSelectionHandlerand items.- Parameters:
generator-CellGeneratorto use.handler-CellSelectionHandlerto use.items- Items to add to the component.
-
ItemGrid
@SafeVarargs public ItemGrid(T defaultValue, CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)
Creates the component with givenCellGenerator,CellSelectionHandlerand items, overriding default (empty) value.- Parameters:
defaultValue- Default (empty) value.generator-CellGeneratorto use.handler-CellSelectionHandlerto use.items- Items to add to the component.
-
ItemGrid
@SafeVarargs public ItemGrid(T defaultValue, Supplier<C> mainContainerSupplier, CellGenerator<T> generator, CellSelectionHandler<T> handler, T... items)
Creates the component with givenCellGenerator,CellSelectionHandlerand items, overriding default (empty) value.- Type Parameters:
C- Type parameter to ensuremainContainerSupplierprovides aComponentthat alsoHasComponents.- Parameters:
defaultValue- Default (empty) value.mainContainerSupplier- Method to generate main container component.generator-CellGeneratorto use.handler-CellSelectionHandlerto use.items- Items to add to the component.
-
-
Method Detail
-
defaultCellSelectionHandler
public static <V> void defaultCellSelectionHandler(CellSelectionEvent<V> event)
DefaultCellSelectionHandler. It adds or removesDEFAULT_SELECTED_ITEM_CLASS_NAMEto the element of the component.- Type Parameters:
V- Value type.- Parameters:
event- Event.
-
defaultMainContainerSupplier
public static com.vaadin.flow.component.html.Div defaultMainContainerSupplier()
Default supplier for the main layout of the grid.- Returns:
- A
Div.
-
defaultCellGenerator
public static <V> com.vaadin.flow.component.Component defaultCellGenerator(V item, int row, int col)- Type Parameters:
V- Item type.- Parameters:
item- Item to generate component for.row- Row in the grid.col- Column in the grid.- Returns:
- A
Span:<span>item</span>.
-
defaultRowComponentGenerator
public static com.vaadin.flow.component.html.Div defaultRowComponentGenerator(int rowNumber)
DefaultRowComponentGenerator. It produces aDiv.- Parameters:
rowNumber- Number of the row to create.- Returns:
- A
Div.
-
repaintAllItems
protected final void repaintAllItems()
Repaints all current items.
-
buildPaddingCell
protected final CellInformation<T> buildPaddingCell(int row, int column)
-
buildValueCell
protected final CellInformation<T> buildValueCell(T item, int row, int column)
-
repaintAllItems
protected void repaintAllItems(Collection<T> itemCollection)
Repaints all items in the collection.- Parameters:
itemCollection- Collection with items to repaint.
-
registerClickEvents
protected void registerClickEvents(CellInformation<T> information)
Adds a click listener to the dom element of theComponentinside givenCellInformation. This click listener will select or deselect a cell and update the value of this grid. Note: when overriding this method, please remember to callsuper.- Parameters:
information- Information. Nevernull.
-
clickCell
protected void clickCell(CellInformation<T> information)
Reacts to cell being clicked in the browser. This method is invoked for padding cells ifarePaddingCellsClickable()istrue.- Parameters:
information- Information about the clicked cell.
-
generateModelValue
protected T generateModelValue()
- Specified by:
generateModelValuein classcom.vaadin.flow.component.customfield.CustomField<T>
-
setPresentationValue
protected void setPresentationValue(T t)
- Specified by:
setPresentationValuein classcom.vaadin.flow.component.customfield.CustomField<T>
-
setCellGenerator
public void setCellGenerator(CellGenerator<T> cellGenerator)
Sets newCellGenerator. Repaints all items.- Parameters:
cellGenerator- Cell generator. Ifnullis passed,defaultCellGenerator(Object, int, int)will be used.
-
getCellGenerator
public CellGenerator<T> getCellGenerator()
Returns currentCellGeneratorused to generate cells.- Returns:
- A
CellGenerator. Nevernull.
-
withCellGenerator
public ItemGrid<T> withCellGenerator(CellGenerator<T> generator)
ChainssetCellGenerator(CellGenerator)and returns itself.- Parameters:
generator-CellGeneratorto use.- Returns:
- This.
- See Also:
setCellGenerator(CellGenerator)
-
setCellSelectionHandler
public void setCellSelectionHandler(CellSelectionHandler<T> cellSelectionHandler)
Sets newCellSelectionHandler. Repaints all items.- Parameters:
cellSelectionHandler- Cell selection handler. Ifnullis passed,defaultCellSelectionHandler(CellSelectionEvent)will be used.
-
getCellSelectionHandler
public CellSelectionHandler<T> getCellSelectionHandler()
Returns currentCellSelectionHandlerused to react to selection changes.- Returns:
- A
CellSelectionHandler. Nevernull.
-
withCellSelectionHandler
public ItemGrid<T> withCellSelectionHandler(CellSelectionHandler<T> handler)
ChainssetCellSelectionHandler(CellSelectionHandler)and returns itself.- Parameters:
handler-CellSelectionHandlerto use.- Returns:
- This.
- See Also:
setCellSelectionHandler(CellSelectionHandler)
-
getRowCount
public long getRowCount()
Returns the number of rows (even incomplete) currently in the grid.- Returns:
- The number of rows. This will change if new items are added or the number of columns changes.
- See Also:
setItems(Collection),HasItems.setItems(Object[]),HasItems.setItems(Stream),setColumnCount(int)
-
getColumnCount
public int getColumnCount()
Returns the current number of columns.- Returns:
- The number of columns in the grid.
-
setColumnCount
public void setColumnCount(int columnCount)
Sets the new number of columns. Repaints all items.- Parameters:
columnCount- Number of columns. Values less than1are replaced with1instead,
-
withColumnCount
public ItemGrid<T> withColumnCount(int columnCount)
ChainssetColumnCount(int)and returns itself.- Parameters:
columnCount- Number of columns.- Returns:
- This.
- See Also:
setColumnCount(int)
-
setItems
public void setItems(Collection<T> collection)
- Specified by:
setItemsin interfacecom.vaadin.flow.data.binder.HasItems<T>
-
size
public int size()
Returns the number of cells.- Returns:
- Number of cells.
-
getCellInformation
public List<CellInformation<T>> getCellInformation()
Returns a list with information about each cell.- Returns:
- A list with
CellInformation. Nevernull. Changes to the resulting object do not affect the grid.
-
getSelectedCellInformation
public Optional<CellInformation<T>> getSelectedCellInformation()
ReturnsCellInformationabout currently selected cell.- Returns:
- A
CellInformation, if any cell is currently selected.
-
getCellInformation
public Optional<CellInformation<T>> getCellInformation(T value)
ReturnsCellInformationthat corresponds to the provided value.- Parameters:
value- A value to look for.- Returns:
- A
CellInformation, if a cell corresponding to the provided value is available. - See Also:
HasItems.setItems(Object[]),setItems(Collection),HasItems.setItems(Stream)
-
getCellInformation
public Optional<CellInformation<T>> getCellInformation(int row, int column)
ReturnsCellInformationthat corresponds to the cell of given coordinates.- Parameters:
row- Row number (0-based).column- Column number (0-based).- Returns:
- A
CellInformation, if a cell corresponding to the given coordinates is available. - See Also:
setColumnCount(int),getColumnCount(),getRowCount()
-
getRowCellInformation
public List<CellInformation<T>> getRowCellInformation(int row)
Returns a list withCellInformationfor each cell in given row.- Parameters:
row- Row number, 0-based.- Returns:
- An unmodifiable list. May be empty.
-
getColumnCellInformation
public List<CellInformation<T>> getColumnCellInformation(int column)
Returns a list withCellInformationfor each cell in given column.- Parameters:
column- Column number, 0-based.- Returns:
- An unmodifiable list. May be empty.
-
getCellComponents
public Stream<com.vaadin.flow.component.Component> getCellComponents()
Returns aStreamof allComponents in the cells.- Returns:
- A
Stream. Nevernull. - See Also:
setCellGenerator(CellGenerator)
-
setRowComponentGenerator
public void setRowComponentGenerator(RowComponentGenerator<?> rowComponentGenerator)
Sets newRowComponentGeneratorinvoked every time a new row for grid cells is needed.- Parameters:
rowComponentGenerator-RowComponentGeneratorto use. Ifnullis passed, thendefaultRowComponentGenerator(int)will be used.
-
getRowComponentGenerator
public RowComponentGenerator<?> getRowComponentGenerator()
Returns currentRowComponentGenerator.- Returns:
- A
RowComponentGenerator. Nevernull.
-
withRowComponentGenerator
public ItemGrid<T> withRowComponentGenerator(RowComponentGenerator<?> generator)
ChainssetRowComponentGenerator(RowComponentGenerator)and returns itself.- Parameters:
generator- ARowComponentGeneratorto use.- Returns:
- This.
- See Also:
setRowComponentGenerator(RowComponentGenerator)
-
setRowPaddingStrategy
public void setRowPaddingStrategy(RowPaddingStrategy rowPaddingStrategy)
Sets newRowPaddingStrategy. Repaints all items.- Parameters:
rowPaddingStrategy- An implementation ofRowPaddingStrategy. Ifnullis passed,RowPaddingStrategies.NO_PADDINGwill be used.- See Also:
RowPaddingStrategies
-
getRowPaddingStrategy
public RowPaddingStrategy getRowPaddingStrategy()
Returns currentRowPaddingStrategy.- Returns:
- A
RowPaddingStrategycurrently assigned to this object. Defaults toRowPaddingStrategies.NO_PADDING. - See Also:
RowPaddingStrategies
-
withRowPaddingStrategy
public ItemGrid<T> withRowPaddingStrategy(RowPaddingStrategy rowPaddingStrategy)
ChainssetRowPaddingStrategy(RowPaddingStrategy)and returns itself.- Parameters:
rowPaddingStrategy- ARowPaddingStrategyto use.- Returns:
- This.
- See Also:
setRowPaddingStrategy(RowPaddingStrategy),RowPaddingStrategies
-
getPaddingCellGenerator
public CellGenerator<T> getPaddingCellGenerator()
Returns the cell generator used for constructing padding cells. If none present,getCellGenerator()will be used.- Returns:
- A generator for padding cells. Is used only when there is some
RowPaddingStrategyset. - See Also:
setRowPaddingStrategy(RowPaddingStrategy)
-
setPaddingCellGenerator
public void setPaddingCellGenerator(CellGenerator<T> paddingCellGenerator)
Sets cell generator for padding cells. Ifnullis passed,getCellGenerator()will be used.- Parameters:
paddingCellGenerator- A generator for padding cells. Is used only when there is someRowPaddingStrategyset.- See Also:
setRowPaddingStrategy(RowPaddingStrategy)
-
withPaddingCellGenerator
public ItemGrid<T> withPaddingCellGenerator(CellGenerator<T> paddingCellGenerator)
ChainssetPaddingCellGenerator(CellGenerator)and returns itself.- Parameters:
paddingCellGenerator- A generator for padding cells.- Returns:
- This.
- See Also:
setPaddingCellGenerator(CellGenerator)
-
arePaddingCellsClickable
public boolean arePaddingCellsClickable()
Checks whether the padding cells (if any present) are clickable.- Returns:
- Whether or not padding cells can be clicked. Defaults to
false.
-
setPaddingCellsClickable
public void setPaddingCellsClickable(boolean paddingCellsClickable)
Enables or disables click events on padding cells. Iftrue, clicking a padding cell turns value tonull.- Parameters:
paddingCellsClickable- Whether or not to allow padding cells to react to clicks.
-
withPaddingCellsClickable
public ItemGrid<T> withPaddingCellsClickable(boolean paddingCellsClickable)
ChainssetPaddingCellsClickable(boolean)and returns itself.- Parameters:
paddingCellsClickable- Whether or not to allow padding cells to react to clicks.- Returns:
- This.
- See Also:
setPaddingCellsClickable(boolean)
-
-