net.sf.jzeno.echo.databinding
Class DynaTable

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.databinding.DynaTable
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, BindingTarget, MultiSortTable, PropertyComponent, RebindableComponent, EventPropagator, EventSink, EventSource, Precreation, CollectionChangeListener, Component, ActionListener, FastComponent, FastComponentContainer

public final class DynaTable
extends CustomComponent
implements EventPropagator, ActionListener, MultiSortTable, Precreation, CollectionChangeListener

A 'data grid' that displays a list of java beans. Multiple columns visualize different properties (or property paths).

The individual columns can be configured to use unique dynamic components .

When creating an instance of DynaTable, you need to specify which columns the table should display. To specify these columns DynaTable uses a helper class ConstructionList. Create an instance of this class, and specify the columns by using the 4 argument add method for each column to add to the DynaTable. The arguments you pass in are :

  1. The property (path) to show in this column, relative to the individual beans in the list this component is bound to.
  2. The column header (shown above the column) to identify this column to the user.
  3. The construction hints to use for all cells of this column.
  4. The class of the component that will visualize this column.

See Also:
Serialized Form

Field Summary
static int BOTTOM
          A constant value to indicate alignment/positioning toward the bottom.
static int CENTER
          A constant value to indicate centered alignment/positioning.
static int COMPARATOR_STYLE_BEAN
           
static int COMPARATOR_STYLE_PROPERTYCOMPONENT
          Deprecated.  
static int COMPARATOR_STYLE_VALUE
           
static int LEFT
          A constant value to indicate alignment/positioning toward the left.
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
static int RIGHT
          A constant value to indicate alignment/positioning toward the right.
static int SELECTION_MULTI
           
static int SELECTION_NONE
           
static int SELECTION_SINGLE
           
static int TOP
          A constant value to indicate alignment/positioning toward the top.
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
DynaTable()
           Creates an unbound component.
