Package com.storedobject.ui
Class AbstractObjectForest<T extends StoredObject>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<Object>
com.vaadin.flow.component.treegrid.TreeGrid<Object>
- All Implemented Interfaces:
Executable,Reentrant,FilterMethods<T>,HasLogic,ObjectLoader<T>,ObjectSearcher<T>,ObjectSetter<T>,ObjectsSetter<T>,ObjectGridData<T,,Object> ObjectLoader<T>,Transactional,ChildVisitor<T,,Object> ClickHandler,ExecutableView,HasColumns<Object>,SupportWindowMode,ValueChangeHandler,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<Object>>,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<Object>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<Object>>,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<Object>,,com.vaadin.flow.component.grid.GridSortOrder<Object>> com.vaadin.flow.data.provider.HasDataGenerators<Object>,com.vaadin.flow.data.provider.HasDataView<Object,,Void, com.vaadin.flow.component.grid.dataview.GridDataView<Object>> com.vaadin.flow.data.provider.HasLazyDataView<Object,,Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<Object>> com.vaadin.flow.data.provider.HasListDataView<Object,,com.vaadin.flow.component.grid.dataview.GridListDataView<Object>> com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<Object>,Serializable,Runnable,EventListener,Consumer<T>
- Direct Known Subclasses:
BaseObjectForest
public abstract class AbstractObjectForest<T extends StoredObject>
extends DataTreeGrid<Object>
implements ObjectGridData<T,Object>, ChildVisitor<T,Object>
- 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> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractObjectForest(boolean large, boolean forViewing, Class<T> objectClass, Iterable<String> columns, boolean any) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeselectChildren(Object parent, boolean includeGrandChildren) Deselect all children of the parent item.Get the current Application.Caption used when displaying it in a View.getColumnCaption(String columnName) Get the text to display in the header.final ObjectForestProvider<T> final ObjectForestProvider<T> getItem(int index) final LogicgetLogic()Get the logic.Class of the object accepted.getRoot()<M extends StoredObject>
booleanCheck whether to hide the specified link or not.final booleanisColumnSortable(String columnName) Check if a particular column is sortable or not.Retrieves a list of root elements in the hierarchical structure.voidloaded()This will be invoked whenever a new set of rows are loaded via one of the "load" methods.voidvoidselectChildren(Object parent, boolean includeGrandChildren) Select all children of the parent item.voidsetKeepCache(boolean keepCache) voidSet the object.voidsetObjectSetter(ObjectSetter<T> setter) voidfinal voidsetRoots(ObjectIterator<T> roots) final voidstreamChildren(Object parent) Produces a stream of child elements for the given parent element.Sometimes the row object being rendered may be embedded in another object, and just before rendering the row's column details, it may have to be unwrapped.Methods inherited from class com.storedobject.vaadin.DataTreeGrid
addConstructedListener, addHierarchyColumn, appendFooter, clearConstructedListeners, createHierarchyColumn, createHTMLHierarchyColumn, getColumnByKey, getColumns, getSOGrid, isColumnReorderingAllowed, setColumnReorderingAllowed, streamConstructedListenersMethods inherited from class com.vaadin.flow.component.treegrid.TreeGrid
addCollapseListener, addComponentHierarchyColumn, addExpandListener, collapse, collapse, collapse, collapseRecursively, collapseRecursively, createDefaultArrayUpdater, expand, expand, expand, expandRecursively, expandRecursively, getDataCommunicator, getGenericDataView, getItemsWithChildrenRecursively, getLazyDataView, getListDataView, isExpanded, scrollToEnd, scrollToIndex, scrollToIndex, scrollToItem, setColumns, setDataProvider, setDataProvider, setHierarchyColumn, setHierarchyColumn, setItems, setItems, setItems, setItems, setItems, setUniqueKeyDataGeneratorMethods 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, createEditor, createSortingComparator, deselect, deselectAll, getAriaLabel, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByInternalId, getColumnLayers, getColumnRendering, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getEmptyStateComponent, getEmptyStateText, getFooterRows, getHeaderRows, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getTooltipPosition, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onAttach, onDataProviderChange, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scrollToStart, select, setAllRowsVisible, setAriaLabel, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumns, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setEmptyStateComponent, setEmptyStateText, setItemDetailsRenderer, setItems, setItems, setItemSelectableProvider, setItemsPageable, setItemsPageable, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setTooltipPosition, setUniqueKeyProperty, setUniqueKeyProvider, sort, 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.ui.util.ChildVisitor
listChildren, streamRoots, visitAll, visitAll, visitAll, visitAll, visitChildren, visitChildren, visitChildren, visitChildrenMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.common.Executable
actMethods 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, 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, createHeader, createHeaders, createHierarchyColumn, createHTMLColumn, createHTMLHierarchyColumn, createView, customizeColumn, customizeRenderer, deselect, deselect, executing, getColumn, getColumnCount, getColumnDetail, getColumnFunction, getColumnHeaderComponent, getColumnMethodName, getColumnNames, getColumnOrder, getColumnSorter, getColumnTemplate, getConfigureButton, getDataClass, getDefinedColumnCount, getFixedColumnWidth, getMenuItem, getObjectRendered, getObjectUnwrapped, getRelativeColumnWidth, getRenderedColumnNames, getSelected, getSOGrid, getTextAlign, getView, getViewComponent, ignoreCaseForColumnSorting, includeColumn, isColumnFrozen, isColumnResizable, isColumnVisible, prependFooter, prependHeader, refresh, refresh, refresh, removeItemSelectedListener, render, select, select, setCaption, setColumnFrozen, setColumnResizable, setColumnVisible, setMethodHandlerHost, sort, sort, sortOrder, sortOrder, streamConstructedListenersMethods 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.data.provider.hierarchy.HasHierarchicalDataProvider
getTreeData, setItems, setItems, setTreeDataMethods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView
setItemsMethods 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 com.storedobject.ui.ObjectGridData
canSearch, convert, createSearchBuilder, deselect, deselectAll, doLoad, getEntityFilter, getLoadFilter, getObjectCount, getSearchBuilder, getSelectionModel, isAllowAny, isSearchMode, populate, populate, populate, resetSearch, search, search, search, select, setLoadFilter, setObjectConsumer, setObjectConsumer, setObjects, setSelectionMode, validateFilterConditionMethods inherited from interface com.storedobject.core.ObjectLoader
applyFilter, canContain, clear, getAllowAny, getLinkType, getMaster, getOrderBy, load, load, 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, getEffectiveCondition, getFixedFilter, 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, setLogic, transact, transact, transactControl, transactControl, transactControl, transactControlMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
AbstractObjectForest
-
-
Method Details
-
getDelegatedLoader
- Specified by:
getDelegatedLoaderin interfaceObjectLoader<T extends StoredObject>
-
getDataProvider
- Specified by:
getDataProviderin interfacecom.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T extends StoredObject>- Overrides:
getDataProviderin classcom.vaadin.flow.component.treegrid.TreeGrid<Object>
-
getCaption
Description copied from interface:HasColumnsCaption used when displaying it in a View. If no caption was set using setCaption method, a label for the Bean's class is determined from the Application Environment.- Specified by:
getCaptionin interfaceExecutableView- Specified by:
getCaptionin interfaceHasColumns<T extends StoredObject>- Returns:
- Caption
-
setKeepCache
public void setKeepCache(boolean keepCache) -
get_Name
-
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.- Specified by:
getColumnCaptionin interfaceHasColumns<T extends StoredObject>- Parameters:
columnName- Column name- Returns:
- Text to display as a header. By default, it tries to determine this from the Application Environment.
-
isColumnSortable
Description copied from class:DataTreeGridCheck if a particular column is sortable or not. (By default, sorting is off.)- Specified by:
isColumnSortablein interfaceHasColumns<T extends StoredObject>- Overrides:
isColumnSortablein classDataTreeGrid<Object>- Parameters:
columnName- Column name- Returns:
- True or false.
-
getObjectClass
Description copied from interface:ObjectSetterClass of the object accepted. The default implementation returnsnull.- Specified by:
getObjectClassin interfaceObjectGridData<T extends StoredObject,Object> - Specified by:
getObjectClassin interfaceObjectLoader<T extends StoredObject>- Specified by:
getObjectClassin interfaceObjectSetter<T extends StoredObject>- Returns:
- Class of the object.
-
unwrap
Description copied from interface:HasColumnsSometimes the row object being rendered may be embedded in another object, and just before rendering the row's column details, it may have to be unwrapped. This method is invoked when the row is rendered and just before the rendering function is applied. The default implementation returns the same object.- Specified by:
unwrapin interfaceHasColumns<T extends StoredObject>- Parameters:
object- Currently rendered object.- Returns:
- Unwrapped object.
-
getLogic
-
getApplication
Description copied from interface:HasColumnsGet the current Application.- Specified by:
getApplicationin interfaceExecutableView- Specified by:
getApplicationin interfaceHasColumns<T extends StoredObject>- Returns:
- Current Application.
-
setRoot
-
loaded
public void loaded()This will be invoked whenever a new set of rows are loaded via one of the "load" methods. -
scrollTo
- Specified by:
scrollToin interfaceObjectGridData<T extends StoredObject,Object>
-
getRoot
-
listRoots
Description copied from interface:ChildVisitorRetrieves a list of root elements in the hierarchical structure. This method provides a collection of elements that serve as entry points or origins in the structure.- Specified by:
listRootsin interfaceChildVisitor<T extends StoredObject,Object> - Returns:
- a List of elements of type P representing the root elements
-
streamChildren
Description copied from interface:ChildVisitorProduces a stream of child elements for the given parent element. This allows traversal or processing of direct child elements in a hierarchical structure.- Specified by:
streamChildrenin interfaceChildVisitor<T extends StoredObject,Object> - Parameters:
parent- the parent element whose children are to be streamed- Returns:
- a stream of child elements directly associated with the specified parent
-
getItem
- Specified by:
getItemin interfaceObjectGridData<T extends StoredObject,Object>
-
setObject
Description copied from interface:ObjectSetterSet the object.- Specified by:
setObjectin interfaceObjectGridData<T extends StoredObject,Object> - Specified by:
setObjectin interfaceObjectSetter<T extends StoredObject>- Parameters:
object- Object to set.
-
setRoots
-
setRoots
-
setObjectSetter
- Specified by:
setObjectSetterin interfaceObjectGridData<T extends StoredObject,Object>
-
getSelectedObjects
-
selectChildren
Select all children of the parent item.- Parameters:
parent- Parent item.includeGrandChildren- Whether recursively include grand-children or not.
-
deselectChildren
Deselect all children of the parent item.- Parameters:
parent- Parent item.includeGrandChildren- Whether recursively include grand-children or not.
-
hideLink
Check whether to hide the specified link or not. By returningtruefrom this method, you can hide a child link.- Type Parameters:
M- Type of the master class.- Parameters:
masterClass- The master/parent class.linkName- Name of the link.- Returns:
- True/false. (Default is false).
-