public class GridConnector extends AbstractListingConnector implements HasComponentsConnector, SimpleManagedLayout, DeferredWorker
SIGNIFICANT_MOVE_THRESHOLD| Constructor and Description |
|---|
GridConnector() |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(ColumnConnector.CustomColumn column,
String id)
Adds a column to the Grid widget.
|
com.google.gwt.event.shared.HandlerRegistration |
addConnectorHierarchyChangeHandler(ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler handler)
Adds a handler that is called whenever the child hierarchy of this
connector has been updated by the server.
|
protected void |
detailsRefreshed(boolean detailsShown)
Method called for a row details refresh.
|
List<ComponentConnector> |
getChildComponents()
Returns the child components for this connector.
|
ColumnConnector.CustomColumn |
getColumn(String columnId)
Gets the column corresponding to the given string identifier.
|
String |
getColumnId(Grid.Column<?,?> column)
Gets the string identifier of the given column in this grid.
|
GridState |
getState()
Returns the shared state object for this connector.
|
TooltipInfo |
getTooltipInfo(com.google.gwt.dom.client.Element element)
Gets the tooltip info for the given element.
|
Grid<elemental.json.JsonObject> |
getWidget()
Returns the widget associated with this paintable.
|
boolean |
hasTooltip()
Check whether there might be a tooltip for this component.
|
protected void |
init()
Called when the connector has been initialized.
|
boolean |
isWorkPending()
Checks whether there are operations pending for this widget or connector
that must be executed before reaching a steady state.
|
void |
layout() |
void |
onColumnRendererChanged(ColumnConnector.CustomColumn column)
Method called by
CustomColumn when its renderer changes. |
void |
onStateChanged(StateChangeEvent stateChangeEvent)
Notifies the event handler that the state has changed.
|
void |
onUnregister()
Event called when connector has been unregistered.
|
void |
removeColumnMapping(ColumnConnector.CustomColumn column)
Removes the given column from mappings in this Connector.
|
protected void |
sendContextClickEvent(MouseEventDetails details,
com.google.gwt.dom.client.EventTarget eventTarget)
This method sends the context menu event to the server-side.
|
void |
setChildComponents(List<ComponentConnector> children)
Sets the children for this connector.
|
void |
setDataSource(DataSource<elemental.json.JsonObject> dataSource)
Sets the data source for this Connector.
|
protected void |
singleDetailsOpened(int rowIndex)
Method target for when one single details has been updated and we might
need to scroll it into view.
|
void |
updateCaption(ComponentConnector connector)
Update child components caption, description and error message.
|
protected void |
updateColumns()
Updates the widgets columns to match the map in this connector.
|
getDataSource, getRowData, getRowKey, isRowSelectedisReadOnly, isRequiredIndicatorVisible, updateWidgetStyleNamescreateWidget, delegateCaptionHandling, flush, getIcon, getIconUri, getLayoutManager, isErrorIndicatorVisible, isRealUpdate, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, onDragSourceAttached, onDragSourceDetached, onDropTargetAttached, onDropTargetDetached, registerTouchHandlers, setWidgetEnabled, setWidgetStyleName, setWidgetStyleNameWithPrefix, shouldHandleLongTap, unregisterTouchHandlers, updateComponentSize, updateComponentSize, updateEnabledState, updateWidgetSizeaddStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getParent, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, isEnabled, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, unregisterRpcclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelegateCaptionHandling, flush, getLayoutManager, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, setWidgetEnabledaddStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getRpcImplementations, getTag, hasEventListener, isEnabled, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, updateEnabledStategetConnectorIdpublic String getColumnId(Grid.Column<?,?> column)
column - the column whose id to getpublic ColumnConnector.CustomColumn getColumn(String columnId)
columnId - the id of the column to getpublic Grid<elemental.json.JsonObject> getWidget()
AbstractComponentConnectorgetWidget in interface HasWidgetgetWidget in class AbstractComponentConnectorprotected void detailsRefreshed(boolean detailsShown)
detailsShown - True if any details were set visibleprotected void singleDetailsOpened(int rowIndex)
rowIndex - index of updated rowprotected void init()
AbstractConnectorinit in class AbstractConnectorpublic void onStateChanged(StateChangeEvent stateChangeEvent)
StateChangeEvent.StateChangeHandleronStateChanged in interface StateChangeEvent.StateChangeHandleronStateChanged in class AbstractComponentConnectorstateChangeEvent - the state change event with details about the changepublic void setDataSource(DataSource<elemental.json.JsonObject> dataSource)
HasDataSourcesetDataSource in interface HasDataSourcesetDataSource in class AbstractListingConnectordataSource - the new data source, not nullpublic void addColumn(ColumnConnector.CustomColumn column, String id)
column - column to addid - communication idprotected void updateColumns()
public void removeColumnMapping(ColumnConnector.CustomColumn column)
column - column to remove from the mappingpublic void onColumnRendererChanged(ColumnConnector.CustomColumn column)
CustomColumn when its renderer changes. This
method is used to maintain hierarchical renderer wrap in
TreeGrid.column - the column which now has a new rendererpublic void onUnregister()
ServerConnectoronUnregister in interface ServerConnectoronUnregister in class AbstractComponentConnectorpublic boolean isWorkPending()
DeferredWorkerisWorkPending in interface DeferredWorkerpublic void layout()
layout in interface SimpleManagedLayoutpublic void updateCaption(ComponentConnector connector)
HasComponentsConnectorEach component is responsible for maintaining its caption, description and error message. In most cases components doesn't want to do that and those elements reside outside of the component. Because of this layouts must provide service for it's childen to show those elements for them.
updateCaption in interface HasComponentsConnectorconnector - Child component for which service is requested.public List<ComponentConnector> getChildComponents()
HasComponentsConnector
The children for this connector are defined as all HasComponentss
whose parent is this HasComponentsConnector.
Note that the method ServerConnector.getChildren() can return a
larger list of children including both the child components and any
extensions registered for the connector.
getChildComponents in interface HasComponentsConnectorpublic void setChildComponents(List<ComponentConnector> children)
HasComponentsConnector
Note that calling this method does not call
ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler.onConnectorHierarchyChange(ConnectorHierarchyChangeEvent)
. The event method is called only when the hierarchy has been updated for
all connectors.
Note that this method is separate from
ServerConnector.setChildren(List) and contains only child
components. Both methods are called separately by the framework if the
connector implements HasComponentsConnector.
setChildComponents in interface HasComponentsConnectorchildren - The new child connectors (components only)public com.google.gwt.event.shared.HandlerRegistration addConnectorHierarchyChangeHandler(ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler handler)
HasComponentsConnectoraddConnectorHierarchyChangeHandler in interface HasComponentsConnectorhandler - The handler that should be added.public GridState getState()
AbstractConnectorgetState in interface ComponentConnectorgetState in interface ServerConnectorgetState in class AbstractListingConnectorpublic boolean hasTooltip()
ComponentConnectorComponentConnector.getTooltipInfo(Element)) if this method returns true.
This is only done to optimize performance, so in cases where the status
is not known, it's safer to return true so that there will
be a tooltip handler even though it might not be needed in all cases.
hasTooltip in interface ComponentConnectorhasTooltip in class AbstractComponentConnectortrue if some part of the component might have a
tooltip, otherwise falsepublic TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element)
ComponentConnector
When overriding this method, ComponentConnector.hasTooltip() should also be
overridden to return true in all situations where this
method might return a non-empty result.
getTooltipInfo in interface ComponentConnectorgetTooltipInfo in class AbstractComponentConnectorelement - The element to lookup a tooltip forprotected void sendContextClickEvent(MouseEventDetails details, com.google.gwt.dom.client.EventTarget eventTarget)
AbstractComponentConnectorsendContextClickEvent in class AbstractComponentConnectordetails - the mouse event detailseventTarget - the target of the eventCopyright © 2023 Vaadin Ltd. All rights reserved.