From d6e247f0d3004e643f5f1fd63aa8d4970a3a07a2 Mon Sep 17 00:00:00 2001
From: Anthony Guerreiro Table
is used for representing data or components in a pageable
* and selectable table.
*
* Scalability of the Table is largely dictated by the container. A table does * not have a limit for the number of items and is just as fast with hundreds of @@ -76,11 +76,11 @@ import com.vaadin.shared.ui.table.TableConstants; * scrolling however limits the number of rows to around 500000, depending on * the browser and the pixel height of rows. *
- * + * ** Components in a Table will not have their caption nor icon rendered. *
- * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -583,7 +583,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new empty table with caption. - * + * * @param caption */ public Table(String caption) { @@ -593,7 +593,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new table with caption and connect it to a Container. - * + * * @param caption * @param dataSource */ @@ -607,11 +607,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the array of visible column id:s, including generated columns. - * + * ** The columns are show in the order of their appearance in this array. *
- * + * * @return an array of currently visible propertyIds and generated column * ids. */ @@ -624,11 +624,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the array of visible column property id:s. - * + * ** The columns are show in the order of their appearance in this array. *
- * + * * @param visibleColumns * the Array of shown property id:s. */ @@ -690,7 +690,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the headers of the columns. - * + * ** The headers match the property id:s given my the set visible column * headers. The table must be set in either @@ -699,7 +699,7 @@ public class Table extends AbstractSelect implements Action.Container, * headers. In the defaults mode any nulls in the headers array are replaced * with id.toString(). *
- * + * * @return the Array of column headers. */ public String[] getColumnHeaders() { @@ -717,7 +717,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the headers of the columns. - * + * ** The headers match the property id:s given my the set visible column * headers. The table must be set in either @@ -726,7 +726,7 @@ public class Table extends AbstractSelect implements Action.Container, * headers. In the defaults mode any nulls in the headers array are replaced * with id.toString() outputs when rendering. *
- * + * * @param columnHeaders * the Array of column headers that match the * {@link #getVisibleColumns()} method. @@ -750,7 +750,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the icons of the columns. - * + * ** The icons in headers match the property id:s given my the set visible * column headers. The table must be set in either @@ -758,7 +758,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID} mode to show the headers * with icons. *
- * + * * @return the Array of icons that match the {@link #getVisibleColumns()}. */ public Resource[] getColumnIcons() { @@ -777,7 +777,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the icons of the columns. - * + * ** The icons in headers match the property id:s given my the set visible * column headers. The table must be set in either @@ -785,7 +785,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID} mode to show the headers * with icons. *
- * + * * @param columnIcons * the Array of icons that match the {@link #getVisibleColumns()} * . @@ -809,7 +809,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the array of column alignments. - * + * ** The items in the array must match the properties identified by * {@link #getVisibleColumns()}. The possible values for the alignments @@ -822,7 +822,7 @@ public class Table extends AbstractSelect implements Action.Container, * The alignments default to {@link Align#LEFT}: any null values are * rendered as align lefts. *
- * + * * @return the Column alignments array. */ public Align[] getColumnAlignments() { @@ -841,7 +841,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column alignments. - * + * ** The amount of items in the array must match the amount of properties * identified by {@link #getVisibleColumns()}. The possible values for the @@ -853,7 +853,7 @@ public class Table extends AbstractSelect implements Action.Container, * * The alignments default to {@link Align#LEFT} *
- * + * * @param columnAlignments * the Column alignments array. */ @@ -882,11 +882,11 @@ public class Table extends AbstractSelect implements Action.Container, * Sets columns width (in pixels). Theme may not necessary respect very * small or very big values. Setting width to -1 (default) means that theme * will make decision of width. - * + * ** Column can either have a fixed width or expand ratio. The latter one set * is used. See @link {@link #setColumnExpandRatio(Object, float)}. - * + * * @param propertyId * colunmns property id * @param width @@ -920,27 +920,27 @@ public class Table extends AbstractSelect implements Action.Container, * naturally. Excess space is the space that is not used by columns with * explicit width (see {@link #setColumnWidth(Object, int)}) or with natural * width (no width nor expand ratio). - * + * *
* By default (without expand ratios) the excess space is divided * proportionally to columns natural widths. - * + * *
* Only expand ratios of visible columns are used in final calculations. - * + * *
* Column can either have a fixed width or expand ratio. The latter one set * is used. - * + * *
* A column with expand ratio is considered to be minimum width by default * (if no excess space exists). The minimum width is defined by terminal * implementation. - * + * *
* If terminal implementation supports re-sizable columns the column becomes * fixed width column if users resizes the column. - * + * * @param propertyId * columns property id * @param expandRatio @@ -969,7 +969,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the column expand ratio for a columnd. See * {@link #setColumnExpandRatio(Object, float)} - * + * * @param propertyId * columns property id * @return the expandRatio used to divide excess space for this column @@ -984,7 +984,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the pixel width of column - * + * * @param propertyId * @return width of column or -1 when value not set */ @@ -1003,11 +1003,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the page length. - * + * *
* Setting page length 0 disables paging. *
- * + * * @return the Length of one page. */ public int getPageLength() { @@ -1016,16 +1016,16 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the page length. - * + * ** Setting page length 0 disables paging. The page length defaults to 15. *
- * + * ** If Table has width set ({@link #setWidth(float, int)} ) the client side * may update the page length automatically the correct value. *
- * + * * @param pageLength * the length of one page. */ @@ -1039,18 +1039,18 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method adjusts a possible caching mechanism of table implementation. - * + * ** Table component may fetch and render some rows outside visible area. With * complex tables (for example containing layouts and components), the * client side may become unresponsive. Setting the value lower, UI will * become more responsive. With higher values scrolling in client will hit * server less frequently. - * + * *
* The amount of cached rows will be cacheRate multiplied with pageLength ( * {@link #setPageLength(int)} both below and above visible area.. - * + * * @param cacheRate * a value over 0 (fastest rendering time). Higher value will * cache more rows on server (smoother scrolling). Default value @@ -1069,7 +1069,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * @see #setCacheRate(double) - * + * * @return the current cache rate value */ public double getCacheRate() { @@ -1078,7 +1078,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property currentPageFirstItem. - * + * * @return the Value of property currentPageFirstItem. */ public Object getCurrentPageFirstItemId() { @@ -1106,14 +1106,14 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the item ID for the item represented by the index given. Assumes * that the current container implements {@link Container.Indexed}. - * + * * See {@link Container.Indexed#getIdByIndex(int)} for more information * about the exceptions that can be thrown. - * + * * @param index * the index for which the item ID should be fetched * @return the item ID for the given index - * + * * @throws ClassCastException * if container does not implement {@link Container.Indexed} * @throws IndexOutOfBoundsException @@ -1126,7 +1126,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property currentPageFirstItemId. - * + * * @param currentPageFirstItemId * the New value of property currentPageFirstItemId. */ @@ -1183,7 +1183,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the icon Resource for the specified column. - * + * * @param propertyId * the propertyId indentifying the column. * @return the icon for the specified column; null if the column has no icon @@ -1198,7 +1198,7 @@ public class Table extends AbstractSelect implements Action.Container, *
* Throws IllegalArgumentException if the specified column is not visible. *
- * + * * @param propertyId * the propertyId identifying the column. * @param icon @@ -1217,7 +1217,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the header for the specified column. - * + * * @param propertyId * the propertyId identifying the column. * @return the header for the specified column if it has one. @@ -1238,7 +1238,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column header for the specified column; - * + * * @param propertyId * the propertyId identifying the column. * @param header @@ -1257,7 +1257,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the specified column's alignment. - * + * * @param propertyId * the propertyID identifying the column. * @return the specified column's alignment if it as one; {@link Align#LEFT} @@ -1270,13 +1270,13 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the specified column's alignment. - * + * ** Throws IllegalArgumentException if the alignment is not one of the * following: {@link Align#LEFT}, {@link Align#CENTER} or * {@link Align#RIGHT} *
- * + * * @param propertyId * the propertyID identifying the column. * @param alignment @@ -1296,7 +1296,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if the specified column is collapsed. - * + * * @param propertyId * the propertyID identifying the column. * @return true if the column is collapsed; false otherwise; @@ -1308,8 +1308,8 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether the specified column is collapsed or not. - * - * + * + * * @param propertyId * the propertyID identifying the column. * @param collapsed @@ -1338,7 +1338,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if column collapsing is allowed. - * + * * @return true if columns can be collapsed; false otherwise. */ public boolean isColumnCollapsingAllowed() { @@ -1347,7 +1347,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether column collapsing is allowed or not. - * + * * @param collapsingAllowed * specifies whether column collapsing is allowed. */ @@ -1369,7 +1369,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #setColumnCollapsed(Object, boolean) setColumnCollapsed()}) if * {@link #isColumnCollapsingAllowed()} is true. By default all columns are * collapsible. - * + * * @param propertyId * the propertyID identifying the column. * @param collapsible @@ -1391,7 +1391,7 @@ public class Table extends AbstractSelect implements Action.Container, * UI or with {@link #setColumnCollapsed(Object, boolean) * setColumnCollapsed()}) if {@link #isColumnCollapsingAllowed()} is also * true. - * + * * @return true if the column can be collapsed; false otherwise. */ public boolean isColumnCollapsible(Object propertyId) { @@ -1400,7 +1400,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if column reordering is allowed. - * + * * @return true if columns can be reordered; false otherwise. */ public boolean isColumnReorderingAllowed() { @@ -1409,7 +1409,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether column reordering is allowed or not. - * + * * @param columnReorderingAllowed * specifies whether column reordering is allowed. */ @@ -1453,7 +1453,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property currentPageFirstItem. - * + * * @return the Value of property currentPageFirstItem. */ public int getCurrentPageFirstItemIndex() { @@ -1513,7 +1513,22 @@ public class Table extends AbstractSelect implements Action.Container, * position not be updated correctly when the lazy rows are * finally rendered. */ - currentPageFirstItemIndexOnLastPage = indexOnLastPage; + + boolean isLastRowPossiblyPartiallyVisible = true; + if (indexOnLastPage != -1) { + /* + * If the requested row was greater than maxIndex, the last + * row should be fully visible (See + * TestCurrentPageFirstItem). + */ + isLastRowPossiblyPartiallyVisible = false; + } + + int extraRows = isLastRowPossiblyPartiallyVisible ? 0 : 1; + currentPageFirstItemIndexOnLastPage = currentPageFirstItemIndex + + extraRows; + } else { + currentPageFirstItemIndexOnLastPage = -1; } } else { @@ -1569,7 +1584,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property currentPageFirstItem. - * + * * @param newIndex * the New value of property currentPageFirstItem. */ @@ -1579,11 +1594,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property selectable. - * + * ** The table is not selectable by default. *
- * + * * @return the Value of property selectable. */ public boolean isSelectable() { @@ -1592,11 +1607,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property selectable. - * + * ** The table is not selectable by default. *
- * + * * @param selectable * the New value of property selectable. */ @@ -1609,7 +1624,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property columnHeaderMode. - * + * * @return the Value of property columnHeaderMode. */ public ColumnHeaderMode getColumnHeaderMode() { @@ -1618,7 +1633,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property columnHeaderMode. - * + * * @param columnHeaderMode * the New value of property columnHeaderMode. */ @@ -1727,7 +1742,7 @@ public class Table extends AbstractSelect implements Action.Container, * occurred exception is set as the cause of this exception. All occurred * exceptions can be accessed using {@link #getCauses()}. * - * + * */ public static class CacheUpdateException extends RuntimeException { private Throwable[] causes; @@ -1751,7 +1766,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the cause(s) for this exception - * + * * @return the exception(s) which caused this exception */ public Throwable[] getCauses() { @@ -1807,11 +1822,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Requests that the Table should be repainted as soon as possible. - * + * * Note that a {@code Table} does not necessarily repaint its contents when * this method has been called. See {@link #refreshRowCache()} for forcing * an update of the contents. - * + * * @deprecated As of 7.0, use {@link #markAsDirty()} instead */ @@ -1823,7 +1838,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Requests that the Table should be repainted as soon as possible. - * + * * Note that a {@code Table} does not necessarily repaint its contents when * this method has been called. See {@link #refreshRowCache()} for forcing * an update of the contents. @@ -2110,9 +2125,9 @@ public class Table extends AbstractSelect implements Action.Container, /** * Render rows with index "firstIndex" to "firstIndex+rows-1" to a new * buffer. - * + * * Reuses values from the current page buffer if the rows are found there. - * + * * @param firstIndex * @param rows * @param replaceListeners @@ -2221,7 +2236,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Update a cache array for a row, register any relevant listeners etc. - * + * * This is an internal method extracted from * {@link #getVisibleCellsNoCache(int, int, boolean)} and should be removed * when the Table is rewritten. @@ -2439,7 +2454,7 @@ public class Table extends AbstractSelect implements Action.Container, * Helper method to remove listeners and maintain correct component * hierarchy. Detaches properties and components if those are no more * rendered in client. - * + * * @param oldListenedProperties * set of properties that where listened in last render * @param oldVisibleComponents @@ -2475,12 +2490,12 @@ public class Table extends AbstractSelect implements Action.Container, * if it is a field, it needs to be detached from its property data source * in order to allow garbage collection to take care of removing the unused * component from memory. - * + * * Override this method and getPropertyValue(Object, Object, Property) with * custom logic if you need to deal with buffered fields. - * + * * @see #getPropertyValue(Object, Object, Property) - * + * * @param oldVisibleComponents * a set of components that should be unregistered. */ @@ -2531,7 +2546,7 @@ public class Table extends AbstractSelect implements Action.Container, * * The default value is {@link #ROW_HEADER_MODE_HIDDEN} * - * + * * @param mode * the One of the modes listed above. */ @@ -2550,7 +2565,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the row header mode. - * + * * @return the Row header mode. * @see #setRowHeaderMode(int) */ @@ -2561,7 +2576,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds the new row to table and fill the visible cells (except generated * columns) with given values. - * + * * @param cells * the Object array that is used for filling the visible cells * new row. The types must be settable to visible column property @@ -2630,7 +2645,7 @@ public class Table extends AbstractSelect implements Action.Container, ** Note that calling this method is not cheap so avoid calling it * unnecessarily. - * + * * @since 6.7.2 */ public void refreshRowCache() { @@ -2651,7 +2666,7 @@ public class Table extends AbstractSelect implements Action.Container, * Keeps propertyValueConverters if the corresponding id exists in the new * data source and is of a compatible type. *
- * + * * @param newDataSource * the new data source. */ @@ -2689,11 +2704,11 @@ public class Table extends AbstractSelect implements Action.Container, * Keeps propertyValueConverters if the corresponding id exists in the new * data source and is of a compatible type. * - * + * * @see Table#setContainerDataSource(Container) * @see Table#setVisibleColumns(Object[]) * @see Table#setConverter(Object, ConverterItemId
from the Container.
- *
+ *
* @see com.vaadin.data.Container#removeItem(Object)
*/
@@ -4265,7 +4280,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes a Property specified by the given Property ID from the Container.
- *
+ *
* @see com.vaadin.data.Container#removeContainerProperty(Object)
*/
@@ -4287,7 +4302,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds a new property to the table and show it as a visible column.
- *
+ *
* @param propertyId
* the Id of the proprty.
* @param type
@@ -4322,7 +4337,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds a new property to the table and show it as a visible column.
- *
+ *
* @param propertyId
* the Id of the proprty
* @param type
@@ -4378,7 +4393,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Also note that getVisibleColumns() will return the generated columns,
* while getContainerPropertyIds() will not.
*
- *
+ *
* @param id
* the id of the column to be added
* @param generatedColumn
@@ -4407,7 +4422,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Returns the ColumnGenerator used to generate the given column.
- *
+ *
* @param columnId
* The id of the generated column
* @return The ColumnGenerator used for the given columnId or null.
@@ -4419,7 +4434,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes a generated column previously added with addGeneratedColumn.
- *
+ *
* @param columnId
* id of the generated column to remove
* @return true if the column could be removed (existed in the Table)
@@ -4450,7 +4465,7 @@ public class Table extends AbstractSelect implements Action.Container,
* architecture. Using {@link #getCurrentPageFirstItemId()} combined with
* {@link #getPageLength()} may produce good enough estimates in some
* situations.
- *
+ *
* @see com.vaadin.ui.Select#getVisibleItemIds()
*/
@@ -4474,7 +4489,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Container datasource item set change. Table must flush its buffers on
* change.
- *
+ *
* @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent)
*/
@@ -4499,7 +4514,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Container datasource property set change. Table must flush its buffers on
* change.
- *
+ *
* @see com.vaadin.data.Container.PropertySetChangeListener#containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent)
*/
@@ -4545,7 +4560,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adding new items is not supported.
- *
+ *
* @throws UnsupportedOperationException
* if set to true.
* @see com.vaadin.ui.Select#setNewItemsAllowed(boolean)
@@ -4561,7 +4576,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the Item following the Item that corresponds to itemId.
- *
+ *
* @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object)
*/
@@ -4573,7 +4588,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the Item preceding the Item that corresponds to the
* itemId.
- *
+ *
* @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object)
*/
@@ -4584,7 +4599,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the first Item in the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#firstItemId()
*/
@@ -4595,7 +4610,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the last Item in the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#lastItemId()
*/
@@ -4607,7 +4622,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Tests if the Item corresponding to the given Item ID is the first Item in
* the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object)
*/
@@ -4619,7 +4634,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Tests if the Item corresponding to the given Item ID is the last Item in
* the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object)
*/
@@ -4630,7 +4645,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds new item after the given item.
- *
+ *
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object)
*/
@@ -4647,7 +4662,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds new item after the given item.
- *
+ *
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object,
* java.lang.Object)
*/
@@ -4665,10 +4680,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the TableFieldFactory that is used to create editor for table cells.
- *
+ *
* The TableFieldFactory is only used if the Table is editable. By default
* the DefaultFieldFactory is used.
- *
+ *
* @param fieldFactory
* the field factory to set.
* @see #isEditable
@@ -4683,9 +4698,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the TableFieldFactory that is used to create editor for table cells.
- *
+ *
* The FieldFactory is only used if the Table is editable.
- *
+ *
* @return TableFieldFactory used to create the Field instances.
* @see #isEditable
*/
@@ -4695,18 +4710,18 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is table editable.
- *
+ *
* If table is editable a editor of type Field is created for each table
* cell. The assigned FieldFactory is used to create the instances.
- *
+ *
* To provide custom editors for table cells create a class implementins the
* FieldFactory interface, and assign it to table, and set the editable
* property to true.
- *
+ *
* @return true if table is editable, false oterwise.
* @see Field
* @see FieldFactory
- *
+ *
*/
public boolean isEditable() {
return editable;
@@ -4714,19 +4729,19 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the editable property.
- *
+ *
* If table is editable a editor of type Field is created for each table
* cell. The assigned FieldFactory is used to create the instances.
- *
+ *
* To provide custom editors for table cells create a class implementins the
* FieldFactory interface, and assign it to table, and set the editable
* property to true.
- *
+ *
* @param editable
* true if table should be editable by user.
* @see Field
* @see FieldFactory
- *
+ *
*/
public void setEditable(boolean editable) {
this.editable = editable;
@@ -4737,13 +4752,13 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sorts the table.
- *
+ *
* @throws UnsupportedOperationException
* if the container data source does not implement
* Container.Sortable
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[],
* boolean[])
- *
+ *
*/
@Override
@@ -4775,7 +4790,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sorts the table by currently selected sorting column.
- *
+ *
* @throws UnsupportedOperationException
* if the container data source does not implement
* Container.Sortable
@@ -4795,7 +4810,7 @@ public class Table extends AbstractSelect implements Action.Container,
* returns. Disabling sorting causes this method to always return an empty
* collection.
*
- *
+ *
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
*/
@@ -4811,7 +4826,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the currently sorted column property ID.
- *
+ *
* @return the Container property id of the currently sorted column.
*/
public Object getSortContainerPropertyId() {
@@ -4820,7 +4835,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the currently sorted column property id.
- *
+ *
* @param propertyId
* the Container property id of the currently sorted column.
*/
@@ -4831,7 +4846,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Internal method to set currently sorted column property id. With doSort
* flag actual sorting may be bypassed.
- *
+ *
* @param propertyId
* @param doSort
*/
@@ -4852,7 +4867,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is the table currently sorted in ascending order.
- *
+ *
* @return true
if ascending, false
if descending.
*/
public boolean isSortAscending() {
@@ -4861,7 +4876,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the table in ascending order.
- *
+ *
* @param ascending
* true
if ascending, false
if
* descending.
@@ -4873,7 +4888,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Internal method to set sort ascending. With doSort flag actual sort can
* be bypassed.
- *
+ *
* @param ascending
* @param doSort
*/
@@ -4891,10 +4906,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is sorting disabled altogether.
- *
+ *
* True iff no sortable columns are given even in the case where data source
* would support this.
- *
+ *
* @return True iff sorting is disabled.
* @deprecated As of 7.0, use {@link #isSortEnabled()} instead
*/
@@ -4905,7 +4920,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Checks if sorting is enabled.
- *
+ *
* @return true if sorting by the user is allowed, false otherwise
*/
public boolean isSortEnabled() {
@@ -4914,7 +4929,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Disables the sorting by the user altogether.
- *
+ *
* @param sortDisabled
* True iff sorting is disabled.
* @deprecated As of 7.0, use {@link #setSortEnabled(boolean)} instead
@@ -4930,7 +4945,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Setting this to false disallows sorting by the user. It is still possible
* to call {@link #sort()}.
*
- *
+ *
* @param sortEnabled
* true to allow the user to sort the table, false to disallow it
*/
@@ -4945,14 +4960,14 @@ public class Table extends AbstractSelect implements Action.Container,
* Used to create "generated columns"; columns that exist only in the Table,
* not in the underlying Container. Implement this interface and pass it to
* Table.addGeneratedColumn along with an id for the column to be generated.
- *
+ *
*/
public interface ColumnGenerator extends Serializable {
/**
* Called by Table when a cell in a generated column needs to be
* generated.
- *
+ *
* @param source
* the source Table
* @param itemId
@@ -4970,7 +4985,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Set cell style generator for Table.
- *
+ *
* @param cellStyleGenerator
* New cell style generator or null to remove generator.
*/
@@ -4984,7 +4999,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Get the current cell style generator.
- *
+ *
*/
public CellStyleGenerator getCellStyleGenerator() {
return cellStyleGenerator;
@@ -5001,7 +5016,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Called by Table when a cell (and row) is painted.
- *
+ *
* @param source
* the source Table
* @param itemId
@@ -5064,7 +5079,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the drag start mode of the Table. Drag start mode controls how Table
* behaves as a drag source.
- *
+ *
* @param newDragMode
*/
public void setDragMode(TableDragMode newDragMode) {
@@ -5083,9 +5098,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Concrete implementation of {@link DataBoundTransferable} for data
* transferred from a table.
- *
+ *
* @see {@link DataBoundTransferable}.
- *
+ *
* @since 6.3
*/
public class TableTransferable extends DataBoundTransferable {
@@ -5147,7 +5162,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Note, that on some clients the mode may not be respected. E.g. on touch
* based devices CTRL/SHIFT base selection method is invalid, so touch based
* browsers always use the {@link MultiSelectMode#SIMPLE}.
- *
+ *
* @param mode
* The select mode of the table
*/
@@ -5158,7 +5173,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Returns the select mode in which multi-select is used.
- *
+ *
* @return The multi select mode
*/
public MultiSelectMode getMultiSelectMode() {
@@ -5170,7 +5185,7 @@ public class Table extends AbstractSelect implements Action.Container,
* from server once per drag and drop operation. Developer must override one
* method that decides on which rows the currently dragged data can be
* dropped.
- *
+ *
* * Initially pretty much no data is sent to client. On first required * criterion check (per drag request) the client side data structure is @@ -5287,7 +5302,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the property id of the column which header was pressed - * + * * @return The column propety id */ public Object getPropertyId() { @@ -5321,7 +5336,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the component * @param propertyId @@ -5337,7 +5352,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the property id of the column which header was pressed - * + * * @return The column propety id */ public Object getPropertyId() { @@ -5353,7 +5368,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Called when a user clicks a header column cell - * + * * @param event * The event which contains information about the column and * the mouse click event @@ -5369,7 +5384,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Called when a user clicks a footer column cell - * + * * @param event * The event which contains information about the column and * the mouse click event @@ -5384,7 +5399,7 @@ public class Table extends AbstractSelect implements Action.Container, * The listener will receive events which contain information about which * column was clicked and some details about the mouse event. *
- * + * * @param listener * The handler which should handle the header click events. */ @@ -5405,7 +5420,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a header click listener - * + * * @param listener * The listener to remove. */ @@ -5430,7 +5445,7 @@ public class Table extends AbstractSelect implements Action.Container, * The listener will receive events which contain information about which * column was clicked and some details about the mouse event. * - * + * * @param listener * The handler which should handle the footer click events. */ @@ -5451,7 +5466,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a footer click listener - * + * * @param listener * The listener to remove. */ @@ -5471,7 +5486,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the footer caption beneath the rows - * + * * @param propertyId * The propertyId of the column * * @return The caption of the footer or NULL if not set @@ -5483,10 +5498,10 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column footer caption. The column footer caption is the text * displayed beneath the column if footers have been set visible. - * + * * @param propertyId * The properyId of the column - * + * * @param footer * The caption of the footer */ @@ -5506,7 +5521,7 @@ public class Table extends AbstractSelect implements Action.Container, * The footer can be used to add column related data like sums to the bottom * of the Table using setColumnFooter(Object propertyId, String footer). * - * + * * @param visible * Should the footer be visible */ @@ -5519,7 +5534,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Is the footer currently visible? - * + * * @return Returns true if visible else false */ public boolean isFooterVisible() { @@ -5551,7 +5566,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the event * @param propertyId @@ -5571,7 +5586,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the column property id of the column that was resized. - * + * * @return The column property id */ public Object getPropertyId() { @@ -5580,7 +5595,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the width in pixels of the column before the resize event - * + * * @return Width in pixels */ public int getPreviousWidth() { @@ -5589,7 +5604,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the width in pixels of the column after the resize event - * + * * @return Width in pixels */ public int getCurrentWidth() { @@ -5604,7 +5619,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method is triggered when the column has been resized - * + * * @param event * The event which contains the column property id, the * previous width of the column and the current width of the @@ -5616,7 +5631,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a column resize listener to the Table. A column resize listener is * called when a user resizes a columns width. - * + * * @param listener * The listener to attach to the Table */ @@ -5637,7 +5652,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a column resize listener from the Table. - * + * * @param listener * The listener to remove */ @@ -5674,7 +5689,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the event */ @@ -5691,7 +5706,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method is triggered when the column has been reordered - * + * * @param event */ public void columnReorder(ColumnReorderEvent event); @@ -5700,7 +5715,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a column reorder listener to the Table. A column reorder listener is * called when a user reorders columns. - * + * * @param listener * The listener to attach to the Table */ @@ -5720,7 +5735,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a column reorder listener from the Table. - * + * * @param listener * The listener to remove */ @@ -5741,7 +5756,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Set the item description generator which generates tooltips for cells and * rows in the Table - * + * * @param generator * The generator to use or null to disable */ @@ -5766,7 +5781,7 @@ public class Table extends AbstractSelect implements Action.Container, * Row generators can be used to replace certain items in a table with a * generated string. The generator is called each time the table is * rendered, which means that new strings can be generated each time. - * + * * Row generators can be used for e.g. summary rows or grouping of items. */ public interface RowGenerator extends Serializable { @@ -5792,7 +5807,7 @@ public class Table extends AbstractSelect implements Action.Container, * For custom styling of a generated row you can combine a RowGenerator * with a CellStyleGenerator. *- * + * * @param table * The Table that is being painted * @param itemId @@ -5811,7 +5826,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new generated row. If only one string is passed in, columns * are automatically spanned. - * + * * @param text */ public GeneratedRow(String... text) { @@ -5846,7 +5861,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * If set to true, all strings passed to {@link #setText(String...)} * will be rendered as HTML. - * + * * @param htmlContentAllowed */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { @@ -5860,7 +5875,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * If set to true, only one string will be rendered, spanning the entire * row. - * + * * @param spanColumns */ public void setSpanColumns(boolean spanColumns) { @@ -5871,7 +5886,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Assigns a row generator to the table. The row generator will be able to * replace rows in the table when it is rendered. - * + * * @param generator * the new row generator */ @@ -5893,7 +5908,7 @@ public class Table extends AbstractSelect implements Action.Container, * The converter is used to format the the data for the given property id * before displaying it in the table. *
- * + * * @param propertyId * The propertyId to format using the converter * @param converter @@ -5918,7 +5933,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if there is a converter set explicitly for the given property id. - * + * * @param propertyId * The propertyId to check * @return true if a converter has been set for the property id, false @@ -5930,7 +5945,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the converter used to format the given propertyId. - * + * * @param propertyId * The propertyId to check * @return The converter used to format the propertyId or null if no -- cgit v1.2.3