|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractField
com.itmill.toolkit.ui.AbstractSelect
com.itmill.toolkit.ui.Table
public class Table
TableComponent
is used for representing data or components in
pageable and selectable table.
Note! Since version 5, components in Table will not have their caption nor icon rendered. In order to workaround this limitation, wrap your component in a Layout.
Nested Class Summary | |
---|---|
static interface |
Table.CellStyleGenerator
Allow to define specific style on cells (and rows) contents. |
static interface |
Table.ColumnGenerator
Used to create "generated columns"; columns that exist only in the Table, not in the underlying Container. |
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractSelect |
---|
AbstractSelect.CaptionChangeListener, AbstractSelect.DefaultNewItemHandler, AbstractSelect.Filtering, AbstractSelect.NewItemHandler |
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractField |
---|
AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Field Summary | |
---|---|
static String |
ALIGN_CENTER
Center column alignment. |
static String |
ALIGN_LEFT
Left column alignment. |
static String |
ALIGN_RIGHT
Right column alignment. |
protected boolean |
alwaysRecalculateColumnWidths
|
static int |
COLUMN_HEADER_MODE_EXPLICIT
Column header mode: Column headers are explicitly specified with setColumnHeaders . |
static int |
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
Column header mode: Column headers are explicitly specified with setColumnHeaders |
static int |
COLUMN_HEADER_MODE_HIDDEN
Column header mode: Column headers are hidden. |
static int |
COLUMN_HEADER_MODE_ID
Column header mode: Property ID:s are used as column headers. |
static int |
ROW_HEADER_MODE_EXPLICIT
Row caption mode: Item captions are explicitly specified. |
static int |
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
Row caption mode: Item captions are explicitly specified, but if the caption is missing, the item id objects toString() is used
instead. |
static int |
ROW_HEADER_MODE_HIDDEN
Row caption mode: The row headers are hidden. |
static int |
ROW_HEADER_MODE_ICON_ONLY
Row caption mode: Only icons are shown, the captions are hidden. |
static int |
ROW_HEADER_MODE_ID
Row caption mode: Items Id-objects toString is used as row caption. |
static int |
ROW_HEADER_MODE_INDEX
Row caption mode: Index of the item is used as item caption. |
static int |
ROW_HEADER_MODE_ITEM
Row caption mode: Item-objects toString is used as row caption. |
static int |
ROW_HEADER_MODE_PROPERTY
Row caption mode: Item captions are read from property specified with setItemCaptionPropertyId . |
Fields inherited from class com.itmill.toolkit.ui.AbstractSelect |
---|
ITEM_CAPTION_MODE_EXPLICIT, ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID, ITEM_CAPTION_MODE_ICON_ONLY, ITEM_CAPTION_MODE_ID, ITEM_CAPTION_MODE_INDEX, ITEM_CAPTION_MODE_ITEM, ITEM_CAPTION_MODE_PROPERTY, itemIdMapper, items |
Constructor Summary | |
---|---|
Table()
Creates a new empty table. |
|
Table(String caption)
Creates a new empty table with caption. |
|
Table(String caption,
Container dataSource)
Creates a new table with caption and connect it to a Container. |
Method Summary | |
---|---|
void |
addActionHandler(Action.Handler actionHandler)
Registers a new action handler for this container |
boolean |
addContainerProperty(Object propertyId,
Class type,
Object defaultValue)
Adds a new property to the table and show it as a visible column. |
boolean |
addContainerProperty(Object propertyId,
Class type,
Object defaultValue,
String columnHeader,
Resource columnIcon,
String columnAlignment)
Adds a new property to the table and show it as a visible column. |
void |
addGeneratedColumn(Object id,
Table.ColumnGenerator generatedColumn)
Adds a generated column to the Table. |
Object |
addItem(Object[] cells,
Object itemId)
Adds the new row to table and fill the visible cells (except generated columns) with given values. |
Object |
addItemAfter(Object previousItemId)
Adds new item after the given item. |
Item |
addItemAfter(Object previousItemId,
Object newItemId)
Adds new item after the given item. |
void |
addListener(ItemClickEvent.ItemClickListener listener)
Register listener to handle ItemClickEvents. |
void |
attach()
Notifies the component that it is connected to an application. |
void |
changeVariables(Object source,
Map variables)
Invoked when the value of a variable has changed. |
void |
containerItemSetChange(Container.ItemSetChangeEvent event)
Container datasource item set change. |
void |
containerPropertySetChange(Container.PropertySetChangeEvent event)
Container datasource property set change. |
void |
detach()
Notifies the component that it is detached from the application |
protected boolean |
disableContentRefreshing()
Go to mode where content updates are not done. |
protected void |
enableContentRefreshing(boolean refreshContent)
Go to mode where content content refreshing has effect. |
Object |
firstItemId()
Gets the ID of the first Item in the Container. |
void |
focus()
Focusing to this component is not supported. |
protected String |
formatPropertyValue(Object rowId,
Object colId,
Property property)
Formats table cell property values. |
Table.CellStyleGenerator |
getCellStyleGenerator()
Get the current cell style generator. |
String |
getColumnAlignment(Object propertyId)
Gets the specified column's alignment. |
String[] |
getColumnAlignments()
Gets the array of column alignments. |
String |
getColumnHeader(Object propertyId)
Gets the header for the specified column. |
int |
getColumnHeaderMode()
Getter for property columnHeaderMode. |
String[] |
getColumnHeaders()
Gets the headers of the columns. |
Resource |
getColumnIcon(Object propertyId)
Gets the icon Resource for the specified column. |
Resource[] |
getColumnIcons()
Gets the icons of the columns. |
int |
getColumnWidth(Object propertyId)
Gets the width of column |
Object |
getCurrentPageFirstItemId()
Getter for property currentPageFirstItem. |
int |
getCurrentPageFirstItemIndex()
Getter for property currentPageFirstItem. |
FieldFactory |
getFieldFactory()
Gets the FieldFactory that is used to create editor for table cells. |
int |
getPageLength()
Gets the page length. |
protected Object |
getPropertyValue(Object rowId,
Object colId,
Property property)
Gets the value of property. |
int |
getRowHeaderMode()
Gets the row header mode. |
Collection |
getSortableContainerPropertyIds()
Gets the container property IDs, which can be used to sort the item. |
Object |
getSortContainerPropertyId()
Gets the currently sorted column property ID. |
String |
getTag()
Gets the component UIDL tag. |
Object[] |
getVisibleColumns()
Gets the array of visible column id:s, including generated columns. |
Collection |
getVisibleItemIds()
Returns the list of items on the current page |
boolean |
isColumnCollapsed(Object propertyId)
Checks if the specified column is collapsed. |
boolean |
isColumnCollapsingAllowed()
Checks if column collapsing is allowed. |
boolean |
isColumnReorderingAllowed()
Checks if column reordering is allowed. |
boolean |
isEditable()
Is table editable. |
boolean |
isFirstId(Object itemId)
Tests if the Item corresponding to the given Item ID is the first Item in the Container. |
boolean |
isLastId(Object itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the Container. |
boolean |
isPageBufferingEnabled()
Deprecated. functionality is not needed in ajax rendering model |
boolean |
isSelectable()
Getter for property selectable. |
boolean |
isSortAscending()
Is the table currently sorted in ascending order. |
boolean |
isSortDisabled()
Is sorting disabled altogether. |
Object |
lastItemId()
Gets the ID of the last Item in the Container. |
Object |
nextItemId(Object itemId)
Gets the ID of the Item following the Item that corresponds to itemId. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
Object |
prevItemId(Object itemId)
Gets the ID of the Item preceding the Item that corresponds to the itemId. |
void |
refreshCurrentPage()
Deprecated. should not need to be used |
void |
removeActionHandler(Action.Handler actionHandler)
Removes a previously registered action handler for the contents of this container. |
boolean |
removeAllItems()
Removes all Items from the Container. |
boolean |
removeContainerProperty(Object propertyId)
Removes a Property specified by the given Property ID from the Container. |
boolean |
removeGeneratedColumn(Object columnId)
Removes a generated column previously added with addGeneratedColumn. |
boolean |
removeItem(Object itemId)
Removes the Item identified by ItemId from the Container. |
void |
removeListener(ItemClickEvent.ItemClickListener listener)
Removes ItemClickListener. |
void |
requestRepaintAll()
|
void |
setCellStyleGenerator(Table.CellStyleGenerator cellStyleGenerator)
Set cell style generator for Table. |
void |
setColumnAlignment(Object propertyId,
String alignment)
Sets the specified column's alignment. |
void |
setColumnAlignments(String[] columnAlignments)
Sets the column alignments. |
void |
setColumnCollapsed(Object propertyId,
boolean collapsed)
Sets whether the specified column is collapsed or not. |
void |
setColumnCollapsingAllowed(boolean collapsingAllowed)
Sets whether column collapsing is allowed or not. |
void |
setColumnHeader(Object propertyId,
String header)
Sets the column header for the specified column; |
void |
setColumnHeaderMode(int columnHeaderMode)
Setter for property columnHeaderMode. |
void |
setColumnHeaders(String[] columnHeaders)
Sets the headers of the columns. |
void |
setColumnIcon(Object propertyId,
Resource icon)
Sets the icon Resource for the specified column. |
void |
setColumnIcons(Resource[] columnIcons)
Sets the icons of the columns. |
void |
setColumnReorderingAllowed(boolean reorderingAllowed)
Sets whether column reordering is allowed or not. |
void |
setColumnWidth(Object columnId,
int width)
Sets columns width (in pixels). |
void |
setContainerDataSource(Container newDataSource)
Sets the Container that serves as the data source of the viewer. |
void |
setCurrentPageFirstItemId(Object currentPageFirstItemId)
Setter for property currentPageFirstItemId. |
void |
setCurrentPageFirstItemIndex(int newIndex)
Setter for property currentPageFirstItem. |
void |
setEditable(boolean editable)
Sets the editable property. |
void |
setEnabled(boolean enabled)
Enables or disables the component. |
void |
setFieldFactory(FieldFactory fieldFactory)
Sets the FieldFactory that is used to create editor for table cells. |
void |
setLazyLoading(boolean useLazyLoading)
Table does not support lazy options loading mode. |
void |
setNewItemsAllowed(boolean allowNewOptions)
Adding new items is not supported. |
void |
setPageBufferingEnabled(boolean pageBuffering)
Deprecated. functionality is not needed in ajax rendering model |
void |
setPageLength(int pageLength)
Sets the page length. |
void |
setRowHeaderMode(int mode)
Sets the row header mode. |
void |
setSelectable(boolean selectable)
Setter for property selectable. |
void |
setSortAscending(boolean ascending)
Sets the table in ascending order. |
void |
setSortContainerPropertyId(Object propertyId)
Sets the currently sorted column property id. |
void |
setSortDisabled(boolean sortDisabled)
Disables the sorting altogether. |
void |
setValue(Object newValue)
Sets the visible value of the property. |
void |
setVisibleColumns(Object[] visibleColumns)
Sets the array of visible column property id:s. |
void |
sort()
Sorts the table by currently selected sorting column. |
void |
sort(Object[] propertyId,
boolean[] ascending)
Sorts the table. |
String |
toString()
Returns the value of the Property in human readable textual format. |
void |
valueChange(Property.ValueChangeEvent event)
Notifies this listener that the Property's value has changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.itmill.toolkit.ui.Field |
---|
getDescription, setCaption, setDescription |
Field Detail |
---|
public static final String ALIGN_LEFT
public static final String ALIGN_CENTER
public static final String ALIGN_RIGHT
public static final int COLUMN_HEADER_MODE_HIDDEN
public static final int COLUMN_HEADER_MODE_ID
public static final int COLUMN_HEADER_MODE_EXPLICIT
setColumnHeaders
.
public static final int COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
setColumnHeaders
public static final int ROW_HEADER_MODE_HIDDEN
public static final int ROW_HEADER_MODE_ID
public static final int ROW_HEADER_MODE_ITEM
public static final int ROW_HEADER_MODE_INDEX
public static final int ROW_HEADER_MODE_EXPLICIT
public static final int ROW_HEADER_MODE_PROPERTY
setItemCaptionPropertyId
.
public static final int ROW_HEADER_MODE_ICON_ONLY
public static final int ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
toString()
is used
instead.
protected boolean alwaysRecalculateColumnWidths
Constructor Detail |
---|
public Table()
public Table(String caption)
caption
- public Table(String caption, Container dataSource)
caption
- dataSource
- Method Detail |
---|
public Object[] getVisibleColumns()
The columns are show in the order of their appearance in this array.
public void setVisibleColumns(Object[] visibleColumns)
The columns are show in the order of their appearance in this array.
visibleColumns
- the Array of shown property id:s.public String[] getColumnHeaders()
The headers match the property id:s given my the set visible column
headers. The table must be set in either
COLUMN_HEADER_MODE_EXPLICIT
or
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode to show the
headers. In the defaults mode any nulls in the headers array are replaced
with id.toString() outputs when rendering.
public void setColumnHeaders(String[] columnHeaders)
The headers match the property id:s given my the set visible column
headers. The table must be set in either
COLUMN_HEADER_MODE_EXPLICIT
or
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode to show the
headers. In the defaults mode any nulls in the headers array are replaced
with id.toString() outputs when rendering.
columnHeaders
- the Array of column headers that match the
getVisibleColumns
method.public Resource[] getColumnIcons()
The icons in headers match the property id:s given my the set visible
column headers. The table must be set in either
COLUMN_HEADER_MODE_EXPLICIT
or
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode to show the
headers with icons.
getVisibleColumns
.public void setColumnIcons(Resource[] columnIcons)
The icons in headers match the property id:s given my the set visible
column headers. The table must be set in either
COLUMN_HEADER_MODE_EXPLICIT
or
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode to show the
headers with icons.
columnIcons
- the Array of icons that match the
getVisibleColumns
.public String[] getColumnAlignments()
The items in the array must match the properties identified by
getVisibleColumns()
. The possible values for the alignments
include:
ALIGN_LEFT
: Left alignmentALIGN_CENTER
: CenteredALIGN_RIGHT
: Right alignmentALIGN_LEFT
: any null values are
rendered as align lefts.
public void setColumnAlignments(String[] columnAlignments)
The items in the array must match the properties identified by
getVisibleColumns()
. The possible values for the alignments
include:
ALIGN_LEFT
: Left alignmentALIGN_CENTER
: CenteredALIGN_RIGHT
: Right alignmentALIGN_LEFT
columnAlignments
- the Column alignments array.public void setColumnWidth(Object columnId, int width)
columnId
- colunmns property idwidth
- width to be reserved for colunmns contentpublic int getColumnWidth(Object propertyId)
propertyId
-
public int getPageLength()
Setting page length 0 disables paging.
public void setPageLength(int pageLength)
Setting page length 0 disables paging. The page length defaults to 15.
pageLength
- the Length of one page.public Object getCurrentPageFirstItemId()
public void setCurrentPageFirstItemId(Object currentPageFirstItemId)
currentPageFirstItemId
- the New value of property currentPageFirstItemId.public Resource getColumnIcon(Object propertyId)
propertyId
- the propertyId indentifying the column.
public void setColumnIcon(Object propertyId, Resource icon)
Throws IllegalArgumentException if the specified column is not visible.
propertyId
- the propertyId identifying the column.icon
- the icon Resource to set.public String getColumnHeader(Object propertyId)
propertyId
- the propertyId indentifying the column.
public void setColumnHeader(Object propertyId, String header)
propertyId
- the propertyId indentifying the column.header
- the header to set.public String getColumnAlignment(Object propertyId)
propertyId
- the propertyID identifying the column.
public void setColumnAlignment(Object propertyId, String alignment)
Throws IllegalArgumentException if the alignment is not one of the following: ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT
propertyId
- the propertyID identifying the column.alignment
- the desired alignment.public boolean isColumnCollapsed(Object propertyId)
propertyId
- the propertyID identifying the column.
public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalAccessException
propertyId
- the propertyID identifying the column.collapsed
- the desired collapsedness.
IllegalAccessException
public boolean isColumnCollapsingAllowed()
public void setColumnCollapsingAllowed(boolean collapsingAllowed)
collapsingAllowed
- specifies whether column collapsing is allowed.public boolean isColumnReorderingAllowed()
public void setColumnReorderingAllowed(boolean reorderingAllowed)
reorderingAllowed
- specifies whether column reordering is allowed.public int getCurrentPageFirstItemIndex()
public void setCurrentPageFirstItemIndex(int newIndex)
newIndex
- the New value of property currentPageFirstItem.@Deprecated public boolean isPageBufferingEnabled()
@Deprecated public void setPageBufferingEnabled(boolean pageBuffering)
pageBuffering
- the New value of property pageBuffering.public boolean isSelectable()
The table is not selectable by default.
public void setSelectable(boolean selectable)
The table is not selectable by default.
selectable
- the New value of property selectable.public int getColumnHeaderMode()
public void setColumnHeaderMode(int columnHeaderMode)
columnHeaderMode
- the New value of property columnHeaderMode.@Deprecated public void refreshCurrentPage()
public void setRowHeaderMode(int mode)
The mode can be one of the following ones:
ROW_HEADER_MODE_HIDDEN
: The row captions are hidden.ROW_HEADER_MODE_ID
: Items Id-objects
toString()
is used as row caption.
ROW_HEADER_MODE_ITEM
: Item-objects
toString()
is used as row caption.
ROW_HEADER_MODE_PROPERTY
: Property set with
setItemCaptionPropertyId()
is used as row header.
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
: Items Id-objects
toString()
is used as row header. If caption is explicitly
specified, it overrides the id-caption.
ROW_HEADER_MODE_EXPLICIT
: The row headers must be
explicitly specified.ROW_HEADER_MODE_INDEX
: The index of the item is used as
row caption. The index mode can only be used with the containers
implementing Container.Indexed
interface.ROW_HEADER_MODE_HIDDEN
mode
- the One of the modes listed above.public int getRowHeaderMode()
setRowHeaderMode(int)
public Object addItem(Object[] cells, Object itemId) throws UnsupportedOperationException
cells
- the Object array that is used for filling the visible cells
new row. The types must be settable to visible column property
types.itemId
- the Id the new row. If null, a new id is automatically
assigned. If given, the table cant already have a item with
given id.
UnsupportedOperationException
public void setValue(Object newValue) throws Property.ReadOnlyException, Property.ConversionException
AbstractSelect
The value of the select is the selected item id. If the select is in multiselect-mode, the value is a set of selected item keys. In multiselect mode all collections of id:s can be assigned.
setValue
in interface Property
setValue
in class AbstractSelect
newValue
- the New selected item or collection of selected items.
Property.ReadOnlyException
- if the object is in read-only mode
Property.ConversionException
- if newValue can't be converted into the Property's native
type directly or through StringAbstractField.setValue(java.lang.Object)
public void setContainerDataSource(Container newDataSource)
setContainerDataSource
in interface Container.Viewer
setContainerDataSource
in class AbstractSelect
newDataSource
- the new data source.Container.Viewer.setContainerDataSource(Container)
public void changeVariables(Object source, Map variables)
changeVariables
in interface VariableOwner
changeVariables
in class AbstractSelect
source
- the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.Select.changeVariables(java.lang.Object,
java.util.Map)
protected boolean disableContentRefreshing()
protected void enableContentRefreshing(boolean refreshContent)
refreshContent
- true if content refresh needs to be donepublic void paintContent(PaintTarget target) throws PaintException
AbstractSelect
paintContent
in class AbstractSelect
target
- the Paint Event.
PaintException
- if the paint operation failed.public String getTag()
AbstractSelect
getTag
in class AbstractSelect
protected Object getPropertyValue(Object rowId, Object colId, Property property)
rowId
- the Id of the row (same as item Id).colId
- the Id of the column.property
- the Property to be presented.
setFieldFactory(FieldFactory)
protected String formatPropertyValue(Object rowId, Object colId, Property property)
rowId
- the Id of the row (same as item Id).colId
- the Id of the column.property
- the Property to be formatted.
public void addActionHandler(Action.Handler actionHandler)
addActionHandler
in interface Action.Container
actionHandler
- the new handler to be added.Action.Container.addActionHandler(Action.Handler)
public void removeActionHandler(Action.Handler actionHandler)
removeActionHandler
in interface Action.Container
actionHandler
- the handler to be removed.Action.Container.removeActionHandler(Action.Handler)
public void valueChange(Property.ValueChangeEvent event)
valueChange
in interface Property.ValueChangeListener
valueChange
in class AbstractField
event
- the value change event telling the data source contents have
changed.Property.ValueChangeListener.valueChange(Property.ValueChangeEvent)
public void attach()
attach
in interface Component
attach
in class AbstractSelect
Component.attach()
public void detach()
detach
in interface Component
detach
in class AbstractSelect
Component.detach()
public boolean removeAllItems()
removeAllItems
in interface Container
removeAllItems
in class AbstractSelect
Container.removeAllItems()
public boolean removeItem(Object itemId)
ItemId
from the Container.
removeItem
in interface Container
removeItem
in class AbstractSelect
itemId
- ID of the Item to remove
Container.removeItem(Object)
public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
removeContainerProperty
in interface Container
removeContainerProperty
in class AbstractSelect
propertyId
- ID of the Property to remove
UnsupportedOperationException
Container.removeContainerProperty(Object)
public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException
addContainerProperty
in interface Container
addContainerProperty
in class AbstractSelect
propertyId
- the Id of the proprty.type
- the class of the property.defaultValue
- the default value given for all existing items.
UnsupportedOperationException
Container.addContainerProperty(Object,
Class, Object)
public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue, String columnHeader, Resource columnIcon, String columnAlignment) throws UnsupportedOperationException
propertyId
- the Id of the proprtytype
- the class of the propertydefaultValue
- the default value given for all existing itemscolumnHeader
- the Explicit header of the column. If explicit header is not
needed, this should be set null.columnIcon
- the Icon of the column. If icon is not needed, this should be
set null.columnAlignment
- the Alignment of the column. Null implies align left.
UnsupportedOperationException
- if the operation is not supported.Container.addContainerProperty(Object,
Class, Object)
public void addGeneratedColumn(Object id, Table.ColumnGenerator generatedColumn)
A generated column is a column that exists only in the Table, not as a property in the underlying Container. It shows up just as a regular column.
A generated column will override a property with the same id, so that the generated column is shown instead of the column representing the property. Note that getContainerProperty() will still get the real property.
Also note that getVisibleColumns() will return the generated columns, while getContainerPropertyIds() will not.
id
- the id of the column to be addedgeneratedColumn
- the Table.ColumnGenerator
to use for this columnpublic boolean removeGeneratedColumn(Object columnId)
columnId
- id of the generated column to remove
public Collection getVisibleItemIds()
getVisibleItemIds
in class AbstractSelect
AbstractSelect.getVisibleItemIds()
public void containerItemSetChange(Container.ItemSetChangeEvent event)
containerItemSetChange
in interface Container.ItemSetChangeListener
containerItemSetChange
in class AbstractSelect
event
- change event textContainer.ItemSetChangeListener.containerItemSetChange(com.itmill.toolkit.data.Container.ItemSetChangeEvent)
public void containerPropertySetChange(Container.PropertySetChangeEvent event)
containerPropertySetChange
in interface Container.PropertySetChangeListener
containerPropertySetChange
in class AbstractSelect
event
- Change event.Container.PropertySetChangeListener.containerPropertySetChange(com.itmill.toolkit.data.Container.PropertySetChangeEvent)
public void setNewItemsAllowed(boolean allowNewOptions) throws UnsupportedOperationException
setNewItemsAllowed
in class AbstractSelect
allowNewOptions
- the New value of property allowNewOptions.
UnsupportedOperationException
- if set to true.AbstractSelect.setNewItemsAllowed(boolean)
public void focus() throws UnsupportedOperationException
focus
in interface Component.Focusable
focus
in class AbstractField
UnsupportedOperationException
- if invoked.AbstractField.focus()
public Object nextItemId(Object itemId)
nextItemId
in interface Container.Ordered
itemId
- ID of an Item in the Container
null
Container.Ordered.nextItemId(java.lang.Object)
public Object prevItemId(Object itemId)
prevItemId
in interface Container.Ordered
itemId
- ID of an Item in the Container
null
Container.Ordered.prevItemId(java.lang.Object)
public Object firstItemId()
firstItemId
in interface Container.Ordered
Container.Ordered.firstItemId()
public Object lastItemId()
lastItemId
in interface Container.Ordered
Container.Ordered.lastItemId()
public boolean isFirstId(Object itemId)
isFirstId
in interface Container.Ordered
itemId
- ID of an Item in the Container
true
if the Item is first in the Container,
false
if notContainer.Ordered.isFirstId(java.lang.Object)
public boolean isLastId(Object itemId)
isLastId
in interface Container.Ordered
true
if the Item is last in the Container,
false
if notContainer.Ordered.isLastId(java.lang.Object)
public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException
addItemAfter
in interface Container.Ordered
previousItemId
- Id of the previous item in ordered container.
UnsupportedOperationException
Container.Ordered.addItemAfter(java.lang.Object)
public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException
addItemAfter
in interface Container.Ordered
previousItemId
- Id of the previous item in ordered container.newItemId
- Id of the new item to be added.
UnsupportedOperationException
Container.Ordered.addItemAfter(java.lang.Object,
java.lang.Object)
public FieldFactory getFieldFactory()
isEditable()
public void setFieldFactory(FieldFactory fieldFactory)
fieldFactory
- the field factory to set.isEditable()
,
BaseFieldFactory
public boolean isEditable()
Field
,
FieldFactory
public void setEditable(boolean editable)
editable
- true if table should be editable by user.Field
,
FieldFactory
public void sort(Object[] propertyId, boolean[] ascending) throws UnsupportedOperationException
sort
in interface Container.Sortable
propertyId
- Array of container property IDs, which values are used to
sort the items in container as primary, secondary, ...
sorting criterion. All of the item IDs must be in the
collection returned by
getSortableContainerPropertyIds
ascending
- Array of sorting order flags corresponding to each
property ID used in sorting. If this array is shorter than
propertyId array, ascending order is assumed for items
where the order is not specified. Use true
to
sort in ascending order, false
to use
descending order.
UnsupportedOperationException
- if the container data source does not implement
Container.SortableContainer.Sortable.sort(java.lang.Object[],
boolean[])
public void sort()
UnsupportedOperationException
- if the container data source does not implement
Container.Sortablepublic Collection getSortableContainerPropertyIds()
getSortableContainerPropertyIds
in interface Container.Sortable
Container.Sortable.getSortableContainerPropertyIds()
public Object getSortContainerPropertyId()
public void setSortContainerPropertyId(Object propertyId)
propertyId
- the Container property id of the currently sorted column.public boolean isSortAscending()
true
if ascending, false
if descending.public void setSortAscending(boolean ascending)
ascending
- true
if ascending, false
if
descending.public boolean isSortDisabled()
public void setSortDisabled(boolean sortDisabled)
sortDisabled
- True iff sorting is disabled.public void setLazyLoading(boolean useLazyLoading)
com.itmill.toolkit.ui.Select#setLazyLoading(boolean)
public String toString()
AbstractField
toString
in interface Property
toString
in class AbstractField
String
representation of the value stored in the
PropertyObject.toString()
public void setCellStyleGenerator(Table.CellStyleGenerator cellStyleGenerator)
cellStyleGenerator
- New cell style generator or null to remove generator.public Table.CellStyleGenerator getCellStyleGenerator()
public void addListener(ItemClickEvent.ItemClickListener listener)
ItemClickEvent.ItemClickSource
addListener
in interface ItemClickEvent.ItemClickSource
listener
- ItemClickListener to be registeredpublic void removeListener(ItemClickEvent.ItemClickListener listener)
ItemClickEvent.ItemClickSource
removeListener
in interface ItemClickEvent.ItemClickSource
public void setEnabled(boolean enabled)
Component
RepaintRequestEvent
.
Note that after enabling a component, Component.isEnabled()
might
still return false if the parent is disabled.
Also note that if the component contains child-components, it should recursively call requestRepaint() for all descendant components.
setEnabled
in interface Component
setEnabled
in class AbstractComponent
enabled
- the boolean value specifying if the component should be
enabled after the call or notpublic void requestRepaintAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |