Package com.storedobject.ui
Class ObjectTable<T extends StoredObject>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
org.vaadin.stefan.table.Table
com.storedobject.ui.ObjectTable<T>
- Type Parameters:
T- Type of the data object.
- All Implemented Interfaces:
FilterMethods<T>,ObjectLoader<T>,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable,org.vaadin.stefan.table.TableRowContainer
public class ObjectTable<T extends StoredObject>
extends org.vaadin.stefan.table.Table
implements ObjectLoader<T>
ObjectTable is similar to
ObjectGrid but instead of the Grid, it
uses Table to render the rows.
Note: Please note that ObjectTable is not a View but is a
Component. So, you set it as a Component
to a View like View.setComponent(Component).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionObjectTable(Class<T> objectClass) Constructor.ObjectTable(Class<T> objectClass, boolean any) Constructor.ObjectTable(Class<T> objectClass, Iterable<String> columns) Constructor.ObjectTable(Class<T> objectClass, Iterable<String> columns, boolean any) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method is invoked just before adding an object-row.voidThis method is called whenever a filter predicate is changed.voidclear()Clear - remove all entries.protected voidcustomizeCell(String columnName, T object, org.vaadin.stefan.table.TableDataCell cell) This method is invoked to customize the currently added cell.protected StringcustomizeCellValue(String columnName, T object, String cellValue) This method is invoked to get the customized value for a cell.protected voidcustomizeHeaderCell(String columnName, org.vaadin.stefan.table.TableHeaderCell cell) This method is invoked to customize the header cell.getColumnCaption(String columnName) Get the caption for the column.final intGet column count.getColumnFunction(String columnName) Get the function to obtain the cell value for the column.Get the load filter.Get the object class.final intGet the row-count.voidload(ObjectIterator<T> objectIterator) Load the given instances.protected voidThis method is invoked just after an object-row is added.final intsize()Get the number of object instances rendered.Methods inherited from class org.vaadin.stefan.table.Table
addBodies, addBody, addRow, addRows, addRows, getBodies, getBody, getBody, getCaption, getColumnGroup, getFoot, getHead, insertRow, insertRows, removeAllRows, removeBodies, removeBody, removeBody, removeCaption, removeColumnGroup, removeFoot, removeHead, removeRow, removeRows, replaceRow, setRow, streamRowsMethods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods 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, onAttach, onDetach, onEnabledStateChanged, 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.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.core.FilterMethods
getEffectiveCondition, getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setLoadFilter, setLoadFilter, setViewFilter, setViewFilterMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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.storedobject.core.ObjectLoader
applyFilter, canContain, getAllowAny, getLinkType, getMaster, getOrderBy, isAllowAny, 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 org.vaadin.stefan.table.TableRowContainer
getChildren, getRow, getRows
-
Constructor Details
-
ObjectTable
-
ObjectTable
-
ObjectTable
-
ObjectTable
-
-
Method Details
-
getColumnCaption
-
getObjectClass
Get the object class.- Specified by:
getObjectClassin interfaceObjectLoader<T extends StoredObject>- Returns:
- Object class.
-
getColumnFunction
-
getColumnCount
public final int getColumnCount()Get column count.- Returns:
- Colum count.
-
size
public final int size()Get the number of object instances rendered. The actual row-count may be different if extra rows are inserted. To get the actual row-count you may usegetRowCount().- Specified by:
sizein interfaceObjectLoader<T extends StoredObject>- Returns:
- Count of the object instances currently rendered.
-
getRowCount
public final int getRowCount()Get the row-count.- Returns:
- Number of rows.
-
clear
public void clear()Description copied from interface:ObjectLoaderClear - remove all entries.- Specified by:
clearin interfaceObjectLoader<T extends StoredObject>
-
load
Description copied from interface:ObjectLoaderLoad the given instances. Current "load filter" if set will be applied. However,ObjectLoader.getOrderBy()result will be ignored. Also, the value returned byObjectLoader.getAllowAny()will determine whether instanced of the subclasses to be restricted or not.- Specified by:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
objectIterator- Objects to be loaded.
-
applyFilterPredicate
public void applyFilterPredicate()Description copied from interface:FilterMethodsThis method is called whenever a filter predicate is changed. Methods with default implementation already invoke this method. If any of those methods are overridden, make sure that it invokes this method so that logic to handle filter changes can be coded here.Note: This method is used to show the filtered result of the existing entries
- Specified by:
applyFilterPredicatein interfaceFilterMethods<T extends StoredObject>
-
getLoadFilter
Description copied from interface:FilterMethodsGet the load filter.- Specified by:
getLoadFilterin interfaceFilterMethods<T extends StoredObject>- Returns:
- Current load filter.
-
addingRow
This method is invoked just before adding an object-row.- Parameters:
object- Object to add.
-
rowAdded
This method is invoked just after an object-row is added.- Parameters:
object- Object added.
-
customizeCellValue
-
customizeCell
-
customizeHeaderCell
This method is invoked to customize the header cell.- Parameters:
columnName- Column name.cell- Header cell that is currently added.
-