org.openswing.swing.table.model.client
Class VOListAdapter

java.lang.Object
  extended byorg.openswing.swing.table.model.client.VOListAdapter

public class VOListAdapter
extends java.lang.Object

Title: OpenSwing Framework

Description: Adapter used to link TableModel columns and a ValueObject.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it


Constructor Summary
VOListAdapter(java.lang.Class valueObjectType, GridController tableContainer, Column[] colProperties, Grids grids)
           
 
Method Summary
 void finalize()
           
 javax.swing.table.TableCellEditor getCellEditor(int colIndex)
           
 javax.swing.table.TableCellRenderer getCellRenderer(int colIndex)
           
 java.lang.Object getField(ValueObject obj, int colIndex)
           
 java.lang.Class getFieldClass(int colIndex)
           
 Column getFieldColumn(int colIndex)
           
 int getFieldCount()
           
 int getFieldIndex(java.lang.String fieldName)
           
 int getFieldMaxWidth(int colIndex)
           
 int getFieldMinWidth(int colIndex)
           
 java.lang.String getFieldName(int colIndex)
           
 int getFieldPreferredWidth(int colIndex)
           
 int getFieldType(int colIndex)
           
 Grids getGrids()
           
 GridController getTableContainer()
           
 java.lang.Class getValueObjectType()
           
 boolean isFieldDuplicable(int colIndex)
           
 boolean isFieldEditable(int colIndex)
          Method not supported.
 boolean isFieldEditable(int mode, int rowNumber, int colIndex)
           
 void setField(ValueObject obj, int colIndex, java.lang.Object value)
           
 void setField(ValueObject obj, java.lang.String attributeName, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VOListAdapter

public VOListAdapter(java.lang.Class valueObjectType,
                     GridController tableContainer,
                     Column[] colProperties,
                     Grids grids)
Parameters:
valueObjectType - ValueObject type
tableContainer - grid container
colProperties - list of TableModel column properties (name, type, etc)
Method Detail

getFieldCount

public final int getFieldCount()
Returns:
TableModel columns count

getFieldName

public final java.lang.String getFieldName(int colIndex)
Parameters:
colIndex - TableModel column index
Returns:
TableModel column name

getField

public final java.lang.Object getField(ValueObject obj,
                                       int colIndex)
Parameters:
obj - ValueObject related to the current row
colIndex - TableModel column index
Returns:
Object contained into the TableModel at the specified column and ValueObject

setField

public final void setField(ValueObject obj,
                           int colIndex,
                           java.lang.Object value)
Parameters:
obj - ValueObject where updating the value for the specified attribute (identified by colunm index)
colIndex - TableModel column index
value - new Object to set onto ValueObject

setField

public final void setField(ValueObject obj,
                           java.lang.String attributeName,
                           java.lang.Object value)
Parameters:
obj - ValueObject where updating the value for the specified attribute (identified by colunm index)
attributeName - attribute name
value - new Object to set onto ValueObject

getCellRenderer

public final javax.swing.table.TableCellRenderer getCellRenderer(int colIndex)
Parameters:
colIndex - TableModel column index
Returns:
TableCellRenderer for the specified column

getCellEditor

public final javax.swing.table.TableCellEditor getCellEditor(int colIndex)
Parameters:
colIndex - TableModel column index
Returns:
TableCellEditor for the specified column

isFieldEditable

public final boolean isFieldEditable(int colIndex)
Method not supported.


isFieldEditable

public final boolean isFieldEditable(int mode,
                                     int rowNumber,
                                     int colIndex)
Parameters:
mode - current edit grid mode
rowNumber - TableModel row index
colIndex - TableModel column index
Returns:
true means that the cell having the specified row and column index is editable, false otherwise

isFieldDuplicable

public final boolean isFieldDuplicable(int colIndex)
Parameters:
colIndex - TableModel column index
Returns:
true means that the cell having the specified column index is duplicable, false otherwise

getFieldClass

public final java.lang.Class getFieldClass(int colIndex)
Parameters:
colIndex - TableModel column index
Returns:
column type

getFieldType

public final int getFieldType(int colIndex)
Parameters:
colIndex - column index in table model
Returns:
column type

getFieldPreferredWidth

public final int getFieldPreferredWidth(int colIndex)
Parameters:
colIndex - column index in table model
Returns:
column preferred width

getFieldMinWidth

public final int getFieldMinWidth(int colIndex)
Parameters:
colIndex - column index in table model
Returns:
column minimum width

getFieldMaxWidth

public final int getFieldMaxWidth(int colIndex)
Parameters:
colIndex - column index in table model
Returns:
column maximum width

getFieldColumn

public final Column getFieldColumn(int colIndex)
Parameters:
colIndex - column index in table model
Returns:
column maximum width

getTableContainer

public final GridController getTableContainer()
Returns:
grid container

getValueObjectType

public final java.lang.Class getValueObjectType()
Returns:
ValueObject type

getFieldIndex

public final int getFieldIndex(java.lang.String fieldName)
Parameters:
fieldName - attribute name
Returns:
int column index

getGrids

public final Grids getGrids()
Returns:
grid

finalize

public final void finalize()