Package com.storedobject.ui
Class QueryGrid
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<QueryGrid.QueryResult>
- All Implemented Interfaces:
ClickHandler
,ExecutableView
,HasColumns<QueryGrid.QueryResult>
,SupportWindowMode
,ValueChangeHandler
,com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<QueryGrid.QueryResult>>
,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<QueryGrid.QueryResult>>
,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<QueryGrid.QueryResult>>
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.component.HasTheme
,com.vaadin.flow.component.HasValue.ValueChangeListener
,com.vaadin.flow.data.event.SortEvent.SortNotifier<com.vaadin.flow.component.grid.Grid<QueryGrid.QueryResult>,
,com.vaadin.flow.component.grid.GridSortOrder<QueryGrid.QueryResult>> com.vaadin.flow.data.provider.HasDataGenerators<QueryGrid.QueryResult>
,com.vaadin.flow.data.provider.HasDataView<QueryGrid.QueryResult,
,Void, com.vaadin.flow.component.grid.dataview.GridDataView<QueryGrid.QueryResult>> com.vaadin.flow.data.provider.HasLazyDataView<QueryGrid.QueryResult,
,Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<QueryGrid.QueryResult>> com.vaadin.flow.data.provider.HasListDataView<QueryGrid.QueryResult,
,com.vaadin.flow.component.grid.dataview.GridListDataView<QueryGrid.QueryResult>> Serializable
,Iterable<QueryGrid.QueryResult>
,Runnable
,Collection<QueryGrid.QueryResult>
,EventListener
,List<QueryGrid.QueryResult>
,SequencedCollection<QueryGrid.QueryResult>
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Query result corresponding to a row of the grid.Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>, com.vaadin.flow.component.grid.Grid.Column<T>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T,
U extends com.vaadin.flow.data.provider.ArrayUpdater>, com.vaadin.flow.component.grid.Grid.MultiSortPriority, com.vaadin.flow.component.grid.Grid.NestedNullBehavior, com.vaadin.flow.component.grid.Grid.SelectionMode, com.vaadin.flow.component.grid.Grid.UpdateQueue 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.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<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.storedobject.vaadin.HasColumns
HasColumns.SOGrid<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ButtonLayout
protected Button
protected Button
protected Button
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.Constructor.Constructor.Constructor.Constructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionconvertValue
(Object value, int columnIndex) Convert the value for a given column for displaying it on the grid.com.vaadin.flow.component.Component
You can have a "header row" (as the first row) that covers the whole grid.getColumnCaption
(int columnIndex) Get the caption for the column.getColumnCaption
(String columnName) Get the text to display in the header.int
getColumnOrder
(String columnName) Return value from this method determines the order in which columns are displayed.com.vaadin.flow.component.grid.ColumnTextAlign
getTextAlign
(int columnIndex) Get the alignment of the column values.getView
(boolean create) Get the View.boolean
includeColumn
(int columnIndex) Whether to include the given column in the grid or not.void
load()
Load the data from the result set if it is not already loaded.void
Load the grid with more rows from another result set.protected void
onAttach
(com.vaadin.flow.component.AttachEvent attachEvent) void
Reload the grid with another result set.void
setPDFPageOrientation
(int pageOrientation) Set the orientation fo the PDF report.Methods inherited from class com.storedobject.vaadin.ListGrid
add, add, addAll, addAll, addViewFilter, clear, clearViewFilters, contains, containsAll, createListDataProvider, get, getData, getDataProvider, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, onDetach, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, setData, setViewFilter, size, sort, subList, toArray, toArray
Methods inherited from class com.storedobject.vaadin.DataGrid
addConstructedListener, appendFooter, clearConstructedListeners, getColumnByKey, getColumns, getSOGrid, isColumnReorderingAllowed, setColumnReorderingAllowed, streamConstructedListeners
Methods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getAriaLabel, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnLayers, getColumnRendering, getDataCommunicator, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getEmptyStateComponent, getEmptyStateText, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onDataProviderChange, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToItem, scrollToStart, select, setAllRowsVisible, setAriaLabel, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumns, setDataProvider, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setEmptyStateComponent, setEmptyStateText, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setItemSelectableProvider, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClient
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, removeFromParent, scrollIntoView, 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.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
Methods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClicked
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.storedobject.vaadin.ExecutableView
abort, clean, clicked, close, createMenuItem, error, execute, execute, getMenuIconName, getMenuItem, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, trackValueChange, tray, valueChanged, warning
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
Methods inherited from interface com.storedobject.vaadin.HasColumns
addItemSelectedListener, addItemsSelectedListener, appendHeader, clearAlerts, compact, configure, constructed, createColumn, createColumn, createColumn, createColumn, createColumn, createComponentColumn, createDecoratedWindow, createFooters, createHeaders, createHierarchyColumn, createHTMLColumn, createHTMLHierarchyColumn, createView, customizeColumn, customizeRenderer, deselect, deselect, executing, getApplication, getCaption, getColumn, getColumnCount, getColumnDetail, getColumnFunction, getColumnHeaderComponent, getColumnMethodName, getColumnNames, getColumnSorter, getColumnTemplate, getConfigureButton, getDataClass, getDefinedColumnCount, getFixedColumnWidth, getMenuItem, getObjectRendered, getObjectUnwrapped, getRelativeColumnWidth, getSelected, getTextAlign, getViewComponent, ignoreCaseForColumnSorting, includeColumn, isColumnFrozen, isColumnResizable, isColumnSortable, isColumnVisible, prependFooter, prependHeader, refresh, refresh, refresh, removeItemSelectedListener, render, select, select, setCaption, setColumnFrozen, setColumnResizable, setColumnVisible, setMethodHandlerHost, sort, sort, sortOrder, sortOrder, unwrap
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItems
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 java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, reversed, spliterator
Methods inherited from interface com.storedobject.vaadin.util.SupportWindowMode
createWindow
Methods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Field Details
-
buttonPanel
-
pdf
-
excel
-
exit
-
-
Constructor Details
-
QueryGrid
Constructor.- Parameters:
query
- Query to be used to populate the grid.
-
QueryGrid
Constructor.- Parameters:
query
- Query to be used to populate the grid.actions
- Action (As specified inEditorAction
). OnlyEditorAction.PDF
,EditorAction.SEARCH
andEditorAction.EXCEL
are valid.
-
QueryGrid
Constructor.- Parameters:
resultSet
- SQL result set to be used to populate the grid.
-
QueryGrid
Constructor.- Parameters:
resultSet
- SQL result set to be used to populate the grid.actions
- Action (As specified inEditorAction
). OnlyEditorAction.PDF
,EditorAction.SEARCH
andEditorAction.EXCEL
are valid.
-
QueryGrid
-
QueryGrid
Constructor.- Parameters:
caption
- Caption.query
- Query to be used to populate the grid.actions
- Action (As specified inEditorAction
). OnlyEditorAction.PDF
andEditorAction.EXCEL
are valid.
-
QueryGrid
-
QueryGrid
Constructor.- Parameters:
caption
- Caption.resultSet
- SQL result set to be used to populate the grid.actions
- Action (As specified inEditorAction
). OnlyEditorAction.PDF
andEditorAction.EXCEL
are valid.
-
-
Method Details
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttach
in classListGrid<QueryGrid.QueryResult>
-
load
public void load()Load the data from the result set if it is not already loaded. -
reload
Reload the grid with another result set. Existing entries will be cleared.Warning: The result set should contain the same number and type of columns that was already set.
- Parameters:
resultSet
- Result set from which entries to be reloaded.
-
load
Load the grid with more rows from another result set.Warning: The result set should contain the same number and type of columns that was already set.
- Parameters:
resultSet
- Result set from which entries to be reloaded.
-
getView
Description copied from interface:ExecutableView
Get the View. Create it if it doesn't exist.- Parameters:
create
- Whether to create or not.- Returns:
- View.
-
createHeader
public com.vaadin.flow.component.Component createHeader()Description copied from interface:HasColumns
You can have a "header row" (as the first row) that covers the whole grid. Typically, such a row is to show your own buttons or components to customize the grid. The default implementation returns null and thus, no such row is created. (Please note thatHasColumns.createHeaders()
} is invoked before this method for adding other header rows just above the main header row. This may be used for column grouping etc.)- Returns:
- Component to be used as the "header row".
-
getColumnCaption
Description copied from interface:HasColumns
Get the text to display in the header. This will be invoked only ifHasColumns.getColumnHeaderComponent(java.lang.String)
returns null.- Parameters:
columnName
- Column name- Returns:
- Text to display as header. By default, it tries to determine this from the Application Environment.
-
getColumnCaption
Get the caption for the column.- Parameters:
columnIndex
- Index of the column.- Returns:
- Caption.
-
getColumnOrder
Description copied from interface:HasColumns
Return value from this method determines the order in which columns are displayed. Numbers do not have to be continuous, columns with lower numbers are displayed first.- Parameters:
columnName
- Column name.- Returns:
- An integer number that denotes the column order.
-
includeColumn
public boolean includeColumn(int columnIndex) Whether to include the given column in the grid or not.- Parameters:
columnIndex
- Column index.- Returns:
- True/false. Default implementation returns
true
.
-
convertValue
-
getTextAlign
public com.vaadin.flow.component.grid.ColumnTextAlign getTextAlign(int columnIndex) Get the alignment of the column values.- Parameters:
columnIndex
- Column index.- Returns:
- If null is returned, default alignment will be determined from the value (not from the converted value).
-
setPDFPageOrientation
public void setPDFPageOrientation(int pageOrientation) Set the orientation fo the PDF report. The parameter can bePDF.ORIENTATION_LANDSCAPE
orPDF.ORIENTATION_PORTRAIT
.- Parameters:
pageOrientation
- Orientation.
-