LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.table
Class LyJTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by leon.view.win.swing.table.LyJTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class LyJTableModel
extends javax.swing.table.AbstractTableModel

This class is the link between the leon data source and the table component. It is managing the population of the table.

See Also:
Serialized Form

Field Summary
static java.lang.String __VERSION
           
static java.lang.String EMPTY_CELL_STATUS_VALUE
          The empty status cell.
static java.lang.String EMPTY_CELL_VALUE
          The empty cell.
static int EMPTY_ROW_COUNT
          The number of empty rows.
 
Constructor Summary
LyJTableModel(LySwingTable swingTable)
          Creates a table model for the specified table.
 
Method Summary
 java.lang.Class<?> getColumnClass(int i)
          Gets the class of the datas in the specified column.
 int getColumnCount()
          Counts one more empty column for a better visual aspect.
 java.lang.Object getColumnFooterValue(int i)
          Gets the value object of the specified footer column.
 java.lang.Object getColumnHeaderValue(int i)
          Gets the header label of the specified column.
 java.lang.String getColumnName(int i)
          Gets the text label of the specified column.
 int getDataColumnCount()
          Gets the number of columns with value.
 int getDataRowCount()
          Gets the number of rows with values.
 int getEmptyRowCount()
          Gets the default number of empty rows.
 java.lang.Object getLock()
          Get a lock on the table to prevent concurrent access on rows return a valid lock for synchronized()
 LySwingRow getRowAt(int idx)
          Gets the graphical row at the specified index.
 int getRowCount()
          Counts some empty rows for a better visual aspect.
 java.lang.String getRowId(int index)
          Gets the identifier of the specified row.
 java.awt.Image getRowImage(int index)
          Gets the image of the specified row.
 java.lang.String getRowToolTip(int index)
          Gets the tooltip of the specified row.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Gets the value of the cell at the specified row and column indices.
 boolean isCellEditable(int row, int column)
          Gets the editable state of the cell at the specified position.
 void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
          Nothing is done.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

EMPTY_CELL_VALUE

public static final java.lang.String EMPTY_CELL_VALUE
The empty cell.

See Also:
Constant Field Values

EMPTY_CELL_STATUS_VALUE

public static final java.lang.String EMPTY_CELL_STATUS_VALUE
The empty status cell.

See Also:
Constant Field Values

EMPTY_ROW_COUNT

public static int EMPTY_ROW_COUNT
The number of empty rows.

Constructor Detail

LyJTableModel

public LyJTableModel(LySwingTable swingTable)
Creates a table model for the specified table.

Parameters:
swingTable - the associated swing table
Method Detail

getColumnCount

public int getColumnCount()
Counts one more empty column for a better visual aspect.

See Also:
TableModel.getColumnCount()

getRowCount

public int getRowCount()
Counts some empty rows for a better visual aspect.

See Also:
TableModel.getRowCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Gets the value of the cell at the specified row and column indices. If the cell at (rowIndex, columnIndex) doesn't truly exists, returns a flag that will be used by the renderer.

See Also:
setValueAt(Object, int, int), TableModel.getValueAt(int, int)

getColumnName

public java.lang.String getColumnName(int i)
Gets the text label of the specified column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnName(int)

getColumnClass

public java.lang.Class<?> getColumnClass(int i)
Gets the class of the datas in the specified column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnClass(int)

setValueAt

public void setValueAt(java.lang.Object value,
                       int rowIndex,
                       int columnIndex)
Nothing is done.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
See Also:
getValueAt(int, int), TableModel.setValueAt(java.lang.Object, int, int)

getColumnHeaderValue

public java.lang.Object getColumnHeaderValue(int i)
Gets the header label of the specified column.

Parameters:
i - the index of the column
Returns:
the object used to display the text of the column header at position i

getRowAt

public LySwingRow getRowAt(int idx)
Gets the graphical row at the specified index.

Parameters:
idx - the index of the row to retrieve
Returns:
the data source of the row at position i

getEmptyRowCount

public int getEmptyRowCount()
Gets the default number of empty rows.

Returns:
the number of empty rows

getColumnFooterValue

public java.lang.Object getColumnFooterValue(int i)
Gets the value object of the specified footer column.

Parameters:
i - the index of the column
Returns:
the object used to display the text of the column footer at position i

getDataRowCount

public int getDataRowCount()
Gets the number of rows with values.

Returns:
the number of not empty rows

getDataColumnCount

public int getDataColumnCount()
Gets the number of columns with value.

Returns:
the number of not empty column

getRowImage

public java.awt.Image getRowImage(int index)
Gets the image of the specified row.

Parameters:
index - the index of the row
Returns:
the image of the specified row

getRowToolTip

public java.lang.String getRowToolTip(int index)
Gets the tooltip of the specified row.

Parameters:
index - the index of the row
Returns:
the tooltip to display

getRowId

public java.lang.String getRowId(int index)
Gets the identifier of the specified row.

Parameters:
index - the index of the row
Returns:
the id of this row

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Gets the editable state of the cell at the specified position.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - the row of the cell
column - the column of the cell
Returns:
true if the specified cell is an editable field component, false otherwise
See Also:
TableModel.isCellEditable(int, int)

getLock

public java.lang.Object getLock()
Get a lock on the table to prevent concurrent access on rows return a valid lock for synchronized()


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com