public abstract class UITableBase extends com.vaadin.ui.VerticalLayout implements UIComponentWithCustomScopes, UIComponentWithHints2, com.vaadin.ui.CustomTable.HeaderClickListener, com.vaadin.ui.CustomTable.ColumnGenerator, UIComponentShowingRecords, com.vaadin.ui.CustomTable.CellStyleGenerator
UIComponentContainer
yet it contains columns. However,
beware - if you let table implement UIComponentContainer, it could break several things, for example column hints would be applied two times.Modifier and Type | Class and Description |
---|---|
static class |
UITableBase.ComponentTuple |
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Modifier and Type | Field and Description |
---|---|
boolean |
dataDataset
True if the table is fed from a data dataset (or "Paged Collection" dataset), false if from a generic, query or type dataset.
|
Constructor and Description |
---|
UITableBase(UIComponentData componentData) |
Modifier and Type | Method and Description |
---|---|
UITableColumn |
addDynamicColumn(Variant.RecordVariant column)
INTERNAL API, DO NOT USE.
|
protected void |
applyColumnHints() |
boolean |
applyHint(String hintName,
Variant<Object> newValue,
Variant<Object> oldValue)
Applies the given hint to this component.
|
void |
attach() |
protected abstract void |
clearContent()
Should remove old data from the data container.
|
protected void |
clearData()
Removes all data and scopes.
|
protected UITableColumn |
createTableColumn(com.vaadin.ui.CustomTable vaadinTable,
UIComponentData componentData,
String columnId)
Creates new column component instance.
|
protected com.vaadin.ui.CustomTable |
createTableComponent()
Creates the table instance.
|
Object |
generateCell(com.vaadin.ui.CustomTable source,
Object itemId,
Object columnId) |
UITableColumn |
getColumn(String columnId) |
com.google.common.collect.ImmutableList<UITableColumn> |
getColumns()
Returns a list of columns, ordered as defined in the table.
|
UIComponentData |
getComponentData()
Returns the component definition (LSPS RecordHolder instance which is
subtype of "ui::Component") associated with this Vaadin component.
|
Map<Integer,Serializable> |
getCurrentData()
Returns map of all known data, mapping Item ID to the wrapped business data instance.
|
protected abstract AbstractDatasetVaadinAdapter |
getDatasetAdapter() |
com.vaadin.data.Container.Filterable |
getFilterable() |
com.vaadin.ui.Field<Object> |
getFilterComponentForColumn(int col) |
Integer |
getItemId(UIComponentScope scope) |
Set<UIComponent> |
getRefreshedComponents() |
UIComponentScope |
getScope(Integer itemId) |
Set<RecordHolder> |
getShownRecords()
Lists record instances currently displayed in the component's selection.
|
String |
getStyle(com.vaadin.ui.CustomTable source,
Object itemId,
Object propertyId) |
com.vaadin.ui.CustomTable |
getTable()
Returns the Vaadin Table component.
|
String |
getUnformattedHeaderCaption(String columnId)
Returns the unformatted column header (without any divs or spans).
|
com.vaadin.ui.AbstractComponent |
getWidget()
Returns the Vaadin widget which implements the UI part of this component.
|
void |
headerClick(com.vaadin.ui.CustomTable.HeaderClickEvent event) |
void |
initChildren(boolean isFirstLoad)
Should initialize all visible child components.
|
protected boolean |
isDataDataset() |
protected boolean |
isInferFilteringDisabled() |
IDataset |
newDataset()
Creates new dataset based on the value of the DATA property.
|
void |
onLoad(Collection<Object> data,
int startIndex)
Should be called when new data is loaded to the table datasource.
|
protected void |
onLoad(Collection<Object> data,
int startIndex,
boolean triggerEventProcessing)
Should be called when new data is loaded to the table datasource.
|
protected void |
onResetFilters(com.vaadin.ui.CustomTable table) |
protected void |
onTableSort(Object[] propertyId,
boolean[] ascending)
Simply call this when someone calls the
sort method on a Vaadin table. |
void |
refresh()
This method is called from LSPS rendering engine.
|
protected void |
refreshInt() |
void |
registerChildren()
Should register all child components in the screen.
|
boolean |
showPerformanceWarnings()
Checks if performance warnings are to be shown.
|
String |
toString() |
boolean |
unapplyHint(String hintName,
Variant<Object> oldValue)
The hint has been removed from the hint map.
|
void |
unregisterChildren()
Should unregister all child components in the screen.
|
void |
updateContextFor(UIComponentScope scope)
Updates context with all necessary values for the given scope.
|
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, addListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getExpandRatio, getMargin, getState, isSpacing, iterator, readDesign, removeComponent, removeLayoutClickListener, removeListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setExpandRatio, setMargin, setMargin, setSpacing, writeDesign
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addComponents, addListener, addListener, getComponentIterator, moveComponentsFrom, removeAllComponents, removeListener, removeListener
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
public final boolean dataDataset
public UITableBase(UIComponentData componentData)
componentData
- public final UITableColumn addDynamicColumn(Variant.RecordVariant column)
column
- the ui::TableColumnpublic UIComponentScope getScope(Integer itemId)
public Integer getItemId(UIComponentScope scope)
public com.google.common.collect.ImmutableList<UITableColumn> getColumns()
UIFieldNames.SHOWN
columns.public com.vaadin.ui.CustomTable getTable()
protected com.vaadin.ui.CustomTable createTableComponent()
protected final void onTableSort(Object[] propertyId, boolean[] ascending)
sort
method on a Vaadin table.propertyId
- sort by these property IDs, not null.ascending
- true if ascending, false if descending. Not null.protected final void onResetFilters(com.vaadin.ui.CustomTable table)
protected boolean isDataDataset()
protected UITableColumn createTableColumn(com.vaadin.ui.CustomTable vaadinTable, UIComponentData componentData, String columnId)
vaadinTable
- the Vaadin Table component, not null.componentData
- the column component data, not null.columnId
- the column ID, assigned to the column. Unique, modelingId is used whenever possible.protected void applyColumnHints()
public void attach()
attach
in interface com.vaadin.server.ClientConnector
attach
in interface com.vaadin.ui.Component
attach
in class com.vaadin.ui.AbstractComponent
protected void clearData()
clearContent()
.protected abstract void clearContent()
public void registerChildren()
UIRefreshHandler
UIScreen.registerUIComponent(UIComponent)
.registerChildren
in interface UIRefreshHandler
public void unregisterChildren()
UIRefreshHandler
UIScreen.unregisterUIComponent(UIComponent)
.unregisterChildren
in interface UIRefreshHandler
public void initChildren(boolean isFirstLoad)
UIRefreshHandler
UIComponents.initChildren(java.util.List, boolean)
.initChildren
in interface UIRefreshHandler
isFirstLoad
- value of field UIFieldNames.IS_FIRST_LOAD
of the created init eventpublic final void refresh()
UIComponent
UIComponentData.getHints()
.refresh
in interface UIComponent
protected void refreshInt()
public IDataset newDataset()
public Map<Integer,Serializable> getCurrentData()
public Set<RecordHolder> getShownRecords()
UIComponentShowingRecords
getShownRecords
in interface UIComponentShowingRecords
public void onLoad(Collection<Object> data, int startIndex)
data
- the data, not null. May contain nulls.startIndex
- protected void onLoad(Collection<Object> data, int startIndex, boolean triggerEventProcessing)
data
- the data, not null. May contain nulls.startIndex
- public Object generateCell(com.vaadin.ui.CustomTable source, Object itemId, Object columnId)
generateCell
in interface com.vaadin.ui.CustomTable.ColumnGenerator
public void updateContextFor(UIComponentScope scope)
UIComponentWithCustomScopes
updateContextFor
in interface UIComponentWithCustomScopes
public final UIComponentData getComponentData()
UIComponent
getComponentData
in interface UIComponent
public void headerClick(com.vaadin.ui.CustomTable.HeaderClickEvent event)
headerClick
in interface com.vaadin.ui.CustomTable.HeaderClickListener
public String getUnformattedHeaderCaption(String columnId)
Table.getColumnHeaders()
) may contain html elements
such as divs or spans, with custom CSS styles. Use this method to retrieve the original header caption as retrieved from the model.columnId
- the column ID, not null.
You can obtain the column ID for example by calling Table.getVisibleColumns()
. Note that column ID is always an instance of String -
you may cast the result of getVisibleColumns() safely.public final UITableColumn getColumn(String columnId)
public Set<UIComponent> getRefreshedComponents()
getRefreshedComponents
in interface UIRefreshHandler
public boolean applyHint(String hintName, Variant<Object> newValue, Variant<Object> oldValue)
UIComponentWithHints2
applyHint
in interface UIComponentWithHints2
hintName
- the hint name, not null.newValue
- variant containing the new hint value, never null, may contain null value.oldValue
- variant containing the previous hint value, never null, may contain null value if the hint was missing or the old value was null.public boolean unapplyHint(String hintName, Variant<Object> oldValue)
UIComponentWithHints2
unapplyHint
in interface UIComponentWithHints2
hintName
- the the hint name, not null.oldValue
- variant containing the previous hint value, never null, may contain null value if the old value was null.public com.vaadin.data.Container.Filterable getFilterable()
public com.vaadin.ui.Field<Object> getFilterComponentForColumn(int col)
public boolean showPerformanceWarnings()
protected boolean isInferFilteringDisabled()
public String getStyle(com.vaadin.ui.CustomTable source, Object itemId, Object propertyId)
getStyle
in interface com.vaadin.ui.CustomTable.CellStyleGenerator
protected abstract AbstractDatasetVaadinAdapter getDatasetAdapter()
public com.vaadin.ui.AbstractComponent getWidget()
UIComponent
getWidget
in interface UIComponent
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.