DynaTable(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
           Creates a databound component, but does not specify the columns of the DynaTable.
DynaTable(java.lang.Class beanClass, java.lang.String property, java.lang.String tableConstructionHints, ConstructionList constructionList)
           Creates a databound component, and specifies the columns of the DynaTable.
DynaTable(ConstructionList constructionList)
           Creates an unbound component, but specifies the columns of the DynaTable.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
 void addListSelectionListener(ListSelectionListener listener)
           
 void addNew(java.lang.Object beanToAdd)
           Add the given java bean to the list we are currently viewing, and make it editable.
 void apply()
           Apply the current changes, and exit edit/add mode.
 void applyContext()
           
 void cancel()
           Revert to state before edit/add operation.
 void changed(java.util.Collection collection)
           
 void clearSelection()
           Clear the current selection.
 void clearSorting()
           Remove any sort order that is currently applied.
 void delete(java.lang.Object deleteMe)
           Delete a given object from the editable table.
 void edit(java.lang.Object beanToMakeEditable)
           Make the row, corresponding to the given java bean, editable.
 int getAllowSelection()
          Deprecated. use setSelectionMode
 Color getBorderColor()
           Gets the color of the border (between cells).
 int getBorderSize()
           Gets the size of the border (between cells).
 int getCellMargin()
           
 int getColumnCount()
           
 int getColumnHorizontalAlignment(int column)
           Gets the horizontal text alignment of a column.
 TableColumnModel getColumnModel()
           
 int getColumnPadding(int direction)
           
 int getColumnPadding(int column, int direction)
           
 AbstractPaddingController getColumnPaddingController()
           
 AbstractPaddingController getColumnPaddingController(int column)
           
 int getColumnVerticalAlignment(int column)
           Gets the vertical text alignment of a column.
 int getColumnWidthUnits()
           
 int getColumnWidthUnits(int column)
          Returns the unit in which a column's width is specified.
 java.util.Comparator getComparator()
           Gets the current comparator that specifies the sort order.
 int getComparatorStyle()
           
 java.lang.String getCssClass()
           
 java.lang.String getCssClassEven()
           
 java.lang.String getCssClassOdd()
           
 Color getEvenBackgroundColor()
           Gets the color that is used for the even rows in the table.
 Font getFont()
          Returns the font.
 ImageReference getHeaderBackgroundImage()
           
 void getHeight(int height)
           
 int getHeightUnits()
           
 java.lang.String[] getLabelNames()
           
 java.util.List getList()
           Gets the list of java beans this DynaTable is showing.
 BoundTableModel getModel()
           Gets the BoundTableModel that is used by this table to generate cells in the table.
 java.lang.String getNextIcon()
           
 Color getOddBackgroundColor()
           Gets the color that is used for the odd rows in the table.
 SortablePagedTableModel getPagedSortableModel()
           
 boolean getPagerVisible()
          Deprecated. use isPagerVisible
 int getPreferredRowsPerPage()
           
 java.lang.String getPreviousIcon()
           
 Color getRolloverBackground()
           
 int getRowCount()
           
 int getRowHeight(int row)
           
 int getRowsPerPage()
           Gets the number of rows per page, if paging in active.
 java.util.List getSelection()
           Gets a list of java beans that are currently selected.
 Color getSelectionBackground()
           
 int getSelectionMode()
           Gets the selection mode of this table.
 int getSorterAlignment()
           
 boolean getSorterVisible()
          Deprecated. use isSorterVisible
 int[] getSortState()
           Gets the sorting mode of the table.
 int getWidth()
           
 int getWidthUnits()
           
 boolean isAllowShowAll()
           
 boolean isAsync()
           
 boolean isContainsFastColumns()
           
 boolean isFastColumn(int column)
           
 boolean isFixedLayout()
           
 boolean isHeaderVisible()
           Gets whether or not this table has a header at the top.
 boolean isPagerVisible()
           Gets whether or not the paging control is shown on the screen.
 boolean isReadOnly()
           
 boolean isRemoveSelectionHandlesIfReadOnly()
           
 boolean isRolloverEnabled()
           
 boolean isRowClickSelection()
           
 boolean isSelectionHandlesShown()
           
 boolean isShowRowNumber()
           
 boolean isSorterVisible()
           
 void markValid()
           Marks the component as valid (remove error marking)
 void preRender()
           Make changes to the visual representation of this component before Echo starts rendering the component.
 void propagateEvent(ActionEvent event)
           
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void removeListSelectionListener(ListSelectionListener listener)
           
 void setActionCommand(java.lang.String actionCommand)
           
 void setAllowSelection(int selectionMode)
          Deprecated. use setSelectionMode
 void setAllowShowAll(boolean allowShowAll)
           
 void setAsync(boolean async)
           
 void setBorderColor(Color color)
           Sets the color of the border (between cells).
 void setBorderSize(int borderSize)
           Sets the size of the border (between cells).
 void setCellMargin(int i)
           
 void setColumnHorizontalAlignment(int column, int alignment)
           Sets the horizontal text alignment of a column.
 void setColumnPadding(int direction, int padding)
          Sets the padding for all the columns.
 void setColumnPadding(int column, int direction, int padding)
          Sets the padding for a specific column.
 void setColumnPaddingController(AbstractPaddingController paddingController)
          Sets the padding controller for all columns.
 void setColumnPaddingController(int column, AbstractPaddingController paddingController)
          Sets the padding controller for a specific column.
 void setColumnVerticalAlignment(int column, int alignment)
           Sets the vertical text alignment of a column.
 void setColumnWidth(int column, int width)
           
 void setColumnWidthUnits(int columnWidthUnits)
          Set the default column width units.
 void setColumnWidthUnits(int column, int columnWidthUnits)
          Sets the units in which width for an individual column is specified.
 void setComparator(java.util.Comparator comparator)
           Sets a comparator for specifying custom sort orders.
 void setComparatorStyle(int comparatorStyle)
          Selects the type of value you receive in you custom comparator.
 void setConstructionList(ConstructionList cl)
           
 void setContainsFastColumns(boolean value)
          A table's memory consumption can be optimized by activating this option (it is by default).
 void setCssClass(java.lang.String newValue)
           
 void setCssClassEven(java.lang.String newValue)
           
 void setCssClassOdd(java.lang.String newValue)
           
 void setEvenBackgroundColor(Color evenBackgroundColor)
           Sets the color that is used for the even rows in the table.
 void setFastColumn(int column, boolean value)
          Marks an individual column as not optimized.
 void setFixedLayout(boolean fixedLayout)
          If a table is configured with fixed layout, none of the cell components will cause a colum to expand.
 void setFont(Font f)
          Sets the font of the component.
 void setHeaderAlignment(int newValue)
           Sets the text alignment of all the headers at once.
 void setHeaderAlignment(int column, int newValue)
           Sets the text alignment of an individual header.
 void setHeaderBackgroundImage(ImageReference headerBackgroundImage)
          Set this property to a background image you want to show in the header of the table.
 void setHeaderCellRenderer(SortableTableHeaderRenderer cellRenderer)
           
 void setHeaderVisible(boolean headerVisible)
           Sets whether or not this table has a header at the top.
 void setHeight(int height)
           
 void setHeightUnits(int heightUnits)
           
 void setList(java.util.List beans)
           Gets the list of java beans this DynaTable is showing.
 void setModel(BoundTableModel model)
           Sets the BoundTableModel that is used by this table to generate cells in the table.
 void setNextIcon(java.lang.String nextIcon)
           
 void setOddBackgroundColor(Color oddBackgroundColor)
           Sets the color that is used for the odd rows in the table.
 void setPagerThreshold(int i)
           The minimum number of rows of data that automatically triggers the visibility of the pager.
 void setPagerVisible(boolean b)
           Sets whether or not the paging control is shown on the screen.
 void setPreferredRowsPerPage(int preferredRowsPerPage)
           
 void setPreviousIcon(java.lang.String previousIcon)
           
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRemoveSelectionHandlesIfReadOnly(boolean removeSelectionHandlesIfReadOnly)
          Should the selection handles on the table be removed if it is marked read-only ?
 void setRolloverBackground(Color color)
           
 void setRolloverEnabled(boolean enabled)
           Sets whether or not moving your mouse over the rows in the table highlights that row.
 void setRowClickSelection(boolean rowClickSelects)
           Sets whether or not clicking in a row will select it.
 void setRowHeight(int row, int height)
           
 void setRowsPerPage(int rowsPerPage)
           Sets the number of rows per page, if paging is active.
 void setSelectableTable(SelectableTable newTable)
           Used internally.
 void setSelection(java.util.List beans)
           Set which java beans are currently selected.
 void setSelectionBackground(Color color)
           
 void setSelectionHandlesShown(boolean b)
           
 void setSelectionMode(int selectionMode)
           Sets the selection mode of this table.
 void setShowRowNumber(boolean showRowNumber)
           
 void setSorterAlignment(int alignment)
           
 void setSorterIconName(java.lang.String sorterIconName)
           Sets the name of the icon to show on the multi-sort button.
 void setSorterVisible(boolean b)
           
 void setSortState(int[] sortStates)
           Sets the sorting mode of the table.
 void setTableWidthUnits(int newValue)
          Deprecated.  
 void setWidth(int width)
           
 void setWidthUnits(int widthUnit)
           
 void sort(int column, boolean ascending)
           Sorts the table ascending/descending on the specified column.
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isRequired, isValid, markInvalid, removeValidator, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setRequired, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
A constant value to indicate alignment/positioning toward the left.

See Also:
Constant Field Values

CENTER

public static final int CENTER
A constant value to indicate centered alignment/positioning.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
A constant value to indicate alignment/positioning toward the right.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
A constant value to indicate alignment/positioning toward the bottom.

See Also:
Constant Field Values

TOP

public static final int TOP
A constant value to indicate alignment/positioning toward the top.

See Also:
Constant Field Values

PIXEL_UNITS

public static final int PIXEL_UNITS
See Also:
Constant Field Values

PERCENT_UNITS

public static final int PERCENT_UNITS
See Also:
Constant Field Values

SELECTION_NONE

public static final int SELECTION_NONE
See Also:
Constant Field Values

SELECTION_SINGLE

public static final int SELECTION_SINGLE
See Also:
Constant Field Values

SELECTION_MULTI

public static final int SELECTION_MULTI
See Also:
Constant Field Values

COMPARATOR_STYLE_PROPERTYCOMPONENT

public static final int COMPARATOR_STYLE_PROPERTYCOMPONENT
Deprecated. 
See Also:
Constant Field Values

COMPARATOR_STYLE_VALUE

public static final int COMPARATOR_STYLE_VALUE
See Also:
Constant Field Values

COMPARATOR_STYLE_BEAN

public static final int COMPARATOR_STYLE_BEAN
See Also:
Constant Field Values
Constructor Detail

DynaTable

public DynaTable()

Creates an unbound component. Use setList(List) to manually set a list of java beans.


DynaTable

public DynaTable(ConstructionList constructionList)

Creates an unbound component, but specifies the columns of the DynaTable. Use setList(List) to manually set a list of java beans.


DynaTable

public DynaTable(java.lang.Class beanClass,
                 java.lang.String property,
                 java.lang.String constructionHints)

Creates a databound component, but does not specify the columns of the DynaTable.


DynaTable

public DynaTable(java.lang.Class beanClass,
                 java.lang.String property,
                 java.lang.String tableConstructionHints,
                 ConstructionList constructionList)

Creates a databound component, and specifies the columns of the DynaTable.

Method Detail

getRowsPerPage

public int getRowsPerPage()

Gets the number of rows per page, if paging in active.


setRowsPerPage

public void setRowsPerPage(int rowsPerPage)

Sets the number of rows per page, if paging is active.


getList

public java.util.List getList()

Gets the list of java beans this DynaTable is showing.


setList

public void setList(java.util.List beans)

Gets the list of java beans this DynaTable is showing.


rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent
Overrides:
rebind in class CustomComponent

setPagerVisible

public void setPagerVisible(boolean b)

Sets whether or not the paging control is shown on the screen.


isPagerVisible

public boolean isPagerVisible()

Gets whether or not the paging control is shown on the screen.


getPagerVisible

public boolean getPagerVisible()
Deprecated. use isPagerVisible


setSorterVisible

public void setSorterVisible(boolean b)

setSorterAlignment

public void setSorterAlignment(int alignment)

getSorterAlignment

public int getSorterAlignment()

isSorterVisible

public boolean isSorterVisible()

getSorterVisible

public boolean getSorterVisible()
Deprecated. use isSorterVisible


getModel

public BoundTableModel getModel()

Gets the BoundTableModel that is used by this table to generate cells in the table.


setModel

public void setModel(BoundTableModel model)

Sets the BoundTableModel that is used by this table to generate cells in the table.


getEvenBackgroundColor

public Color getEvenBackgroundColor()

Gets the color that is used for the even rows in the table.


setEvenBackgroundColor

public void setEvenBackgroundColor(Color evenBackgroundColor)

Sets the color that is used for the even rows in the table.


getOddBackgroundColor

public Color getOddBackgroundColor()

Gets the color that is used for the odd rows in the table.


setOddBackgroundColor

public void setOddBackgroundColor(Color oddBackgroundColor)

Sets the color that is used for the odd rows in the table.


setTableWidthUnits

public void setTableWidthUnits(int newValue)
Deprecated. 

Set the units (pixel/percent) of the widths specified on this table.


setHeaderAlignment

public void setHeaderAlignment(int newValue)

Sets the text alignment of all the headers at once.


setHeaderAlignment

public void setHeaderAlignment(int column,
                               int newValue)

Sets the text alignment of an individual header.


setColumnPaddingController

public void setColumnPaddingController(AbstractPaddingController paddingController)
Sets the padding controller for all columns.


getColumnPaddingController

public AbstractPaddingController getColumnPaddingController()

setColumnPaddingController

public void setColumnPaddingController(int column,
                                       AbstractPaddingController paddingController)
Sets the padding controller for a specific column.

Parameters:
column - column index

getColumnPaddingController

public AbstractPaddingController getColumnPaddingController(int column)

setColumnPadding

public void setColumnPadding(int direction,
                             int padding)
Sets the padding for all the columns.

Parameters:
direction - LEFT / RIGHT / TOP / BOTTOM
padding - padding value (a negative number will be ignored)

getColumnPadding

public int getColumnPadding(int direction)

setColumnPadding

public void setColumnPadding(int column,
                             int direction,
                             int padding)
Sets the padding for a specific column.

Parameters:
column - column index
direction - LEFT / RIGHT / TOP / BOTTOM
padding - padding value (a negative number will be ignored)

getColumnPadding

public int getColumnPadding(int column,
                            int direction)

setColumnHorizontalAlignment

public void setColumnHorizontalAlignment(int column,
                                         int alignment)

Sets the horizontal text alignment of a column.

Parameters:
column - index of the column
alignment - must be TableColumn.LEFT, TableColumn.CENTER or TableColumn.RIGHT

getColumnHorizontalAlignment

public int getColumnHorizontalAlignment(int column)

Gets the horizontal text alignment of a column.
Returns -1 if table is not properly initialized.


setColumnVerticalAlignment

public void setColumnVerticalAlignment(int column,
                                       int alignment)

Sets the vertical text alignment of a column.

Parameters:
column - index of the column
alignment - must be TableColumn.TOP, TableColumn.CENTER or TableColumn.BOTTOM

getColumnVerticalAlignment

public int getColumnVerticalAlignment(int column)

Gets the vertical text alignment of a column.
Returns -1 if table is not properly initialized.


getSelectionMode

public int getSelectionMode()

Gets the selection mode of this table.


setAllowSelection

public void setAllowSelection(int selectionMode)
Deprecated. use setSelectionMode


getAllowSelection

public int getAllowSelection()
Deprecated. use setSelectionMode


setSelectionMode

public void setSelectionMode(int selectionMode)

Sets the selection mode of this table.


getSelection

public java.util.List getSelection()

Gets a list of java beans that are currently selected.


setSelection

public void setSelection(java.util.List beans)

Set which java beans are currently selected.


clearSelection

public void clearSelection()

Clear the current selection.


isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent
Overrides:
isReadOnly in class CustomComponent

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent
Overrides:
setReadOnly in class CustomComponent

sort

public void sort(int column,
                 boolean ascending)

Sorts the table ascending/descending on the specified column.


getSortState

public int[] getSortState()

Gets the sorting mode of the table. Handy for doing state management in your screens. See net.sf.jzeno.echo.components.Screen#savePersistentState().


setSortState

public void setSortState(int[] sortStates)

Sets the sorting mode of the table. Handy for doing state management in your screens. See net.sf.jzeno.echo.components.Screen#loadPersistentState(Object[]). It requires an array of integers that are set to the constants


setSelectableTable

public void setSelectableTable(SelectableTable newTable)

Used internally.


setBorderColor

public void setBorderColor(Color color)

Sets the color of the border (between cells).


getBorderColor

public Color getBorderColor()

Gets the color of the border (between cells).


setBorderSize

public void setBorderSize(int borderSize)

Sets the size of the border (between cells).


getBorderSize

public int getBorderSize()

Gets the size of the border (between cells).


setComparator

public void setComparator(java.util.Comparator comparator)

Sets a comparator for specifying custom sort orders. By default an instance of DynaTableComparator is configured.


getComparator

public java.util.Comparator getComparator()

Gets the current comparator that specifies the sort order. By default an instance of DynaTableComparator is configured.


isHeaderVisible

public boolean isHeaderVisible()

Gets whether or not this table has a header at the top.


setHeaderVisible

public void setHeaderVisible(boolean headerVisible)

Sets whether or not this table has a header at the top.


getPagedSortableModel

public SortablePagedTableModel getPagedSortableModel()
Specified by:
getPagedSortableModel in interface MultiSortTable

setRowClickSelection

public void setRowClickSelection(boolean rowClickSelects)

Sets whether or not clicking in a row will select it.


isRowClickSelection

public boolean isRowClickSelection()

propagateEvent

public void propagateEvent(ActionEvent event)
Specified by:
propagateEvent in interface EventPropagator

setSorterIconName

public void setSorterIconName(java.lang.String sorterIconName)

Sets the name of the icon to show on the multi-sort button. Specify the name of the png/gif/jpg/.. you want to use. Specify the name of the gif/jpg/png/... image you want to show. Images should be located in the images folder, in the root of your web application.


getHeightUnits

public int getHeightUnits()

setHeightUnits

public void setHeightUnits(int heightUnits)

setHeight

public void setHeight(int height)

getHeight

public void getHeight(int height)

getRowHeight

public int getRowHeight(int row)

setRowHeight

public void setRowHeight(int row,
                         int height)

getLabelNames

public java.lang.String[] getLabelNames()
Specified by:
getLabelNames in interface MultiSortTable

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Specified by:
setActionCommand in interface EventSource
Overrides:
setActionCommand in class CustomComponent

actionPerformed

public void actionPerformed(ActionEvent e)
Description copied from interface: ActionListener
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The event describing the action.

setRolloverBackground

public void setRolloverBackground(Color color)

getRolloverBackground

public Color getRolloverBackground()

setSelectionBackground

public void setSelectionBackground(Color color)

getSelectionBackground

public Color getSelectionBackground()

setRolloverEnabled

public void setRolloverEnabled(boolean enabled)

Sets whether or not moving your mouse over the rows in the table highlights that row.


isRolloverEnabled

public boolean isRolloverEnabled()

setSelectionHandlesShown

public void setSelectionHandlesShown(boolean b)

isSelectionHandlesShown

public boolean isSelectionHandlesShown()

edit

public void edit(java.lang.Object beanToMakeEditable)

Make the row, corresponding to the given java bean, editable.


addNew

public void addNew(java.lang.Object beanToAdd)

Add the given java bean to the list we are currently viewing, and make it editable. Will also clear the sort order, and go the last page in the table.


clearSorting

public void clearSorting()

Remove any sort order that is currently applied.


cancel

public void cancel()

Revert to state before edit/add operation.


delete

public void delete(java.lang.Object deleteMe)

Delete a given object from the editable table. Will cancel any pending add/edit.


apply

public void apply()

Apply the current changes, and exit edit/add mode.


markValid

public void markValid()
Description copied from interface: PropertyComponent

Marks the component as valid (remove error marking)

Specified by:
markValid in interface PropertyComponent
Overrides:
markValid in class CustomComponent

setWidth

public void setWidth(int width)

getWidth

public int getWidth()

setWidthUnits

public void setWidthUnits(int widthUnit)

getWidthUnits

public int getWidthUnits()

addListSelectionListener

public void addListSelectionListener(ListSelectionListener listener)

removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener listener)

