net.sf.echobinding.datacontrol
Class FormColumnTable<T>

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.app.Column
          extended by net.sf.echobinding.datacontrol.FormColumnTable<T>
All Implemented Interfaces:
java.io.Serializable, EditableTable<T>, nextapp.echo2.app.RenderIdSupport

public abstract class FormColumnTable<T>
extends nextapp.echo2.app.Column
implements EditableTable<T>

A editable table that allows inline editing. A FormColumnTable organizes the table data within one Column component. Each item in the list will be added to the column as a Row. This row has to be defined by overwriting the abstract method ceateRow(BindingContext ctx, int rowNummer).

If you supply a PersistenceMangager, you can add new rows to the table by calling the addRow() method. Again, new rows will be added to the table by the ceateRow(BindingContext ctx, int rowNummer) method.

See Also:
Serialized Form

Field Summary
protected  nextapp.echo2.app.event.ActionListener _actionListener
           
protected  BindingContext _ctx
           
protected  java.util.List<T> _list
           
 
Fields inherited from class nextapp.echo2.app.Column
PROPERTY_BORDER, PROPERTY_CELL_SPACING, PROPERTY_INSETS
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
FormColumnTable(java.util.List<T> list, BindingContext ctx)
           
 
Method Summary
 void addRow()
          Adds a new row to the table.
 void copyRow(BindingContext context)
          Creates a copy of the selected row and adds it to the table.
abstract  nextapp.echo2.app.Component createRow(BindingContext ctx, int rowNumber)
          Defines how a table row should look like.
 void deleteRow(BindingContext context)
          Removes the selected row from the table.
 void editRow(BindingContext context)
          Shows the selected row in the edit form for editing.
protected  nextapp.echo2.app.event.ActionListener getActionListener()
           
 BindingContext getContext()
          Returns the binding context.
 java.util.List<T> getList()
          Returns the list.
 PersistenceManager<T> getPersistenceManager()
          Returns the persistence manager.
 void init()
           
protected  void initialize()
           
 boolean isPersistent(int row)
          Decides wether a row is persistent or not.
 void save()
          Saves each row object.
 void saveRow(BindingContext context)
          Synchronizes the widgets in the form with the underlying bean.
protected  void setActionListener(nextapp.echo2.app.event.ActionListener actionListener)
           
 void setContext(BindingContext ctx)
          Sets the binding context.
 void setList(java.util.List<T> list)
          Sets the list.
 void setPersistenceManager(PersistenceManager<T> persistenceManager)
          Sets the persistence manager.
 
Methods inherited from class nextapp.echo2.app.Column
getBorder, getCellSpacing, getInsets, setBorder, setCellSpacing, setInsets
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, processInput, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_list

protected java.util.List<T> _list

_ctx

protected BindingContext _ctx

_actionListener

protected nextapp.echo2.app.event.ActionListener _actionListener
Constructor Detail

FormColumnTable

public FormColumnTable(java.util.List<T> list,
                       BindingContext ctx)
Parameters:
list -
ctx -
Method Detail

init

public void init()
Overrides:
init in class nextapp.echo2.app.Component

initialize

protected void initialize()

createRow

public abstract nextapp.echo2.app.Component createRow(BindingContext ctx,
                                                      int rowNumber)
Defines how a table row should look like.

Parameters:
ctx -
rowNumber -
Returns:

addRow

public void addRow()
Description copied from interface: EditableTable
Adds a new row to the table.

Specified by:
addRow in interface EditableTable<T>

deleteRow

public void deleteRow(BindingContext context)
Description copied from interface: EditableTable
Removes the selected row from the table.

Specified by:
deleteRow in interface EditableTable<T>

copyRow

public void copyRow(BindingContext context)
Description copied from interface: EditableTable
Creates a copy of the selected row and adds it to the table.

Specified by:
copyRow in interface EditableTable<T>

saveRow

public void saveRow(BindingContext context)
Description copied from interface: EditableTable
Synchronizes the widgets in the form with the underlying bean. Will send saveObject(bean) to the persistence manager for making the changes persistent.

Specified by:
saveRow in interface EditableTable<T>

editRow

public void editRow(BindingContext context)
Description copied from interface: EditableTable
Shows the selected row in the edit form for editing.

Specified by:
editRow in interface EditableTable<T>

getActionListener

protected nextapp.echo2.app.event.ActionListener getActionListener()

setActionListener

protected void setActionListener(nextapp.echo2.app.event.ActionListener actionListener)

isPersistent

public boolean isPersistent(int row)
Description copied from interface: EditableTable
Decides wether a row is persistent or not. Not persitent rows will be highlightet in the table.

Specified by:
isPersistent in interface EditableTable<T>
Returns:

save

public void save()
Saves each row object.

See Also:
PersistenceManager

getPersistenceManager

public PersistenceManager<T> getPersistenceManager()
Returns the persistence manager. If no persistence manager is set, the default persistence manager will be used.

Returns:
Returns the persistence manager.

setPersistenceManager

public void setPersistenceManager(PersistenceManager<T> persistenceManager)
Sets the persistence manager.

Parameters:
persistenceManager - The persistence manager to set.

getContext

public BindingContext getContext()
Returns the binding context.

Returns:
the binding context

setContext

public void setContext(BindingContext ctx)
Sets the binding context.

Parameters:
ctx - The context to set.

getList

public java.util.List<T> getList()
Returns the list.

Returns:
the list

setList

public void setList(java.util.List<T> list)
Sets the list.

Parameters:
list - the list to set.


Copyright © 2007. All Rights Reserved.