info.joseluismartin.vaadin.ui.table
Class ConfigurableTable

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractField
          extended by com.vaadin.ui.AbstractSelect
              extended by com.vaadin.ui.Table
                  extended by info.joseluismartin.vaadin.ui.table.ConfigurableTable
All Implemented Interfaces:
com.vaadin.data.Buffered, com.vaadin.data.BufferedValidatable, com.vaadin.data.Container, com.vaadin.data.Container.ItemSetChangeListener, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.PropertySetChangeListener, com.vaadin.data.Container.PropertySetChangeNotifier, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.Viewer, com.vaadin.data.Property, com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer, com.vaadin.data.Validatable, com.vaadin.event.Action.Container, com.vaadin.event.Action.ShortcutNotifier, com.vaadin.event.dd.DragSource, com.vaadin.event.dd.DropTarget, com.vaadin.event.ItemClickEvent.ItemClickNotifier, com.vaadin.event.ItemClickEvent.ItemClickSource, com.vaadin.event.MethodEventSource, com.vaadin.terminal.Paintable, com.vaadin.terminal.Sizeable, com.vaadin.terminal.VariableOwner, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Field, Serializable, EventListener

public class ConfigurableTable
extends com.vaadin.ui.Table

Add methods to vaadin Table for friendly configuration on spring bean defintion file. Use info.joseluismartin.ui.table.Column as inner bean for configure columns: ... ... ConfigurableTable use persistenService.getPage() to get List of models.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.Table
com.vaadin.ui.Table.CellStyleGenerator, com.vaadin.ui.Table.ColumnGenerator, com.vaadin.ui.Table.ColumnReorderEvent, com.vaadin.ui.Table.ColumnReorderListener, com.vaadin.ui.Table.ColumnResizeEvent, com.vaadin.ui.Table.ColumnResizeListener, com.vaadin.ui.Table.FooterClickEvent, com.vaadin.ui.Table.FooterClickListener, com.vaadin.ui.Table.GeneratedRow, com.vaadin.ui.Table.HeaderClickEvent, com.vaadin.ui.Table.HeaderClickListener, com.vaadin.ui.Table.RowGenerator, com.vaadin.ui.Table.TableDragMode, com.vaadin.ui.Table.TableDropCriterion, com.vaadin.ui.Table.TableTransferable
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractSelect
com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails, com.vaadin.ui.AbstractSelect.AcceptItem, com.vaadin.ui.AbstractSelect.CaptionChangeListener, com.vaadin.ui.AbstractSelect.DefaultNewItemHandler, com.vaadin.ui.AbstractSelect.Filtering, com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator, com.vaadin.ui.AbstractSelect.MultiSelectMode, com.vaadin.ui.AbstractSelect.NewItemHandler, com.vaadin.ui.AbstractSelect.TargetItemIs, com.vaadin.ui.AbstractSelect.VerticalLocationIs
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
com.vaadin.ui.AbstractField.FocusShortcut, com.vaadin.ui.AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponent.ComponentErrorEvent, com.vaadin.ui.AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.data.Container
com.vaadin.data.Container.Editor, com.vaadin.data.Container.Filter, com.vaadin.data.Container.Filterable, com.vaadin.data.Container.Hierarchical, com.vaadin.data.Container.Indexed, com.vaadin.data.Container.ItemSetChangeEvent, com.vaadin.data.Container.ItemSetChangeListener, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.PropertySetChangeEvent, com.vaadin.data.Container.PropertySetChangeListener, com.vaadin.data.Container.PropertySetChangeNotifier, com.vaadin.data.Container.SimpleFilterable, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.Viewer
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.ErrorListener, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable
com.vaadin.terminal.Paintable.RepaintRequestEvent, com.vaadin.terminal.Paintable.RepaintRequestListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Field
com.vaadin.ui.Field.ValueChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered
com.vaadin.data.Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
com.vaadin.data.Property.ConversionException, com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
 
Field Summary
 