getPreferredRowsPerPage

public int getPreferredRowsPerPage()

setPreferredRowsPerPage

public void setPreferredRowsPerPage(int preferredRowsPerPage)

setHeaderCellRenderer

public void setHeaderCellRenderer(SortableTableHeaderRenderer cellRenderer)

getNextIcon

public java.lang.String getNextIcon()

setNextIcon

public void setNextIcon(java.lang.String nextIcon)

getPreviousIcon

public java.lang.String getPreviousIcon()

setPreviousIcon

public void setPreviousIcon(java.lang.String previousIcon)

preRender

public void preRender()
Description copied from interface: PropertyComponent

Make changes to the visual representation of this component before Echo starts rendering the component.

Do not modify any bound javabeans in this method, as the changes to these will not be reflected properly on the screen.

Specified by:
preRender in interface PropertyComponent
Overrides:
preRender in class CustomComponent

setPagerThreshold

public void setPagerThreshold(int i)

The minimum number of rows of data that automatically triggers the visibility of the pager.


setFont

public void setFont(Font f)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
f - The new font of the component.

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

setCellMargin

public void setCellMargin(int i)

getCellMargin

public int getCellMargin()

isAllowShowAll

public boolean isAllowShowAll()

setAllowShowAll

public void setAllowShowAll(boolean allowShowAll)

