Package com.storedobject.ui.inventory
Class GRN
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<InventoryGRN>
- All Implemented Interfaces:
Executable,Reentrant,FilterMethods<InventoryGRN>,HasLogic,ObjectLoader<InventoryGRN>,ObjectSearcher<InventoryGRN>,ObjectSetter<InventoryGRN>,ObjectsSetter<InventoryGRN>,EditableDataGrid<InventoryGRN>,ObjectEditorListener,ObjectGridData<InventoryGRN,,InventoryGRN> ObjectLoader<InventoryGRN>,Transactional,ViewFilterSupport<InventoryGRN>,ClickHandler,ExecutableView,HasColumns<InventoryGRN>,SupportWindowMode,ValueChangeHandler,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<InventoryGRN>>,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<InventoryGRN>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<InventoryGRN>>,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<InventoryGRN>,,com.vaadin.flow.component.grid.GridSortOrder<InventoryGRN>> com.vaadin.flow.data.provider.HasDataGenerators<InventoryGRN>,com.vaadin.flow.data.provider.HasDataView<InventoryGRN,,Void, com.vaadin.flow.component.grid.dataview.GridDataView<InventoryGRN>> com.vaadin.flow.data.provider.HasLazyDataView<InventoryGRN,,Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<InventoryGRN>> com.vaadin.flow.data.provider.HasListDataView<InventoryGRN,,com.vaadin.flow.component.grid.dataview.GridListDataView<InventoryGRN>> Serializable,Iterable<InventoryGRN>,Runnable,Collection<InventoryGRN>,EventListener,Consumer<InventoryGRN>,List<InventoryGRN>,SequencedCollection<InventoryGRN>
GRN - Create, edit and process GRNs.
- Author:
- Syam
- See Also:
-
Nested Class Summary
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.SpringData, 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
-
Constructor Summary
ConstructorsConstructorDescriptionGRN()Constructor.GRN(int actions) Constructor.GRN(int type, int actions) Constructor.Constructor.GRN(int type, InventoryStore store) Constructor.GRN(int type, InventoryStore store, int actions) Constructor.GRN(int type, InventoryStore store, int actions, String caption) Constructor.Constructor.GRN(InventoryStore store) Constructor.GRN(InventoryStore store, int actions) Constructor.GRN(InventoryStore store, int actions, String caption) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures and adds additional buttons to the user interface.protected voidThis method will be invoked if the "Cancel" button is pressed on the anchor form.protected voidThis method is invoked when anchor values are set via the anchor form, and if any exception is thrown from this method, anchor values will be asked again.protected booleancanFinalize(InventoryGRN grn) This method is invoked when the button is pressed to mark the GRN as inspected/received.booleancanRowEdit(InventoryGRN item) Determines if the specified row can be edited based on the given item.booleanvoidCreate extra header rows if required here by invokingHasColumns.prependHeader()orHasColumns.appendHeader()(typically useful for creating column grouping etc.).protected final ObjectEditor<InventoryGRN> Creates and returns an instance of ObjectEditor for managing the editing of objects of type T.voiddoAdd()Executes the add operation by checking whether the operation is allowed using the canAdd method.voiddoDelete(InventoryGRN object) Deletes the specified object if it is not null.voiddoEdit(InventoryGRN object) Edits the specified object if it is editable.voiddoView(InventoryGRN object) Handles the view operation for the given object.getColumnCaption(String columnName) Get the text to display in the header.Get the current "ORDER BY" clause.intgetRelativeColumnWidth(String columnName) This method is invoked when the real column is created to determine the relative width of the column.booleanincludeColumn(String columnName) Determines the respective column should be created or note.voidloaded()This method will be invoked whenever data is loaded.voidprocessGRN(InventoryGRN grn) voidsetAllowSwitchStore(boolean allowSwitchStore) voidsetSource(String label, Class<?> browserClass, Class<? extends StoredObject> soClass) voidsetStore(InventoryStore store) voidsetStore(InventoryStore store, boolean allowSwitchStore) suppliers(int type) Create a supplier list for the given type of GRN.voidviewGRN(InventoryGRN grn) Methods inherited from class com.storedobject.ui.ObjectBrowser
actionAllowed, anchorFieldsCreated, canAdd, cancelRowEdit, clicked, close, constructObjectEditor, create, create, create, create, create, create, create, createEditor, createExtraButtons, createHeader, doReport, editRow, executeAnchorForm, extraInfoCreated, extraInfoLoaded, filterActions, getEditingItem, getLogic, getObjectEditor, getRowEditor, getSearchBuilder, getViewComponent, isColumnEditable, isReadOnly, isSearchMode, listMoreButtons, load, load, postLedger, resetAnchor, rowDoubleClicked, saveEditedRow, savingExtraInfo, selected, setCaption, setExitAction, setLogic, setObjectEditor, setReadOnly, setSplitView, streamEditableFields, validateAnchorValuesMethods inherited from class com.storedobject.ui.ObjectGrid
search, setObjectSetterMethods inherited from class com.storedobject.ui.ObjectListGrid
addObjectChangedListener, configure, createListDataProvider, doDeleteAction, doInsertAction, doUndeleteAction, doUpdateAction, getApplication, getDataProvider, getDelegatedLoader, isValid, load, load, removeObjectChangedListener, setProcessor, setViewFilterMethods inherited from class com.storedobject.ui.DataGrid
append, canAllowAction, doAppendAction, doReloadAction, doReloadAllAction, getActionPrefix, getObjectClass, itemAppended, itemDeleted, itemInserted, itemReloaded, itemUndeleted, itemUpdated, load, selected, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItems, sort, sort, validateAppend, validateDelete, validateInsert, validateReload, validateUndelete, validateUpdateMethods inherited from class com.storedobject.vaadin.ListGrid
add, add, addAll, addAll, addViewFilter, clear, clearViewFilters, contains, containsAll, get, getData, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, onAttach, onDetach, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, setData, size, subList, toArray, toArrayMethods inherited from class com.storedobject.vaadin.DataGrid
addConstructedListener, appendFooter, clearConstructedListeners, getColumnByKey, getColumns, getSOGrid, isColumnReorderingAllowed, setColumnReorderingAllowed, streamConstructedListenersMethods 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, createSortingComparator, deselect, deselectAll, getAriaLabel, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByInternalId, 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, getTooltipPosition, 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, setItemSelectableProvider, setItemsPageable, setItemsPageable, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setTooltipPosition, setUniqueKeyProperty, setUniqueKeyProvider, updateSelectionModeOnClientMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.ui.EditableDataGrid
canDelete, canEdit, canPostLedger, canViewLedgerMethods inherited from interface com.storedobject.common.Executable
actMethods inherited from interface com.storedobject.vaadin.ExecutableView
abort, clean, createMenuItem, error, execute, execute, getMenuIconName, getMenuItem, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.storedobject.core.FilterMethods
getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setLoadFilter, setLoadFilter, setViewFilter, setViewFilterMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.storedobject.vaadin.HasColumns
addConstructedListener, addItemSelectedListener, addItemsSelectedListener, appendFooter, appendHeader, clearAlerts, clearConstructedListeners, compact, configure, constructed, createColumn, createColumn, createColumn, createColumn, createColumn, createComponentColumn, createDecoratedWindow, createFooters, createHierarchyColumn, createHTMLColumn, createHTMLHierarchyColumn, createView, customizeColumn, customizeRenderer, deselect, deselect, executing, getApplication, getCaption, getColumn, getColumnCount, getColumnDetail, getColumnFunction, getColumnHeaderComponent, getColumnMethodName, getColumnNames, getColumnOrder, getColumnSorter, getColumnTemplate, getConfigureButton, getDataClass, getDefinedColumnCount, getFixedColumnWidth, getMenuItem, getObjectRendered, getObjectUnwrapped, getRenderedColumnNames, getSelected, getSOGrid, getTextAlign, getView, ignoreCaseForColumnSorting, isColumnFrozen, isColumnResizable, isColumnSortable, isColumnVisible, prependFooter, prependHeader, refresh, refresh, refresh, removeItemSelectedListener, render, select, select, setColumnFrozen, setColumnResizable, setColumnVisible, setMethodHandlerHost, sort, sort, sortOrder, sortOrder, streamConstructedListeners, unwrapMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, reversed, spliteratorMethods inherited from interface com.storedobject.ui.ObjectEditorListener
editingCancelled, editingEnded, editingStartedMethods inherited from interface com.storedobject.ui.ObjectGridData
convert, createSearchBuilder, deselect, deselectAll, doLoad, getEntityFilter, getItem, getLoadFilter, getObjectClass, getObjectCount, getSelectionModel, isAllowAny, populate, populate, populate, resetSearch, scrollTo, search, search, search, select, setLoadFilter, setObject, setObjectConsumer, setObjectConsumer, setObjects, setSelectionMode, validateFilterConditionMethods inherited from interface com.storedobject.core.ObjectLoader
applyFilter, canContain, clear, getAllowAny, getLinkType, getMaster, getObjectClass, isAllowAny, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, reload, setLinkType, setLinkType, setMaster, setMaster, setOrderBy, setOrderByMethods inherited from interface com.storedobject.ui.ObjectLoader
addDataLoadedListener, applyFilterPredicate, clear, get, getCacheLevel, getDelegatedLoader, getEffectiveCondition, getFixedFilter, getLoadFilter, getObjectCount, indexOf, load, setExtraFilter, setExtraFilter, setFilter, setFilter, setFixedFilter, setFixedFilter, setFixedFilter, setFixedFilter, size, streamAll, streamFilteredMethods inherited from interface com.storedobject.core.ObjectSetter
accept, setObjectMethods inherited from interface com.storedobject.common.Reentrant
isReentrantMethods inherited from interface com.storedobject.vaadin.util.SupportWindowMode
createWindowMethods inherited from interface com.storedobject.ui.Transactional
commit, execute, getTransactionManager, run, transact, transact, transactControl, transactControl, transactControl, transactControlMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChangedMethods inherited from interface com.storedobject.ui.util.ViewFilterSupport
configure, configure, configureMatch, filterView, getViewFilter
-
Constructor Details
-
GRN
public GRN()Constructor. -
GRN
-
GRN
Constructor.- Parameters:
actions- Allowed edit actions (SeeEditorAction).caption- Caption.
-
GRN
Constructor. -
GRN
Constructor.- Parameters:
actions- Allowed edit actions (SeeEditorAction).
-
GRN
Constructor.- Parameters:
store- Store.actions- Allowed edit actions (SeeEditorAction).caption- Caption.
-
GRN
Constructor.- Parameters:
classNames- Class names to be used. "Class Name of P/N|Store Name".
-
GRN
public GRN(int type, int actions) Constructor.- Parameters:
type- Type.actions- Allowed edit actions (SeeEditorAction).
-
GRN
Constructor.- Parameters:
type- Type.actions- Allowed edit actions (SeeEditorAction).caption- Caption.
-
GRN
-
GRN
Constructor.- Parameters:
type- Type.actions- Allowed edit actions (SeeEditorAction).
-
GRN
Constructor.- Parameters:
type- Type.actions- Allowed edit actions (SeeEditorAction).caption- Caption.
-
-
Method Details
-
setAllowSwitchStore
public void setAllowSwitchStore(boolean allowSwitchStore) -
setStore
-
setStore
-
processGRN
-
viewGRN
-
getRelativeColumnWidth
Description copied from interface:HasColumnsThis method is invoked when the real column is created to determine the relative width of the column. It can be any positive integer and applied relative to the values returned for other columns. A value of zero means that the column width is fixed.Note: This is set to the column via the
Grid.Column.setFlexGrow(int)method. So, if you directly use theGrid.Column.setFlexGrow(int)method, this can be overridden.- Parameters:
columnName- Name of the column.- Returns:
- The default implementation returns -1, meaning the value should not be applied.
-
canRowEdit
Description copied from class:ObjectBrowserDetermines if the specified row can be edited based on the given item.- Overrides:
canRowEditin classObjectBrowser<InventoryGRN>- Parameters:
item- the object representing the row to check for edit capability- Returns:
- true if the row can be edited, false otherwise
-
createHeaders
public void createHeaders()Description copied from interface:HasColumnsCreate extra header rows if required here by invokingHasColumns.prependHeader()orHasColumns.appendHeader()(typically useful for creating column grouping etc.). The default implementation does nothing. This is invoked beforeHasColumns.createHeader(). -
getColumnCaption
Description copied from interface:HasColumnsGet 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 a header. By default, it tries to determine this from the Application Environment.
-
createObjectEditor
Description copied from class:ObjectBrowserCreates and returns an instance of ObjectEditor for managing the editing of objects of type T. This method can be overridden by subclasses to provide specific editor implementations.- Overrides:
createObjectEditorin classObjectBrowser<InventoryGRN>- Returns:
- an instance of ObjectEditor for the generic type T, or null if no implementation is provided.
-
addExtraButtons
protected void addExtraButtons()Description copied from class:ObjectBrowserConfigures and adds additional buttons to the user interface. This method is intended to be overridden by subclasses to provide specific behavior or additional UI elements. Subclasses can use this method to enhance the default layout with custom buttons based on their requirements. The base implementation does not add any buttons.- Overrides:
addExtraButtonsin classObjectBrowser<InventoryGRN>
-
includeColumn
Description copied from interface:HasColumnsDetermines the respective column should be created or note. This is useful when columns are autogenerated, but you want to eliminate some columns.- Parameters:
columnName- Column name- Returns:
- Default implementation returns true for all columns.
-
getOrderBy
Description copied from interface:ObjectLoaderGet the current "ORDER BY" clause.- Returns:
- Current "ORDER BY" clause.
-
doAdd
public void doAdd()Description copied from class:ObjectBrowserExecutes the add operation by checking whether the operation is allowed using the canAdd method. If canAdd returns true, it retrieves the object editor and performs the addObject operation with the current view. This method is typically used to manage the addition of objects in the specified context. The addObject operation is delegated to the object editor, and the view serves as the object representation to be added.- Overrides:
doAddin classObjectBrowser<InventoryGRN>
-
doEdit
Description copied from class:ObjectBrowserEdits the specified object if it is editable.- Overrides:
doEditin classObjectBrowser<InventoryGRN>- Parameters:
object- the object to be edited, must not be null and must be editable
-
doView
Description copied from class:ObjectBrowserHandles the view operation for the given object. If the provided object is not null, it uses the object editor to display the object in the specified view.- Overrides:
doViewin classObjectBrowser<InventoryGRN>- Parameters:
object- the object to be viewed; must not be null to trigger the view operation
-
doDelete
Description copied from class:ObjectBrowserDeletes the specified object if it is not null. After deletion, checks whether the object has been successfully removed and displays a confirmation message if deleted.- Overrides:
doDeletein classObjectBrowser<InventoryGRN>- Parameters:
object- the object to be deleted; if null, no action is taken
-
anchorsSet
protected void anchorsSet()Description copied from class:ObjectBrowserThis method is invoked when anchor values are set via the anchor form, and if any exception is thrown from this method, anchor values will be asked again.- Overrides:
anchorsSetin classObjectBrowser<InventoryGRN>
-
anchorsCancelled
protected void anchorsCancelled()Description copied from class:ObjectBrowserThis method will be invoked if the "Cancel" button is pressed on the anchor form.- Overrides:
anchorsCancelledin classObjectBrowser<InventoryGRN>
-
suppliers
-
canFinalize
This method is invoked when the button is pressed to mark the GRN as inspected/received. This method may show appropriate messages and may returnfalseif some other associated data is incomplete.- Parameters:
grn- Current GRN.- Returns:
- True/false.
-
loaded
public void loaded()Description copied from class:ObjectListGridThis method will be invoked whenever data is loaded.- Overrides:
loadedin classObjectListGrid<InventoryGRN>
-
canSearch
public boolean canSearch() -
setSource
-