com.vaadin.flow.component.gridpro.
Class GridPro<E>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.grid.Grid<E>
-
- com.vaadin.flow.component.gridpro.GridPro<E>
-
All Implemented Interfaces:
AttachNotifier, BlurNotifier<Grid<E>>, DetachNotifier, Focusable<Grid<E>>, FocusNotifier<Grid<E>>, HasElement, HasEnabled, HasSize, HasStyle, HasTheme, HasDataProvider<E>, HasItems<E>, SortEvent.SortNotifier<Grid<E>,GridSortOrder<E>>, HasDataGenerators<E>, Serializable
@Tag(value="vaadin-grid-pro") @HtmlImport(value="frontend://bower_components/vaadin-grid-pro/src/vaadin-grid-pro.html") @HtmlImport(value="frontend://bower_components/vaadin-grid-pro/src/vaadin-grid-pro-edit-column.html") public class GridPro<E> extends Grid<E>
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
GridPro.EditColumn<T>
Server-side component for the
<vaadin-grid-edit-column>
element.static class
GridPro.ItemPropertyChangedEvent<E>
Event fired when the user starts to edit an existing item.
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
Grid.AbstractGridExtension<T>, Grid.Column<T>, Grid.DataCommunicatorBuilder<T,U extends ArrayUpdater>, Grid.SelectionMode, Grid.UpdateQueue
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component>
-
-
Constructor Summary
Constructors Constructor and Description GridPro()
Creates a new instance, with page size of 50.
GridPro(Class<E> beanType)
Instantiates a new CrudGrid for the supplied bean type.
GridPro(int pageSize)
Creates a new instance, with the specified page size.
-
Method Summary
All Methods Modifier and Type Method and Description EditColumnConfigurator<E>
addEditColumn(Renderer<E> renderer)
Adds a new edit column to this
GridPro
with a renderer.EditColumnConfigurator<E>
addEditColumn(String propertyName)
Adds a new edit column for the given property name.
EditColumnConfigurator<E>
addEditColumn(ValueProvider<E,?> valueProvider)
Adds a new edit column to this
GridPro
with a value provider.Registration
addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
Registers a listener to be notified when the user starts to edit an existing item.
protected GridPro.EditColumn<E>
createEditColumn(Renderer<E> renderer, String columnId)
Creates a new edit column instance for this
GridPro
instance.boolean
getEnterNextRow()
Gets the value of the webcomponent's property enterNextRow.
boolean
getKeepEditorOpen()
Gets the value of the webcomponent's property keepEditorOpen.
void
setEnterNextRow(boolean enterNextRow)
Sets the value of the webcomponent's property enterNextRow.
void
setKeepEditorOpen(boolean keepEditorOpen)
Sets the value of the webcomponent's property keepEditorOpen.
-
Methods inherited from class com.vaadin.flow.component.grid.Grid
addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getArrayUpdater, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumns, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getEditor, getFooterRows, getHeaderRows, getPageSize, getPropertySet, getSelectedItems, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isHeightByRows, isMultiSort, isVerticalScrollingEnabled, onDataProviderChange, onEnabledStateChanged, prependFooterRow, prependHeaderRow, removeAllColumns, removeColumn, removeColumnByKey, removeColumnLayer, removeDataGenerator, removeThemeVariants, select, setClassNameGenerator, setColumnKey, setColumnReorderingAllowed, setColumns, setDataProvider, setDetailsVisible, setDetailsVisibleOnClick, setHeightByRows, setItemDetailsRenderer, setMultiSort, setPageSize, setSelectionMode, setSelectionModel, setSortableColumns, setUniqueKeyProperty, setUniqueKeyProvider, setVerticalScrollingEnabled, sort, updateSelectionModeOnClient
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, 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.data.binder.HasDataProvider
setItems
-
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.HasSize
getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
-
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
-
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
-
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
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.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Constructor Detail
-
GridPro
public GridPro(Class<E> beanType)
Instantiates a new CrudGrid for the supplied bean type.
Parameters:
beanType
- the beanType for the item
-
GridPro
public GridPro()
Creates a new instance, with page size of 50.
-
GridPro
public GridPro(int pageSize)
Creates a new instance, with the specified page size.
The page size influences the
Query.getLimit()
sent by the client, but it's up to the webcomponent to determine the actual query limit, based on the height of the component and scroll position. Usually the limit is 3 times the page size (e.g. 150 items with a page size of 50).Parameters:
pageSize
- the page size. Must be greater than zero.
-
-
Method Detail
-
addEditColumn
public EditColumnConfigurator<E> addEditColumn(ValueProvider<E,?> valueProvider)
Adds a new edit column to this
GridPro
with a value provider.Parameters:
valueProvider
- the value providerReturns:
an edit column configurer for configuring the column editor
See Also:
Grid.addColumn(ValueProvider)
,EditColumnConfigurator.text(ItemUpdater)
,EditColumnConfigurator.checkbox(ItemUpdater)
,EditColumnConfigurator.select(ItemUpdater, List)
,Grid.removeColumn(Column)
-
addEditColumn
public EditColumnConfigurator<E> addEditColumn(Renderer<E> renderer)
Adds a new edit column to this
GridPro
with a renderer.Parameters:
renderer
- the renderer used to create the grid cell structureReturns:
an edit column configurer for configuring the column editor
See Also:
Grid.addColumn(Renderer)
,EditColumnConfigurator.text(ItemUpdater)
,EditColumnConfigurator.checkbox(ItemUpdater)
,EditColumnConfigurator.select(ItemUpdater, List)
,Grid.removeColumn(Column)
-
addEditColumn
public EditColumnConfigurator<E> addEditColumn(String propertyName)
Adds a new edit column for the given property name.
Note: This method can only be used for a Grid created from a bean type with
GridPro(Class)
.Parameters:
propertyName
- the property name of the new column, notnull
Returns:
and edit column configurer for configuring the column editor
See Also:
Grid.addColumn(String)
,EditColumnConfigurator.text(ItemUpdater)
,EditColumnConfigurator.checkbox(ItemUpdater)
,EditColumnConfigurator.select(ItemUpdater, List)
,Grid.removeColumn(Column)
-
setEnterNextRow
public void setEnterNextRow(boolean enterNextRow)
Sets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).
Parameters:
enterNextRow
- whentrue
, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row)
-
getEnterNextRow
@Synchronize(value="enter-next-row-changed") public boolean getEnterNextRow()
Gets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).
Returns:
enterNextRow value
-
setKeepEditorOpen
public void setKeepEditorOpen(boolean keepEditorOpen)
Sets the value of the webcomponent's property keepEditorOpen. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused in edit mode.
Parameters:
keepEditorOpen
- whentrue
, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused in edit mode
-
getKeepEditorOpen
@Synchronize(value="keep-editor-open-changed") public boolean getKeepEditorOpen()
Gets the value of the webcomponent's property keepEditorOpen. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused in edit mode.
Returns:
keepEditorOpen value
-
createEditColumn
protected GridPro.EditColumn<E> createEditColumn(Renderer<E> renderer, String columnId)
Creates a new edit column instance for this
GridPro
instance.This method must not return
null
.Parameters:
renderer
- the renderer used to create the grid cell structurecolumnId
- internal column idReturns:
edit column instance
See Also:
-
addItemPropertyChangedListener
public Registration addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
Registers a listener to be notified when the user starts to edit an existing item.
Parameters:
listener
- a listener to be notifiedReturns:
a handle that can be used to unregister the listener
-
-