getRowCount

public int getRowCount()

getColumnCount

public int getColumnCount()

getColumnModel

public TableColumnModel getColumnModel()

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation

setConstructionList

public void setConstructionList(ConstructionList cl)

setColumnWidth

public void setColumnWidth(int column,
                           int width)

isAsync

public boolean isAsync()

setAsync

public void setAsync(boolean async)

changed

public void changed(java.util.Collection collection)
Specified by:
changed in interface CollectionChangeListener

getColumnWidthUnits

public int getColumnWidthUnits()

setColumnWidthUnits

public void setColumnWidthUnits(int columnWidthUnits)
Set the default column width units.

Parameters:
columnWidthUnits -

getColumnWidthUnits

public int getColumnWidthUnits(int column)
Returns the unit in which a column's width is specified.

Parameters:
column -
Returns:

setColumnWidthUnits

public void setColumnWidthUnits(int column,
                                int columnWidthUnits)
Sets the units in which width for an individual column is specified.

Parameters:
column -
columnWidthUnits -

isRemoveSelectionHandlesIfReadOnly

public boolean isRemoveSelectionHandlesIfReadOnly()

setRemoveSelectionHandlesIfReadOnly

public void setRemoveSelectionHandlesIfReadOnly(boolean removeSelectionHandlesIfReadOnly)
Should the selection handles on the table be removed if it is marked read-only ?