Fields inherited from class com.vaadin.ui.Table
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alwaysRecalculateColumnWidths, CELL_FIRSTCOL, CELL_GENERATED_ROW, CELL_HEADER, CELL_ICON, CELL_ITEMID, CELL_KEY, COLUMN_HEADER_MODE_EXPLICIT, COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID, COLUMN_HEADER_MODE_HIDDEN, COLUMN_HEADER_MODE_ID, ROW_HEADER_MODE_EXPLICIT, ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID, ROW_HEADER_MODE_HIDDEN, ROW_HEADER_MODE_ICON_ONLY, ROW_HEADER_MODE_ID, ROW_HEADER_MODE_INDEX, ROW_HEADER_MODE_ITEM, ROW_HEADER_MODE_PROPERTY
 
Fields inherited from class com.vaadin.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
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
ConfigurableTable()
           
 
Method Summary
protected  void configure()
          Vaadin Table throw an exception when set this properties with an empty Container datasource.
 Column getColumn(String name)
           
 List<Column> getColumns()
           
protected  Object getPropertyValue(Object rowId, Object colId, com.vaadin.data.Property property)
          
 Collection<?> getSortableContainerPropertyIds()
          Override to handle server side sorting
 TableSorter getSorter()
           
 boolean isUsingChecks()
          Gets usingChecks property, if true, table show checkboxes for row selection
 void setColumns(List<Column> columns)
          Configure Vaadin table with column definitions.
 void setContainerDataSource(com.vaadin.data.Container newDataSource)
          
 void setSorter(TableSorter sorter)
           
 void setUsingChecks(boolean usingChecks)
          Sets usingChecks property, if true, table show checkboxes for row selection
 void sort(Object[] propertyId, boolean[] ascending)
          Sort on container or on sorter
 
Methods inherited from class com.vaadin.ui.Table
addActionHandler, addContainerProperty, addContainerProperty, addGeneratedColumn, addItem, addItemAfter, addItemAfter, addListener, addListener, addListener, addListener, addListener, attach, bindPropertyToField, changeVariables, containerItemSetChange, containerPropertySetChange, detach, disableContentRefreshing, enableContentRefreshing, firstItemId, formatPropertyValue, getAddedRowCount, getCacheRate, getCellStyleGenerator, getColumnAlignment, getColumnAlignments, getColumnExpandRatio, getColumnFooter, getColumnGenerator, getColumnHeader, getColumnHeaderMode, getColumnHeaders, getColumnIcon, getColumnIcons, getColumnWidth, getCurrentPageFirstItemId, getCurrentPageFirstItemIndex, getDragMode, getDropHandler, getFieldFactory, getFirstAddedItemIndex, getFirstUpdatedItemIndex, getIdByIndex, getItemDescriptionGenerator, getMultiSelectMode, getPageLength, getRowGenerator, getRowHeaderMode, getSortContainerPropertyId, getTableFieldFactory, getTransferable, getUpdatedRowCount, getVisibleColumns, getVisibleItemIds, indexOfId, isColumnCollapsed, isColumnCollapsingAllowed, isColumnReorderingAllowed, isEditable, isFirstId, isFooterVisible, isLastId, isPageBufferingEnabled, isPartialRowUpdate, isRowCacheInvalidated, isSelectable, isSortAscending, isSortDisabled, lastItemId, nextItemId, paintContent, paintRowAttributes, paintRowHeader, paintRowIcon, prevItemId, refreshCurrentPage, refreshRenderedCells, refreshRowCache, registerComponent, removeActionHandler, removeAllActionHandlers, removeAllItems, removeContainerProperty, removeGeneratedColumn, removeItem, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, resetPageBuffer, setCacheRate, setCellStyleGenerator, setColumnAlignment, setColumnAlignments, setColumnCollapsed, setColumnCollapsingAllowed, setColumnExpandRatio, setColumnFooter, setColumnHeader, setColumnHeaderMode, setColumnHeaders, setColumnIcon, setColumnIcons, setColumnReorderingAllowed, setColumnWidth, setCurrentPageFirstItemId, setCurrentPageFirstItemIndex, setDragMode, setDropHandler, setEditable, setEnabled, setFieldFactory, setFooterVisible, setItemDescriptionGenerator, setLazyLoading, setMultiSelectMode, setNewItemsAllowed, setPageBufferingEnabled, setPageLength, setRowGenerator, setRowHeaderMode, setSelectable, setSortAscending, setSortContainerPropertyId, setSortDisabled, setTableFieldFactory, setVisible, setVisibleColumns, shouldHideAddedRows, sort, translateDropTargetDetails, unregisterComponent, valueChange
 
