Class Grid
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.v7.ui.Grid
-
- All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier,MethodEventSource,ClientConnector,Sizeable,com.vaadin.shared.Connector,Component,Component.Focusable,HasComponents,SelectiveRenderer,FieldEvents.BlurNotifier,FieldEvents.FocusNotifier,ItemClickEvent.ItemClickNotifier,SelectionEvent.SelectionNotifier,SortEvent.SortNotifier,Serializable,Iterable<Component>
@Deprecated public class Grid extends AbstractComponent implements SelectionEvent.SelectionNotifier, SortEvent.SortNotifier, SelectiveRenderer, ItemClickEvent.ItemClickNotifier, Component.Focusable, FieldEvents.FocusNotifier, FieldEvents.BlurNotifier
Deprecated.As of 8.0 replaced byGridbased on the new data binding APIA grid component for displaying tabular data.Grid is always bound to a
Container.Indexed, but is not aContainerof any kind in of itself. The contents of the given Container is displayed with the help ofRenderers.Headers and Footers
Converters and Renderers
Each column has its own
Rendererthat displays data into something that can be displayed in the browser. That data is first converted with aConverterinto something that the Renderer can process. This can also be an implicit step - if a column has a simple data type, like a String, no explicit assignment is needed.Usually a renderer takes some kind of object, and converts it into a HTML-formatted string.
Grid grid = new Grid(myContainer); Column column = grid.getColumn(STRING_DATE_PROPERTY); column.setConverter(new StringToDateConverter()); column.setRenderer(new MyColorfulDateRenderer());Lazy Loading
The data is accessed as it is needed by Grid and not any sooner. In other words, if the given Container is huge, but only the first few rows are displayed to the user, only those (and a few more, for caching purposes) are accessed.
Selection Modes and Models
Grid supports three selection
modes(single, multi, none), and comes bundled with onemodelfor each of the modes. The distinction between a selection mode and selection model is as follows: a mode essentially says whether you can have one, many or no rows selected. The model, however, has the behavioral details of each. A single selection model may require that the user deselects one row before selecting another one. A variant of a multiselect might have a configurable maximum of rows that may be selected. And so on.Grid grid = new Grid(myContainer); // uses the bundled SingleSelectionModel class grid.setSelectionMode(SelectionMode.SINGLE); // changes the behavior to a custom selection model grid.setSelectionModel(new MyTwoSelectionModel());- Since:
- 7.4
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGrid.AbstractGridExtensionDeprecated.static classGrid.AbstractRenderer<T>Deprecated.static classGrid.AbstractSelectionModelDeprecated.static interfaceGrid.CellDescriptionGeneratorDeprecated.static classGrid.CellReferenceDeprecated.static interfaceGrid.CellStyleGeneratorDeprecated.static classGrid.ColumnDeprecated.static classGrid.ColumnReorderEventDeprecated.static interfaceGrid.ColumnReorderListenerDeprecated.static classGrid.ColumnResizeEventDeprecated.static interfaceGrid.ColumnResizeListenerDeprecated.static classGrid.ColumnVisibilityChangeEventDeprecated.static interfaceGrid.ColumnVisibilityChangeListenerDeprecated.static classGrid.CommitErrorEventDeprecated.classGrid.DefaultEditorErrorHandlerDeprecated.static classGrid.DetailComponentManagerDeprecated.static interfaceGrid.DetailsGeneratorDeprecated.static classGrid.EditorCloseEventDeprecated.static interfaceGrid.EditorErrorHandlerDeprecated.static classGrid.EditorEventDeprecated.static classGrid.EditorFieldFactoryDeprecated.static interfaceGrid.EditorListenerDeprecated.static classGrid.EditorMoveEventDeprecated.static classGrid.EditorOpenEventDeprecated.protected static classGrid.FooterDeprecated.static classGrid.FooterCellDeprecated.static classGrid.FooterRowDeprecated.static classGrid.GridContextClickEventDeprecated.protected static classGrid.HeaderDeprecated.static classGrid.HeaderCellDeprecated.static classGrid.HeaderRowDeprecated.static classGrid.MultiSelectionModelDeprecated.static classGrid.NoSelectionModelDeprecated.static interfaceGrid.RowDescriptionGeneratorDeprecated.static classGrid.RowReferenceDeprecated.static interfaceGrid.RowStyleGeneratorDeprecated.static classGrid.SelectionModeDeprecated.static interfaceGrid.SelectionModelDeprecated.static classGrid.SingleSelectionModelDeprecated.static classGrid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>Deprecated.-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description Grid()Deprecated.Creates a new Grid with a newIndexedContaineras the data source.Grid(Container.Indexed dataSource)Deprecated.Creates a new Grid using the given data source.Grid(String caption)Deprecated.Creates a new Grid with the given caption and a newIndexedContainerdata source.Grid(String caption, Container.Indexed dataSource)Deprecated.Creates a new Grid with the given caption and data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBlurListener(FieldEvents.BlurListener listener)Deprecated.Adds aBlurListenerto the Component which gets fired when aFieldloses keyboard focus.Grid.ColumnaddColumn(Object propertyId)Deprecated.Adds a new Column to Grid.Grid.ColumnaddColumn(Object propertyId, Class<?> type)Deprecated.Adds a new Column to Grid.protected voidaddColumnProperty(Object propertyId, Class<?> type, Object defaultValue)Deprecated.voidaddColumnReorderListener(Grid.ColumnReorderListener listener)Deprecated.Registers a new column reorder listener.voidaddColumnResizeListener(Grid.ColumnResizeListener listener)Deprecated.Registers a new column resize listener.voidaddColumnVisibilityChangeListener(Grid.ColumnVisibilityChangeListener listener)Deprecated.Registers a new column visibility change listener.voidaddFocusListener(FieldEvents.FocusListener listener)Deprecated.Adds aFocusListenerto the Component which gets fired when aFieldreceives keyboard focus.Grid.FooterRowaddFooterRowAt(int index)Deprecated.Inserts a new row at the given position to the footer section.Grid.HeaderRowaddHeaderRowAt(int index)Deprecated.Inserts a new row at the given position to the header section.voidaddItemClickListener(ItemClickEvent.ItemClickListener listener)Deprecated.Register a listener to handleItemClickEvents.voidaddListener(ItemClickEvent.ItemClickListener listener)Deprecated.ObjectaddRow(Object... values)Deprecated.Adds a row to the underlying container.voidaddSelectionListener(SelectionEvent.SelectionListener listener)Deprecated.Registers a new selection listener.com.vaadin.shared.RegistrationaddSortListener(SortEvent.SortListener listener)Deprecated.Adds a sort order change listener that gets notified when the sort order changes.Grid.FooterRowappendFooterRow()Deprecated.Adds a new row at the bottom of the footer section.Grid.HeaderRowappendHeaderRow()Deprecated.Adds a new row at the bottom of the header section.voidbeforeClientResponse(boolean initial)Deprecated.voidcancelEditor()Deprecated.Cancels the currently active edit if any.voidclearSortOrder()Deprecated.Clear the current sort order, and re-sort the grid.booleandeselect(Object itemId)Deprecated.Marks an item as unselected.booleandeselectAll()Deprecated.Marks all items as unselected.protected voiddoCancelEditor()Deprecated.protected voiddoEditItem()Deprecated.voideditItem(Object itemId)Deprecated.Opens the editor interface for the provided item.voidfireSelectionEvent(Collection<Object> oldSelection, Collection<Object> newSelection)Deprecated.Fires a selection change event.voidfocus()Deprecated.com.vaadin.shared.ui.ContentModegetCellDescriptionContentMode()Deprecated.Gets the content mode used for cell descriptions.Grid.CellDescriptionGeneratorgetCellDescriptionGenerator()Deprecated.Returns theCellDescriptionGeneratorinstance used to generate descriptions (tooltips) for Grid cells.Grid.CellStyleGeneratorgetCellStyleGenerator()Deprecated.Gets the style generator that is used for generating styles for cells.Grid.ColumngetColumn(Object propertyId)Deprecated.Returns a column based on the property id.ColumnResizeModegetColumnResizeMode()Deprecated.Returns the current column resize mode.List<Grid.Column>getColumns()Deprecated.Returns a copy of currently configures columns in their current visual order in this Grid.Container.IndexedgetContainerDataSource()Deprecated.Returns the grid data source.protected Collection<String>getCustomAttributes()Deprecated.Grid.HeaderRowgetDefaultHeaderRow()Deprecated.Returns the current default row of the header section.Grid.DetailsGeneratorgetDetailsGenerator()Deprecated.Gets the current details generator for row details.ObjectgetEditedItemId()Deprecated.Gets the id of the item that is currently being edited.StringgetEditorCancelCaption()Deprecated.Gets the current caption of the cancel button in the Grid editor.Grid.EditorErrorHandlergetEditorErrorHandler()Deprecated.Gets the error handler used for the editor.FieldGroupFieldFactorygetEditorFieldFactory()Deprecated.Gets the field factory for theFieldGroup.FieldGroupgetEditorFieldGroup()Deprecated.Gets the field group that is backing the item editor of this grid.StringgetEditorSaveCaption()Deprecated.Gets the current caption of the save button in the Grid editor.protected Grid.FootergetFooter()Deprecated.Returns the footer section of this grid.Grid.FooterRowgetFooterRow(int rowIndex)Deprecated.Gets the footer row at given index.intgetFooterRowCount()Deprecated.Gets the row count for the footer.intgetFrozenColumnCount()Deprecated.Gets the number of frozen columns in this grid. 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. -1 means that not even the selection column is frozen.protected Grid.HeadergetHeader()Deprecated.Returns the header section of this grid.Grid.HeaderRowgetHeaderRow(int rowIndex)Deprecated.Gets the header row at given index.intgetHeaderRowCount()Deprecated.Gets the row count for the header section.doublegetHeightByRows()Deprecated.Gets the amount of rows in Grid's body that are shown, whilegetHeightMode()isHeightMode.ROW.HeightModegetHeightMode()Deprecated.Returns the currentHeightModethe Grid is in.com.vaadin.shared.ui.ContentModegetRowDescriptionContentMode()Deprecated.Gets the content mode used for row descriptions.Grid.RowDescriptionGeneratorgetRowDescriptionGenerator()Deprecated.Returns theRowDescriptionGeneratorinstance used to generate descriptions (tooltips) for Grid rows.Grid.RowStyleGeneratorgetRowStyleGenerator()Deprecated.Gets the style generator that is used for generating styles for rows.ObjectgetSelectedRow()Deprecated.Gets the item id of the currently selected item.Collection<Object>getSelectedRows()Deprecated.Returns a collection of all the currently selected itemIds.Grid.SelectionModelgetSelectionModel()Deprecated.Returns the currently usedGrid.SelectionModel.List<SortOrder>getSortOrder()Deprecated.Get the current sort order list.protected GridStategetState()Deprecated.protected GridStategetState(boolean markAsDirty)Deprecated.intgetTabIndex()Deprecated.booleanisColumnReorderingAllowed()Deprecated.Returns whether column reordering is allowed.booleanisDetailsVisible(Object itemId)Deprecated.Checks whether details are visible for the given item.booleanisEditorActive()Deprecated.Returns whether an item is currently being edited in the editor.booleanisEditorBuffered()Deprecated.Gets the buffered editor mode.booleanisEditorEnabled()Deprecated.Checks whether the item editor UI is enabled for this grid.booleanisFooterVisible()Deprecated.Returns the visibility of the footer section.booleanisHeaderVisible()Deprecated.Returns the visibility of the header section.booleanisReadOnly()Deprecated.Returns the read-only state.booleanisRendered(Component childComponent)Deprecated.booleanisSelected(Object itemId)Deprecated.Checks whether an item is selected or not.Iterator<Component>iterator()Deprecated.Grid.FooterRowprependFooterRow()Deprecated.Adds a new row at the top of the footer section.Grid.HeaderRowprependHeaderRow()Deprecated.Adds a new row at the top of the header section.voidreadDesign(org.jsoup.nodes.Element design, DesignContext context)Deprecated.voidrecalculateColumnWidths()Deprecated.Requests that the column widths should be recalculated.voidrefreshAllRows()Deprecated.Refreshes, i.e. causes the client side to re-render all rows.voidrefreshRows(Object... itemIds)Deprecated.Refreshes, i.e. causes the client side to re-render the rows with the given item ids.voidremoveAllColumns()Deprecated.Removes all columns from this Grid.voidremoveBlurListener(FieldEvents.BlurListener listener)Deprecated.Removes aBlurListenerfrom the Component.voidremoveColumn(Object propertyId)Deprecated.Removes a column from Grid based on a property id.voidremoveColumnReorderListener(Grid.ColumnReorderListener listener)Deprecated.Removes a previously registered column reorder listener.voidremoveColumnResizeListener(Grid.ColumnResizeListener listener)Deprecated.Removes a previously registered column resize listener.voidremoveColumnVisibilityChangeListener(Grid.ColumnVisibilityChangeListener listener)Deprecated.Removes a previously registered column visibility change listener.voidremoveFocusListener(FieldEvents.FocusListener listener)Deprecated.Removes aFocusListenerfrom the Component.voidremoveFooterRow(int rowIndex)Deprecated.Removes the row at the given position from the footer section.voidremoveFooterRow(Grid.FooterRow row)Deprecated.Removes the given row from the footer section.voidremoveHeaderRow(int rowIndex)Deprecated.Removes the row at the given position from the header section.voidremoveHeaderRow(Grid.HeaderRow row)Deprecated.Removes the given row from the header section.voidremoveItemClickListener(ItemClickEvent.ItemClickListener listener)Deprecated.Removes an ItemClickListener.voidremoveListener(ItemClickEvent.ItemClickListener listener)Deprecated.voidremoveSelectionListener(SelectionEvent.SelectionListener listener)Deprecated.Removes a previously registered selection change listener.voidremoveSortListener(SortEvent.SortListener listener)Deprecated.Removes a sort order change listener previously added usingaddSortListener(SortListener).voidsaveEditor()Deprecated.Saves all changes done to the bound fields.voidscrollTo(Object itemId)Deprecated.Scrolls to a certain item, usingScrollDestination.ANY.voidscrollTo(Object itemId, ScrollDestination destination)Deprecated.Scrolls to a certain item, using user-specified scroll destination.voidscrollToEnd()Deprecated.Scrolls to the end of the last data row.voidscrollToStart()Deprecated.Scrolls to the beginning of the first data row.booleanselect(Object itemId)Deprecated.Marks an item as selected.voidsetCellDescriptionGenerator(Grid.CellDescriptionGenerator generator)Deprecated.Sets theCellDescriptionGeneratorinstance for generating optional descriptions (tooltips) for individual Grid cells.voidsetCellDescriptionGenerator(Grid.CellDescriptionGenerator generator, com.vaadin.shared.ui.ContentMode contentMode)Deprecated.Sets theCellDescriptionGeneratorinstance and content mode for generating optional descriptions (tooltips) for individual Grid cells.voidsetCellStyleGenerator(Grid.CellStyleGenerator cellStyleGenerator)Deprecated.Sets the style generator that is used for generating styles for cells.voidsetColumnOrder(Object... propertyIds)Deprecated.Sets a new column order for the grid.voidsetColumnReorderingAllowed(boolean columnReorderingAllowed)Deprecated.Sets whether or not column reordering is allowed.voidsetColumnResizeMode(ColumnResizeMode mode)Deprecated.Sets the column resize mode to use.voidsetColumns(Object... propertyIds)Deprecated.Sets the columns and their order for the grid.voidsetContainerDataSource(Container.Indexed container)Deprecated.Sets the grid data source.voidsetDefaultHeaderRow(Grid.HeaderRow row)Deprecated.Sets the default row of the header.voidsetDetailsGenerator(Grid.DetailsGenerator detailsGenerator)Deprecated.Sets a new details generator for row details.voidsetDetailsVisible(Object itemId, boolean visible)Deprecated.Shows or hides the details for a specific item.voidsetEditorBuffered(boolean editorBuffered)Deprecated.Sets the buffered editor mode.voidsetEditorCancelCaption(String cancelCaption)Deprecated.Sets the caption on the cancel button in the Grid editor.voidsetEditorEnabled(boolean isEnabled)Deprecated.Sets whether or not the item editor UI is enabled for this grid.voidsetEditorErrorHandler(Grid.EditorErrorHandler editorErrorHandler)Deprecated.Sets the error handler for the editor.voidsetEditorFieldFactory(FieldGroupFieldFactory fieldFactory)Deprecated.Sets the field factory for theFieldGroup.voidsetEditorFieldGroup(FieldGroup fieldGroup)Deprecated.Sets the field group that is backing the item editor of this grid.voidsetEditorSaveCaption(String saveCaption)Deprecated.Sets the caption on the save button in the Grid editor.voidsetFooterVisible(boolean visible)Deprecated.Sets the visibility of the footer section.voidsetFrozenColumnCount(int numberOfColumns)Deprecated.Sets the number of frozen columns in this grid.voidsetHeaderVisible(boolean visible)Deprecated.Sets the visibility of the header section.voidsetHeight(float height, Sizeable.Unit unit)Deprecated.voidsetHeightByRows(double rows)Deprecated.Sets the number of rows that should be visible in Grid's body, whilegetHeightMode()isHeightMode.ROW.voidsetHeightMode(HeightMode heightMode)Deprecated.Defines the mode in which the Grid widget's height is calculated.voidsetReadOnly(boolean readOnly)Deprecated.Changes the read-only state.voidsetRowDescriptionGenerator(Grid.RowDescriptionGenerator generator)Deprecated.Sets theRowDescriptionGeneratorinstance for generating optional descriptions (tooltips) for Grid rows.voidsetRowDescriptionGenerator(Grid.RowDescriptionGenerator generator, com.vaadin.shared.ui.ContentMode contentMode)Deprecated.Sets theRowDescriptionGeneratorinstance for generating optional descriptions (tooltips) for Grid rows.voidsetRowStyleGenerator(Grid.RowStyleGenerator rowStyleGenerator)Deprecated.Sets the style generator that is used for generating styles for rows.Grid.SelectionModelsetSelectionMode(Grid.SelectionMode selectionMode)Deprecated.Sets the Grid's selection mode.voidsetSelectionModel(Grid.SelectionModel selectionModel)Deprecated.Takes a newGrid.SelectionModelinto use.voidsetSortOrder(List<SortOrder> order)Deprecated.Sets the sort order to use.voidsetTabIndex(int tabIndex)Deprecated.voidsort(Sort s)Deprecated.Sets the current sort order using the fluid Sort API.voidsort(Object propertyId)Deprecated.Sort this Grid in ascending order by a specified property.voidsort(Object propertyId, com.vaadin.shared.data.sort.SortDirection direction)Deprecated.Sort this Grid in user-specifiedSortOrderby a property.voidwriteDesign(org.jsoup.nodes.Element design, DesignContext context)Deprecated.-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
-
-
-
Constructor Detail
-
Grid
public Grid()
Deprecated.Creates a new Grid with a newIndexedContaineras the data source.
-
Grid
public Grid(Container.Indexed dataSource)
Deprecated.Creates a new Grid using the given data source.- Parameters:
dataSource- the indexed container to use as a data source
-
Grid
public Grid(String caption)
Deprecated.Creates a new Grid with the given caption and a newIndexedContainerdata source.- Parameters:
caption- the caption of the grid
-
Grid
public Grid(String caption, Container.Indexed dataSource)
Deprecated.Creates a new Grid with the given caption and data source. If the data source is null, a newIndexedContainerwill be used.- Parameters:
caption- the caption of the griddataSource- the indexed container to use as a data source
-
-
Method Detail
-
beforeClientResponse
public void beforeClientResponse(boolean initial)
Deprecated.- Specified by:
beforeClientResponsein interfaceClientConnector- Overrides:
beforeClientResponsein classAbstractComponent
-
setContainerDataSource
public void setContainerDataSource(Container.Indexed container)
Deprecated.Sets the grid data source.Note Grid columns are based on properties and try to detect a correct converter for the data type. The columns are not reinitialized automatically if the container is changed, and if the same properties are present after container change, the columns are reused. Properties with same names, but different data types will lead to unpredictable behavior.
- Parameters:
container- The container data source. Cannot be null.- Throws:
IllegalArgumentException- if the data source is null
-
getContainerDataSource
public Container.Indexed getContainerDataSource()
Deprecated.Returns the grid data source.- Returns:
- the container data source of the grid
-
getColumn
public Grid.Column getColumn(Object propertyId)
Deprecated.Returns a column based on the property id.- Parameters:
propertyId- the property id of the column- Returns:
- the column or
nullif not found
-
getColumns
public List<Grid.Column> getColumns()
Deprecated.Returns a copy of currently configures columns in their current visual order in this Grid.- Returns:
- unmodifiable copy of current columns in visual order
-
addColumn
public Grid.Column addColumn(Object propertyId) throws IllegalStateException
Deprecated.Adds a new Column to Grid. Also adds the property to container with data type String, if property for column does not exist in it. Default value for the new property is an empty String.Note that adding a new property is only done for the default container that Grid sets up with the default constructor.
- Parameters:
propertyId- the property id of the new column- Returns:
- the new column
- Throws:
IllegalStateException- if column for given property already exists in this grid
-
addColumn
public Grid.Column addColumn(Object propertyId, Class<?> type)
Deprecated.Adds a new Column to Grid. This function makes sure that the property with the given id and data type exists in the container. If property does not exists, it will be created.Default value for the new property is 0 if type is Integer, Double and Float. If type is String, default value is an empty string. For all other types the default value is null.
Note that adding a new property is only done for the default container that Grid sets up with the default constructor.
- Parameters:
propertyId- the property id of the new columntype- the data type for the new property- Returns:
- the new column
- Throws:
IllegalStateException- if column for given property already exists in this grid or property already exists in the container with wrong type
-
addColumnProperty
protected void addColumnProperty(Object propertyId, Class<?> type, Object defaultValue) throws IllegalStateException
Deprecated.- Throws:
IllegalStateException
-
removeAllColumns
public void removeAllColumns()
Deprecated.Removes all columns from this Grid.
-
isColumnReorderingAllowed
public boolean isColumnReorderingAllowed()
Deprecated.Returns whether column reordering is allowed. Default value isfalse.- Returns:
- true if reordering is allowed
- Since:
- 7.5.0
-
setColumnReorderingAllowed
public void setColumnReorderingAllowed(boolean columnReorderingAllowed)
Deprecated.Sets whether or not column reordering is allowed. Default value isfalse.- Parameters:
columnReorderingAllowed- specifies whether column reordering is allowed- Since:
- 7.5.0
-
getState
protected GridState getState()
Deprecated.- Overrides:
getStatein classAbstractComponent
-
getState
protected GridState getState(boolean markAsDirty)
Deprecated.- Overrides:
getStatein classAbstractComponent
-
isReadOnly
public boolean isReadOnly()
Deprecated.Returns the read-only state.- Overrides:
isReadOnlyin classAbstractComponent- Since:
- 8.22
- See Also:
AbstractLegacyComponent#isReadOnly(boolean)
-
setReadOnly
public void setReadOnly(boolean readOnly)
Deprecated.Changes the read-only state.- Overrides:
setReadOnlyin classAbstractComponent- Since:
- 8.22
- See Also:
AbstractLegacyComponent.setReadOnly(boolean)
-
setColumnResizeMode
public void setColumnResizeMode(ColumnResizeMode mode)
Deprecated.Sets the column resize mode to use. The default mode isColumnResizeMode.ANIMATED.- Parameters:
mode- a ColumnResizeMode value- Since:
- 7.7.5
-
getColumnResizeMode
public ColumnResizeMode getColumnResizeMode()
Deprecated.Returns the current column resize mode. The default mode isColumnResizeMode.ANIMATED.- Returns:
- a ColumnResizeMode value
- Since:
- 7.7.5
-
removeColumn
public void removeColumn(Object propertyId) throws IllegalArgumentException
Deprecated.Removes a column from Grid based on a property id.- Parameters:
propertyId- The property id of column to be removed- Throws:
IllegalArgumentException- if there is no column for given property id in this grid
-
setColumns
public void setColumns(Object... propertyIds)
Deprecated.Sets the columns and their order for the grid. Current columns whose property id is not in propertyIds are removed. Similarly, a column is added for any property id in propertyIds that has no corresponding column in this Grid.- Parameters:
propertyIds- properties in the desired column order- Since:
- 7.5.0
-
setColumnOrder
public void setColumnOrder(Object... propertyIds)
Deprecated.Sets a new column order for the grid. All columns which are not ordered here will remain in the order they were before as the last columns of grid.- Parameters:
propertyIds- properties in the order columns should be
-
setFrozenColumnCount
public void setFrozenColumnCount(int numberOfColumns)
Deprecated.Sets the number of frozen columns in this grid. Setting the count to 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. Setting the count to -1 will also disable the selection column.The default value is 0.
- Parameters:
numberOfColumns- the number of columns that should be frozen- Throws:
IllegalArgumentException- if the column count is < 0 or > the number of visible columns
-
getFrozenColumnCount
public int getFrozenColumnCount()
Deprecated.Gets the number of frozen columns in this grid. 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. -1 means that not even the selection column is frozen.NOTE: this count includes
hidden columnsin the count.- Returns:
- the number of frozen columns
- See Also:
setFrozenColumnCount(int)
-
scrollTo
public void scrollTo(Object itemId) throws IllegalArgumentException
Deprecated.Scrolls to a certain item, usingScrollDestination.ANY.If the item has visible details, its size will also be taken into account.
- Parameters:
itemId- id of item to scroll to.- Throws:
IllegalArgumentException- if the provided id is not recognized by the data source.
-
scrollTo
public void scrollTo(Object itemId, ScrollDestination destination) throws IllegalArgumentException
Deprecated.Scrolls to a certain item, using user-specified scroll destination.If the item has visible details, its size will also be taken into account.
- Parameters:
itemId- id of item to scroll to.destination- value specifying desired position of scrolled-to row.- Throws:
IllegalArgumentException- if the provided id is not recognized by the data source.
-
scrollToStart
public void scrollToStart()
Deprecated.Scrolls to the beginning of the first data row.
-
scrollToEnd
public void scrollToEnd()
Deprecated.Scrolls to the end of the last data row.
-
setHeightByRows
public void setHeightByRows(double rows)
Deprecated.Sets the number of rows that should be visible in Grid's body, whilegetHeightMode()isHeightMode.ROW.If Grid is currently not in
HeightMode.ROW, the given value is remembered, and applied once the mode is applied.- Parameters:
rows- The height in terms of number of rows displayed in Grid's body. If Grid doesn't contain enough rows, white space is displayed instead. Ifnullis given, then Grid's height is undefined- Throws:
IllegalArgumentException- ifrowsis zero or lessIllegalArgumentException- ifrowsisinfiniteIllegalArgumentException- ifrowsisNaN
-
getHeightByRows
public double getHeightByRows()
Deprecated.Gets the amount of rows in Grid's body that are shown, whilegetHeightMode()isHeightMode.ROW.- Returns:
- the amount of rows that are being shown in Grid's body
- See Also:
setHeightByRows(double)
-
setHeight
public void setHeight(float height, Sizeable.Unit unit)Deprecated.Note: This method will change the widget's size in the browser only if
getHeightMode()returnsHeightMode.CSS.- Specified by:
setHeightin interfaceSizeable- Overrides:
setHeightin classAbstractComponent- See Also:
setHeightMode(HeightMode)
-
setHeightMode
public void setHeightMode(HeightMode heightMode)
Deprecated.Defines the mode in which the Grid widget's height is calculated.If
HeightMode.CSSis given, Grid will respect the values given via asetHeight-method, and behave as a traditional Component.If
HeightMode.ROWis given, Grid will make sure that the body will display as many rows asgetHeightByRows()defines. Note: If headers/footers are inserted or removed, the widget will resize itself to still display the required amount of rows in its body. It also takes the horizontal scrollbar into account.- Parameters:
heightMode- the mode in to which Grid should be set
-
getHeightMode
public HeightMode getHeightMode()
Deprecated.Returns the currentHeightModethe Grid is in.Defaults to
HeightMode.CSS.- Returns:
- the current HeightMode
-
setSelectionModel
public void setSelectionModel(Grid.SelectionModel selectionModel) throws IllegalArgumentException
Deprecated.Takes a newGrid.SelectionModelinto use.The SelectionModel that is previously in use will have all its items deselected. If any items were selected, this will fire a
SelectionEvent.If the given SelectionModel is already in use, this method does nothing.
- Parameters:
selectionModel- the new SelectionModel to use- Throws:
IllegalArgumentException- ifselectionModelisnull
-
getSelectionModel
public Grid.SelectionModel getSelectionModel()
Deprecated.Returns the currently usedGrid.SelectionModel.- Returns:
- the currently used SelectionModel
-
setSelectionMode
public Grid.SelectionModel setSelectionMode(Grid.SelectionMode selectionMode) throws IllegalArgumentException
Deprecated.Sets the Grid's selection mode.Grid supports three selection modes: multiselect, single select and no selection, and this is a convenience method for choosing between one of them.
Technically, this method is a shortcut that can be used instead of calling
setSelectionModelwith a specific SelectionModel instance. Grid comes with three built-in SelectionModel classes, and theGrid.SelectionModeenum represents each of them.Essentially, the two following method calls are equivalent:
grid.setSelectionMode(SelectionMode.MULTI); grid.setSelectionModel(new MultiSelectionMode());- Parameters:
selectionMode- the selection mode to switch to- Returns:
- The
Grid.SelectionModelinstance that was taken into use - Throws:
IllegalArgumentException- ifselectionModeisnull- See Also:
Grid.SelectionModel
-
isSelected
public boolean isSelected(Object itemId)
Deprecated.Checks whether an item is selected or not.- Parameters:
itemId- the item id to check for- Returns:
trueif the item is selected
-
getSelectedRows
public Collection<Object> getSelectedRows()
Deprecated.Returns a collection of all the currently selected itemIds.This method is a shorthand that delegates to the
selection model.- Returns:
- a collection of all the currently selected itemIds
-
getSelectedRow
public Object getSelectedRow() throws IllegalStateException
Deprecated.Gets the item id of the currently selected item.This method is a shorthand that delegates to the
selection model. OnlySelectionModel.Singleis supported.- Returns:
- the item id of the currently selected item, or
nullif nothing is selected - Throws:
IllegalStateException- if the selection model does not implementSelectionModel.Single
-
select
public boolean select(Object itemId) throws IllegalArgumentException, IllegalStateException, Property.ReadOnlyException
Deprecated.Marks an item as selected.This method is a shorthand that delegates to the
selection model. OnlySelectionModel.SingleandSelectionModel.Multiare supported.- Parameters:
itemId- the itemId to mark as selected- Returns:
trueif the selection state changed,falseif the itemId already was selected- Throws:
IllegalArgumentException- if theitemIddoesn't exist in the currently active ContainerIllegalStateException- if the selection was illegal. One such reason might be that the implementation already had an item selected, and that needs to be explicitly deselected before re-selecting something.IllegalStateException- if the selection model does not implementSelectionModel.SingleorSelectionModel.MultiProperty.ReadOnlyException- if the Grid is in read-only mode
-
deselect
public boolean deselect(Object itemId) throws IllegalStateException, Property.ReadOnlyException
Deprecated.Marks an item as unselected.This method is a shorthand that delegates to the
selection model. OnlySelectionModel.SingleandSelectionModel.Multiare supported.- Parameters:
itemId- the itemId to remove from being selected- Returns:
trueif the selection state changed,falseif the itemId was already selected- Throws:
IllegalArgumentException- if theitemIddoesn't exist in the currently active ContainerIllegalStateException- if the deselection was illegal. One such reason might be that the implementation requires one or more items to be selected at all times.IllegalStateException- if the selection model does not implementSelectionModel.Singleor {code SelectionModel.Multi}Property.ReadOnlyException- if the Grid is in read-only mode
-
deselectAll
public boolean deselectAll() throws IllegalStateExceptionDeprecated.Marks all items as unselected.This method is a shorthand that delegates to the
selection model. OnlySelectionModel.SingleandSelectionModel.Multiare supported.- Returns:
trueif the selection state changed,falseif the itemId was already selected- Throws:
IllegalStateException- if the deselection was illegal. One such reason might be that the implementation requires one or more items to be selected at all times.IllegalStateException- if the selection model does not implementSelectionModel.Singleor {code SelectionModel.Multi}
-
fireSelectionEvent
public void fireSelectionEvent(Collection<Object> oldSelection, Collection<Object> newSelection)
Deprecated.Fires a selection change event.Note: This is not a method that should be called by application logic. This method is publicly accessible only so that
SelectionModelswould be able to inform Grid of these events.- Parameters:
newSelection- the selection that was added by this eventoldSelection- the selection that was removed by this event
-
addSelectionListener
public void addSelectionListener(SelectionEvent.SelectionListener listener)
Deprecated.Description copied from interface:SelectionEvent.SelectionNotifierRegisters a new selection listener.- Specified by:
addSelectionListenerin interfaceSelectionEvent.SelectionNotifier- Parameters:
listener- the listener to register
-
removeSelectionListener
public void removeSelectionListener(SelectionEvent.SelectionListener listener)
Deprecated.Description copied from interface:SelectionEvent.SelectionNotifierRemoves a previously registered selection change listener.- Specified by:
removeSelectionListenerin interfaceSelectionEvent.SelectionNotifier- Parameters:
listener- the listener to remove
-
addColumnReorderListener
public void addColumnReorderListener(Grid.ColumnReorderListener listener)
Deprecated.Registers a new column reorder listener.- Parameters:
listener- the listener to register- Since:
- 7.5.0
-
removeColumnReorderListener
public void removeColumnReorderListener(Grid.ColumnReorderListener listener)
Deprecated.Removes a previously registered column reorder listener.- Parameters:
listener- the listener to remove- Since:
- 7.5.0
-
addColumnResizeListener
public void addColumnResizeListener(Grid.ColumnResizeListener listener)
Deprecated.Registers a new column resize listener.- Parameters:
listener- the listener to register
-
removeColumnResizeListener
public void removeColumnResizeListener(Grid.ColumnResizeListener listener)
Deprecated.Removes a previously registered column resize listener.- Parameters:
listener- the listener to remove
-
sort
public void sort(Sort s)
Deprecated.Sets the current sort order using the fluid Sort API. Read the documentation forSortfor more information.Note: Sorting by a property that has no column in Grid will hide all possible sorting indicators.
- Parameters:
s- a sort instance- Throws:
IllegalStateException- if container is not sortable (does not implement Container.Sortable)IllegalArgumentException- if trying to sort by non-existing property
-
sort
public void sort(Object propertyId)
Deprecated.Sort this Grid in ascending order by a specified property.Note: Sorting by a property that has no column in Grid will hide all possible sorting indicators.
- Parameters:
propertyId- a property ID- Throws:
IllegalStateException- if container is not sortable (does not implement Container.Sortable)IllegalArgumentException- if trying to sort by non-existing property
-
sort
public void sort(Object propertyId, com.vaadin.shared.data.sort.SortDirection direction)
Deprecated.Sort this Grid in user-specifiedSortOrderby a property.Note: Sorting by a property that has no column in Grid will hide all possible sorting indicators.
- Parameters:
propertyId- a property IDdirection- a sort order value (ascending/descending)- Throws:
IllegalStateException- if container is not sortable (does not implement Container.Sortable)IllegalArgumentException- if trying to sort by non-existing property
-
clearSortOrder
public void clearSortOrder()
Deprecated.Clear the current sort order, and re-sort the grid.
-
setSortOrder
public void setSortOrder(List<SortOrder> order)
Deprecated.Sets the sort order to use.Note: Sorting by a property that has no column in Grid will hide all possible sorting indicators.
- Parameters:
order- a sort order list.- Throws:
IllegalStateException- if container is not sortable (does not implement Container.Sortable)IllegalArgumentException- if order is null or trying to sort by non-existing property
-
getSortOrder
public List<SortOrder> getSortOrder()
Deprecated.Get the current sort order list.- Returns:
- a sort order list
-
addSortListener
public com.vaadin.shared.Registration addSortListener(SortEvent.SortListener listener)
Deprecated.Adds a sort order change listener that gets notified when the sort order changes.- Specified by:
addSortListenerin interfaceSortEvent.SortNotifier- Parameters:
listener- the sort order change listener to add- Returns:
- a registration object for removing the listener
-
removeSortListener
public void removeSortListener(SortEvent.SortListener listener)
Deprecated.Removes a sort order change listener previously added usingaddSortListener(SortListener).- Specified by:
removeSortListenerin interfaceSortEvent.SortNotifier- Parameters:
listener- the sort order change listener to remove
-
getHeader
protected Grid.Header getHeader()
Deprecated.Returns the header section of this grid. The default header contains a single row displaying the column captions.- Returns:
- the header
-
getHeaderRow
public Grid.HeaderRow getHeaderRow(int rowIndex)
Deprecated.Gets the header row at given index.- Parameters:
rowIndex- 0 based index for row. Counted from top to bottom- Returns:
- header row at given index
- Throws:
IllegalArgumentException- if no row exists at given index
-
addHeaderRowAt
public Grid.HeaderRow addHeaderRowAt(int index)
Deprecated.Inserts a new row at the given position to the header section. Shifts the row currently at that position and any subsequent rows down (adds one to their indices).- Parameters:
index- the position at which to insert the row- Returns:
- the new row
- Throws:
IllegalArgumentException- if the index is less than 0 or greater than row count- See Also:
appendHeaderRow(),prependHeaderRow(),removeHeaderRow(HeaderRow),removeHeaderRow(int)
-
appendHeaderRow
public Grid.HeaderRow appendHeaderRow()
Deprecated.Adds a new row at the bottom of the header section.- Returns:
- the new row
- See Also:
prependHeaderRow(),addHeaderRowAt(int),removeHeaderRow(HeaderRow),removeHeaderRow(int)
-
getDefaultHeaderRow
public Grid.HeaderRow getDefaultHeaderRow()
Deprecated.Returns the current default row of the header section. The default row is a special header row providing a user interface for sorting columns. Setting a header text for column updates cells in the default header.- Returns:
- the default row or null if no default row set
-
getHeaderRowCount
public int getHeaderRowCount()
Deprecated.Gets the row count for the header section.- Returns:
- row count
-
prependHeaderRow
public Grid.HeaderRow prependHeaderRow()
Deprecated.Adds a new row at the top of the header section.- Returns:
- the new row
- See Also:
appendHeaderRow(),addHeaderRowAt(int),removeHeaderRow(HeaderRow),removeHeaderRow(int)
-
removeHeaderRow
public void removeHeaderRow(Grid.HeaderRow row)
Deprecated.Removes the given row from the header section.- Parameters:
row- the row to be removed- Throws:
IllegalArgumentException- if the row does not exist in this section- See Also:
removeHeaderRow(int),addHeaderRowAt(int),appendHeaderRow(),prependHeaderRow()
-
removeHeaderRow
public void removeHeaderRow(int rowIndex)
Deprecated.Removes the row at the given position from the header section.- Parameters:
rowIndex- the position of the row- Throws:
IllegalArgumentException- if no row exists at given index- See Also:
removeHeaderRow(HeaderRow),addHeaderRowAt(int),appendHeaderRow(),prependHeaderRow()
-
setDefaultHeaderRow
public void setDefaultHeaderRow(Grid.HeaderRow row)
Deprecated.Sets the default row of the header. The default row is a special header row providing a user interface for sorting columns.- Parameters:
row- the new default row, or null for no default row- Throws:
IllegalArgumentException- header does not contain the row
-
setHeaderVisible
public void setHeaderVisible(boolean visible)
Deprecated.Sets the visibility of the header section.- Parameters:
visible- true to show header section, false to hide
-
isHeaderVisible
public boolean isHeaderVisible()
Deprecated.Returns the visibility of the header section.- Returns:
- true if visible, false otherwise.
-
getFooter
protected Grid.Footer getFooter()
Deprecated.Returns the footer section of this grid. The default header contains a single row displaying the column captions.- Returns:
- the footer
-
getFooterRow
public Grid.FooterRow getFooterRow(int rowIndex)
Deprecated.Gets the footer row at given index.- Parameters:
rowIndex- 0 based index for row. Counted from top to bottom- Returns:
- footer row at given index
- Throws:
IllegalArgumentException- if no row exists at given index
-
addFooterRowAt
public Grid.FooterRow addFooterRowAt(int index)
Deprecated.Inserts a new row at the given position to the footer section. Shifts the row currently at that position and any subsequent rows down (adds one to their indices).- Parameters:
index- the position at which to insert the row- Returns:
- the new row
- Throws:
IllegalArgumentException- if the index is less than 0 or greater than row count- See Also:
appendFooterRow(),prependFooterRow(),removeFooterRow(FooterRow),removeFooterRow(int)
-
appendFooterRow
public Grid.FooterRow appendFooterRow()
Deprecated.Adds a new row at the bottom of the footer section.- Returns:
- the new row
- See Also:
prependFooterRow(),addFooterRowAt(int),removeFooterRow(FooterRow),removeFooterRow(int)
-
getFooterRowCount
public int getFooterRowCount()
Deprecated.Gets the row count for the footer.- Returns:
- row count
-
prependFooterRow
public Grid.FooterRow prependFooterRow()
Deprecated.Adds a new row at the top of the footer section.- Returns:
- the new row
- See Also:
appendFooterRow(),addFooterRowAt(int),removeFooterRow(FooterRow),removeFooterRow(int)
-
removeFooterRow
public void removeFooterRow(Grid.FooterRow row)
Deprecated.Removes the given row from the footer section.- Parameters:
row- the row to be removed- Throws:
IllegalArgumentException- if the row does not exist in this section- See Also:
removeFooterRow(int),addFooterRowAt(int),appendFooterRow(),prependFooterRow()
-
removeFooterRow
public void removeFooterRow(int rowIndex)
Deprecated.Removes the row at the given position from the footer section.- Parameters:
rowIndex- the position of the row- Throws:
IllegalArgumentException- if no row exists at given index- See Also:
removeFooterRow(FooterRow),addFooterRowAt(int),appendFooterRow(),prependFooterRow()
-
setFooterVisible
public void setFooterVisible(boolean visible)
Deprecated.Sets the visibility of the footer section.- Parameters:
visible- true to show footer section, false to hide
-
isFooterVisible
public boolean isFooterVisible()
Deprecated.Returns the visibility of the footer section.- Returns:
- true if visible, false otherwise.
-
iterator
public Iterator<Component> iterator()
Deprecated.- Specified by:
iteratorin interfaceHasComponents- Specified by:
iteratorin interfaceIterable<Component>
-
isRendered
public boolean isRendered(Component childComponent)
Deprecated.- Specified by:
isRenderedin interfaceSelectiveRenderer
-
setCellDescriptionGenerator
public void setCellDescriptionGenerator(Grid.CellDescriptionGenerator generator)
Deprecated.Sets theCellDescriptionGeneratorinstance for generating optional descriptions (tooltips) for individual Grid cells. If aGrid.RowDescriptionGeneratoris also set, the row description it generates is displayed for cells for whichgeneratorreturnsnull.- Parameters:
generator- the description generator to use ornullto remove a previously set generator if any- Since:
- 7.6
- See Also:
setCellDescriptionGenerator(CellDescriptionGenerator, ContentMode),setRowDescriptionGenerator(RowDescriptionGenerator)
-
setCellDescriptionGenerator
public void setCellDescriptionGenerator(Grid.CellDescriptionGenerator generator, com.vaadin.shared.ui.ContentMode contentMode)
Deprecated.Sets theCellDescriptionGeneratorinstance and content mode for generating optional descriptions (tooltips) for individual Grid cells. If aGrid.RowDescriptionGeneratoris also set, the row description it generates is displayed for cells for whichgeneratorreturnsnull.- Parameters:
generator- the description generator to use ornullto remove a previously set generator if anycontentMode- the content mode for cell tooltips, notnull- Since:
- 8.3.2
- See Also:
setRowDescriptionGenerator(RowDescriptionGenerator)
-
getCellDescriptionGenerator
public Grid.CellDescriptionGenerator getCellDescriptionGenerator()
Deprecated.Returns theCellDescriptionGeneratorinstance used to generate descriptions (tooltips) for Grid cells.- Returns:
- the description generator or
nullif no generator is set - Since:
- 7.6
-
getCellDescriptionContentMode
public com.vaadin.shared.ui.ContentMode getCellDescriptionContentMode()
Deprecated.Gets the content mode used for cell descriptions.- Returns:
- the content mode used for cell descriptions, not
null - Since:
- 8.3.2
- See Also:
setCellDescriptionGenerator(CellDescriptionGenerator, ContentMode)
-
setRowDescriptionGenerator
public void setRowDescriptionGenerator(Grid.RowDescriptionGenerator generator)
Deprecated.Sets theRowDescriptionGeneratorinstance for generating optional descriptions (tooltips) for Grid rows. If aGrid.CellDescriptionGeneratoris also set, the row description generated bygeneratoris used for cells for which the cell description generator returnsnull.- Parameters:
generator- the description generator to use ornullto remove a previously set generator if any- Since:
- 7.6
- See Also:
setRowDescriptionGenerator(RowDescriptionGenerator, ContentMode),setCellDescriptionGenerator(CellDescriptionGenerator)
-
setRowDescriptionGenerator
public void setRowDescriptionGenerator(Grid.RowDescriptionGenerator generator, com.vaadin.shared.ui.ContentMode contentMode)
Deprecated.Sets theRowDescriptionGeneratorinstance for generating optional descriptions (tooltips) for Grid rows. If aGrid.CellDescriptionGeneratoris also set, the row description generated bygeneratoris used for cells for which the cell description generator returnsnull.- Parameters:
generator- the description generator to use ornullto remove a previously set generator if anycontentMode- the content mode for row tooltips, notnull- Since:
- 8.3.2
- See Also:
setCellDescriptionGenerator(CellDescriptionGenerator)
-
getRowDescriptionContentMode
public com.vaadin.shared.ui.ContentMode getRowDescriptionContentMode()
Deprecated.Gets the content mode used for row descriptions.- Returns:
- the content mode used for row descriptions, not
null - Since:
- 8.3.2
- See Also:
setRowDescriptionGenerator(RowDescriptionGenerator, ContentMode)
-
getRowDescriptionGenerator
public Grid.RowDescriptionGenerator getRowDescriptionGenerator()
Deprecated.Returns theRowDescriptionGeneratorinstance used to generate descriptions (tooltips) for Grid rows.- Returns:
- the description generator or null if no generator is set
- Since:
- 7.6
-
setCellStyleGenerator
public void setCellStyleGenerator(Grid.CellStyleGenerator cellStyleGenerator)
Deprecated.Sets the style generator that is used for generating styles for cells.- Parameters:
cellStyleGenerator- the cell style generator to set, ornullto remove a previously set generator
-
getCellStyleGenerator
public Grid.CellStyleGenerator getCellStyleGenerator()
Deprecated.Gets the style generator that is used for generating styles for cells.- Returns:
- the cell style generator, or
nullif no generator is set
-
setRowStyleGenerator
public void setRowStyleGenerator(Grid.RowStyleGenerator rowStyleGenerator)
Deprecated.Sets the style generator that is used for generating styles for rows.- Parameters:
rowStyleGenerator- the row style generator to set, ornullto remove a previously set generator
-
getRowStyleGenerator
public Grid.RowStyleGenerator getRowStyleGenerator()
Deprecated.Gets the style generator that is used for generating styles for rows.- Returns:
- the row style generator, or
nullif no generator is set
-
addRow
public Object addRow(Object... values)
Deprecated.Adds a row to the underlying container. The order of the parameters should match the current visible column order.Please note that it's generally only safe to use this method during initialization. After Grid has been initialized and the visible column order might have been changed, it's better to instead add items directly to the underlying container and use
Item.getItemProperty(Object)to make sure each value is assigned to the intended property.- Parameters:
values- the cell values of the new row, in the same order as the visible column order, notnull.- Returns:
- the item id of the new row
- Throws:
IllegalArgumentException- if values is nullIllegalArgumentException- if its length does not match the number of visible columnsIllegalArgumentException- if a parameter value is not an instance of the corresponding property typeUnsupportedOperationException- if the container does not support adding new items
-
refreshRows
public void refreshRows(Object... itemIds)
Deprecated.Refreshes, i.e. causes the client side to re-render the rows with the given item ids.Calling this for a row which is not currently rendered on the client side has no effect.
- Parameters:
itemIds- the item id(s) of the row to refresh.
-
refreshAllRows
public void refreshAllRows()
Deprecated.Refreshes, i.e. causes the client side to re-render all rows.- Since:
- 7.7.7
-
setEditorEnabled
public void setEditorEnabled(boolean isEnabled) throws IllegalStateExceptionDeprecated.Sets whether or not the item editor UI is enabled for this grid. When the editor is enabled, the user can open it by double-clicking a row or hitting enter when a row is focused. The editor can also be opened programmatically using theeditItem(Object)method.- Parameters:
isEnabled-trueto enable the feature,falseotherwise- Throws:
IllegalStateException- if an item is currently being edited- See Also:
getEditedItemId()
-
isEditorEnabled
public boolean isEditorEnabled()
Deprecated.Checks whether the item editor UI is enabled for this grid.- Returns:
trueif the editor is enabled for this grid- See Also:
setEditorEnabled(boolean),getEditedItemId()
-
getEditedItemId
public Object getEditedItemId()
Deprecated.Gets the id of the item that is currently being edited.- Returns:
- the id of the item that is currently being edited, or
nullif no item is being edited at the moment
-
getEditorFieldGroup
public FieldGroup getEditorFieldGroup()
Deprecated.Gets the field group that is backing the item editor of this grid.- Returns:
- the backing field group
-
setEditorFieldGroup
public void setEditorFieldGroup(FieldGroup fieldGroup)
Deprecated.Sets the field group that is backing the item editor of this grid.- Parameters:
fieldGroup- the backing field group- Throws:
IllegalStateException- if the editor is currently active
-
isEditorActive
public boolean isEditorActive()
Deprecated.Returns whether an item is currently being edited in the editor.- Returns:
- true if the editor is open
-
editItem
public void editItem(Object itemId) throws IllegalStateException, IllegalArgumentException, Property.ReadOnlyException
Deprecated.Opens the editor interface for the provided item. Scrolls the Grid to bring the item to view if it is not already visible. Note that any cell content rendered by a WidgetRenderer will not be visible in the editor row.- Parameters:
itemId- the id of the item to edit- Throws:
IllegalStateException- if the editor is not enabled or already editing an item in buffered modeIllegalArgumentException- if theitemIdis not in the backing containerProperty.ReadOnlyException- if the Grid is in read-only mode- See Also:
setEditorEnabled(boolean)
-
doEditItem
protected void doEditItem()
Deprecated.
-
saveEditor
public void saveEditor() throws FieldGroup.CommitExceptionDeprecated.Saves all changes done to the bound fields.Note: This is a pass-through call to the backing field group.
- Throws:
FieldGroup.CommitException- If the commit was aborted- See Also:
FieldGroup.commit()
-
cancelEditor
public void cancelEditor()
Deprecated.Cancels the currently active edit if any. Hides the editor and discards possible unsaved changes in the editor fields.
-
doCancelEditor
protected void doCancelEditor()
Deprecated.
-
setEditorFieldFactory
public void setEditorFieldFactory(FieldGroupFieldFactory fieldFactory)
Deprecated.Sets the field factory for theFieldGroup. The field factory is only used whenFieldGroupcreates a new field.Note: This is a pass-through call to the backing field group.
- Parameters:
fieldFactory- The field factory to use
-
setEditorErrorHandler
public void setEditorErrorHandler(Grid.EditorErrorHandler editorErrorHandler) throws IllegalArgumentException
Deprecated.Sets the error handler for the editor. The error handler is called whenever there is an exception in the editor.- Parameters:
editorErrorHandler- The editor error handler to use- Throws:
IllegalArgumentException- if the error handler is null
-
getEditorErrorHandler
public Grid.EditorErrorHandler getEditorErrorHandler()
Deprecated.Gets the error handler used for the editor.- Returns:
- the editor error handler, never null
- See Also:
AbstractClientConnector.setErrorHandler(com.vaadin.server.ErrorHandler)
-
getEditorFieldFactory
public FieldGroupFieldFactory getEditorFieldFactory()
Deprecated.Gets the field factory for theFieldGroup. The field factory is only used whenFieldGroupcreates a new field.Note: This is a pass-through call to the backing field group.
- Returns:
- The field factory in use
-
setEditorSaveCaption
public void setEditorSaveCaption(String saveCaption) throws IllegalArgumentException
Deprecated.Sets the caption on the save button in the Grid editor.- Parameters:
saveCaption- the caption to set- Throws:
IllegalArgumentException- ifsaveCaptionisnull
-
getEditorSaveCaption
public String getEditorSaveCaption()
Deprecated.Gets the current caption of the save button in the Grid editor.- Returns:
- the current caption of the save button
-
setEditorCancelCaption
public void setEditorCancelCaption(String cancelCaption) throws IllegalArgumentException
Deprecated.Sets the caption on the cancel button in the Grid editor.- Parameters:
cancelCaption- the caption to set- Throws:
IllegalArgumentException- ifcancelCaptionisnull
-
getEditorCancelCaption
public String getEditorCancelCaption()
Deprecated.Gets the current caption of the cancel button in the Grid editor.- Returns:
- the current caption of the cancel button
-
setEditorBuffered
public void setEditorBuffered(boolean editorBuffered) throws IllegalStateExceptionDeprecated.Sets the buffered editor mode. The default mode is buffered (true).- Parameters:
editorBuffered-trueto enable buffered editor,falseto disable it- Throws:
IllegalStateException- If editor is active while attempting to change the buffered mode.- Since:
- 7.6
-
isEditorBuffered
public boolean isEditorBuffered()
Deprecated.Gets the buffered editor mode.- Returns:
trueif buffered editor is enabled,falseotherwise- Since:
- 7.6
-
addItemClickListener
public void addItemClickListener(ItemClickEvent.ItemClickListener listener)
Deprecated.Description copied from interface:ItemClickEvent.ItemClickNotifierRegister a listener to handleItemClickEvents.- Specified by:
addItemClickListenerin interfaceItemClickEvent.ItemClickNotifier- Parameters:
listener- ItemClickListener to be registered
-
addListener
@Deprecated public void addListener(ItemClickEvent.ItemClickListener listener)
Deprecated.- Specified by:
addListenerin interfaceItemClickEvent.ItemClickNotifier
-
removeItemClickListener
public void removeItemClickListener(ItemClickEvent.ItemClickListener listener)
Deprecated.Description copied from interface:ItemClickEvent.ItemClickNotifierRemoves an ItemClickListener.- Specified by:
removeItemClickListenerin interfaceItemClickEvent.ItemClickNotifier- Parameters:
listener- ItemClickListener to be removed
-
removeListener
@Deprecated public void removeListener(ItemClickEvent.ItemClickListener listener)
Deprecated.- Specified by:
removeListenerin interfaceItemClickEvent.ItemClickNotifier
-
recalculateColumnWidths
public void recalculateColumnWidths()
Deprecated.Requests that the column widths should be recalculated.In most cases Grid will know when column widths need to be recalculated but this method can be used to force recalculation in situations when grid does not recalculate automatically.
- Since:
- 7.4.1
-
addColumnVisibilityChangeListener
public void addColumnVisibilityChangeListener(Grid.ColumnVisibilityChangeListener listener)
Deprecated.Registers a new column visibility change listener.- Parameters:
listener- the listener to register- Since:
- 7.5.0
-
removeColumnVisibilityChangeListener
public void removeColumnVisibilityChangeListener(Grid.ColumnVisibilityChangeListener listener)
Deprecated.Removes a previously registered column visibility change listener.- Parameters:
listener- the listener to remove- Since:
- 7.5.0
-
setDetailsGenerator
public void setDetailsGenerator(Grid.DetailsGenerator detailsGenerator) throws IllegalArgumentException
Deprecated.Sets a new details generator for row details.The currently opened row details will be re-rendered.
- Parameters:
detailsGenerator- the details generator to set- Throws:
IllegalArgumentException- if detailsGenerator isnull;- Since:
- 7.5.0
-
getDetailsGenerator
public Grid.DetailsGenerator getDetailsGenerator()
Deprecated.Gets the current details generator for row details.- Returns:
- the detailsGenerator the current details generator
- Since:
- 7.5.0
-
setDetailsVisible
public void setDetailsVisible(Object itemId, boolean visible)
Deprecated.Shows or hides the details for a specific item.- Parameters:
itemId- the id of the item for which to set details visibilityvisible-trueto show the details, orfalseto hide them- Since:
- 7.5.0
-
isDetailsVisible
public boolean isDetailsVisible(Object itemId)
Deprecated.Checks whether details are visible for the given item.- Parameters:
itemId- the id of the item for which to check details visibility- Returns:
trueif the details are visible- Since:
- 7.5.0
-
readDesign
public void readDesign(org.jsoup.nodes.Element design, DesignContext context)Deprecated.- Specified by:
readDesignin interfaceComponent- Overrides:
readDesignin classAbstractComponent
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext context)Deprecated.- Specified by:
writeDesignin interfaceComponent- Overrides:
writeDesignin classAbstractComponent
-
addBlurListener
public void addBlurListener(FieldEvents.BlurListener listener)
Deprecated.Description copied from interface:FieldEvents.BlurNotifierAdds aBlurListenerto the Component which gets fired when aFieldloses keyboard focus.- Specified by:
addBlurListenerin interfaceFieldEvents.BlurNotifier- See Also:
FieldEvents.BlurListener
-
removeBlurListener
public void removeBlurListener(FieldEvents.BlurListener listener)
Deprecated.Description copied from interface:FieldEvents.BlurNotifierRemoves aBlurListenerfrom the Component.- Specified by:
removeBlurListenerin interfaceFieldEvents.BlurNotifier- See Also:
FieldEvents.BlurListener
-
addFocusListener
public void addFocusListener(FieldEvents.FocusListener listener)
Deprecated.Description copied from interface:FieldEvents.FocusNotifierAdds aFocusListenerto the Component which gets fired when aFieldreceives keyboard focus.- Specified by:
addFocusListenerin interfaceFieldEvents.FocusNotifier- See Also:
FieldEvents.FocusListener
-
removeFocusListener
public void removeFocusListener(FieldEvents.FocusListener listener)
Deprecated.Description copied from interface:FieldEvents.FocusNotifierRemoves aFocusListenerfrom the Component.- Specified by:
removeFocusListenerin interfaceFieldEvents.FocusNotifier- See Also:
FieldEvents.FocusListener
-
focus
public void focus()
Deprecated.- Specified by:
focusin interfaceComponent.Focusable- Overrides:
focusin classAbstractComponent
-
getTabIndex
public int getTabIndex()
Deprecated.- Specified by:
getTabIndexin interfaceComponent.Focusable
-
setTabIndex
public void setTabIndex(int tabIndex)
Deprecated.- Specified by:
setTabIndexin interfaceComponent.Focusable
-
getCustomAttributes
protected Collection<String> getCustomAttributes()
Deprecated.- Overrides:
getCustomAttributesin classAbstractComponent
-
-