Parameters:
removeSelectionHandlesIfReadOnly -

isContainsFastColumns

public boolean isContainsFastColumns()

setContainsFastColumns

public void setContainsFastColumns(boolean value)
A table's memory consumption can be optimized by activating this option (it is by default). Columns will then only use a single component to render all rows. If a column allows editing in it's primary component specification (this is the first component type given in the construction list) then that column should be marked as being not a fast column.

See Also:
setFastColumn()

isFastColumn

public boolean isFastColumn(int column)

setFastColumn

public void setFastColumn(int column,
                          boolean value)
Marks an individual column as not optimized. That is to say a column marked as setFastColumn(..,false) will have an individual component for all rows of that column. Use this if your primary component is an editor, of one of it's descendant components is.

Parameters:
column -
value -

isFixedLayout

public boolean isFixedLayout()
See Also:
setFixedLayout()

setFixedLayout

public void setFixedLayout(boolean fixedLayout)
If a table is configured with fixed layout, none of the cell components will cause a colum to expand. Rather the contents of the cell will be clipped. If using this options, you should supply width specifications to all the columns and to the table itself. Also you should be sure that either the components for each column fits in the given column width, or some kind of 'full view' mechanism is available. For example a component that shows a long string could also set it's toolTipText to the full text, allowing people to hover over clipped strings to see the full content.