Methods inherited from class com.vaadin.ui.AbstractSelect
addItem, addItem, addListener, addListener, containsId, fireItemSetChange, firePropertySetChange, getCaptionChangeListener, getContainerDataSource, getContainerProperty, getContainerPropertyIds, getItem, getItemCaption, getItemCaptionMode, getItemCaptionPropertyId, getItemIcon, getItemIconPropertyId, getItemIds, getListeners, getNewItemHandler, getNullSelectionItemId, getType, getType, getValue, isEmpty, isMultiSelect, isNewItemsAllowed, isNullSelectionAllowed, isSelected, paintItem, removeListener, removeListener, select, setItemCaption, setItemCaptionMode, setItemCaptionPropertyId, setItemIcon, setItemIconPropertyId, setMultiSelect, setNewItemHandler, setNullSelectionAllowed, setNullSelectionItemId, setValue, setValue, size, unselect
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addShortcutListener, addValidator, commit, constructField, discard, fireReadOnlyStatusChange, fireValueChange, focus, getActionManager, getErrorMessage, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isValidationVisible, isWriteThrough, readOnlyStatusChange, removeListener, removeListener, removeShortcutListener, removeValidator, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setWriteThrough, shouldHideErrors, toString, validate
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setSizeFull, setSizeUndefined, setStyle, setStyleName, setWidth, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.data.Container
addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, size
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName
 
Methods inherited from interface com.vaadin.terminal.Paintable
addListener, getDebugId, paint, removeListener, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.vaadin.terminal.VariableOwner
isImmediate
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits
 
Methods inherited from interface com.vaadin.ui.Field
getDescription, setCaption, setDescription
 

Constructor Detail

ConfigurableTable

public ConfigurableTable()
Method Detail

setColumns

public void setColumns(List<Column> columns)
Configure Vaadin table with column definitions. Method useful for use from context bean definition file.

Parameters:
columns -

setContainerDataSource

public void setContainerDataSource(com.vaadin.data.Container newDataSource)

Specified by:
setContainerDataSource in interface com.vaadin.data.Container.Viewer
Overrides:
setContainerDataSource in class com.vaadin.ui.Table

configure

protected void configure()
Vaadin Table throw an exception when set this properties with an empty Container datasource.


isUsingChecks

public boolean isUsingChecks()
Gets usingChecks property, if true, table show checkboxes for row selection

Returns:
the usingChecks

setUsingChecks

public void setUsingChecks(boolean usingChecks)
Sets usingChecks property, if true, table show checkboxes for row selection

Parameters:
usingChecks - the usingChecks to set

sort

public void sort(Object[] propertyId,
                 boolean[] ascending)
Sort on container or on sorter

Specified by:
sort in interface com.vaadin.data.Container.Sortable
Overrides:
sort in class com.vaadin.ui.Table

getSortableContainerPropertyIds

public Collection<?> getSortableContainerPropertyIds()
Override to handle server side sorting

Specified by:
getSortableContainerPropertyIds in interface com.vaadin.data.Container.Sortable
Overrides:
getSortableContainerPropertyIds in class com.vaadin.ui.Table

getPropertyValue

protected Object getPropertyValue(Object rowId,
                                  Object colId,
                                  com.vaadin.data.Property property)

Overrides:
getPropertyValue in class com.vaadin.ui.Table

getColumn

public Column getColumn(String name)

getColumns

public List<Column> getColumns()

getSorter

public TableSorter getSorter()

setSorter

public void setSorter(TableSorter sorter)


Copyright © 2012 JDAL. All Rights Reserved.