getHeaderBackgroundImage

public ImageReference getHeaderBackgroundImage()

setHeaderBackgroundImage

public void setHeaderBackgroundImage(ImageReference headerBackgroundImage)
Set this property to a background image you want to show in the header of the table. Typical usage would be setting a single pixel wide gradient, which would then repeat to give the table a nicer look.

Parameters:
headerBackgroundImage -

getCssClass

public java.lang.String getCssClass()

setCssClass

public void setCssClass(java.lang.String newValue)

getCssClassEven

public java.lang.String getCssClassEven()

setCssClassEven

public void setCssClassEven(java.lang.String newValue)

getCssClassOdd

public java.lang.String getCssClassOdd()

setCssClassOdd

public void setCssClassOdd(java.lang.String newValue)

getComparatorStyle

public int getComparatorStyle()

setComparatorStyle

public void setComparatorStyle(int comparatorStyle)
Selects the type of value you receive in you custom comparator.
  • COMPARATOR_STYLE_PROPERTYCOMPONENT results in a full property component that is used for rendering the sort column. (only if not using setContainsFastColumns(true)).
  • COMPARATOR_STYLE_BEAN results in the root element of the DynaTable.
  • COMPARATOR_STYLE_VALUE results in the real value of the sort column.

Parameters:
comparatorStyle -

isShowRowNumber

public boolean isShowRowNumber()

setShowRowNumber

public void setShowRowNumber(boolean showRowNumber)