org.openrdf.sesame.config.ui
Class XTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.openrdf.sesame.config.ui.XTableModel
All Implemented Interfaces:
Serializable, SystemConfigListener, TableModel
Direct Known Subclasses:
AccessControlTableModel, ParameterTableModel, RepositoryTableModel, SailTableModel, UserTableModel

public abstract class XTableModel
extends AbstractTableModel
implements SystemConfigListener

WRITEME

Version:
$Revision: 1.4.4.2 $
Author:
Peter van 't Hof, Arjohn Kampman
See Also:
Serialized Form

Constructor Summary
XTableModel(SystemConfig config, ColumnData[] columns)
          Creates a new XTableModel having the specified columns.
 
Method Summary
 void addNewRow(int rowIdx)
          Adds a new row at the supplied row index
 int getColumnAlignment(int column)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 int getColumnWidth(int column)
           
abstract  int getIdentifyingColumn()
          Gets the index of the identifying column.
 int getRowCount()
           
 int getRowIndex(String rowID)
          Gets the index of the row having the specified value as its identifier.
 boolean isCellEditable(int row, int column)
          By default every cell in an XTableModel is editable.
 void removeNewRow()
          Removes the new row
 boolean rowIsNew(int rowIdx)
          Checks if the row at the supplied row index is new.
 boolean valueIsNew(int row, int column)
          Checks if the value at the supplied row and column index is new.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.sesame.config.SystemConfigListener
configurationChanged
 
Methods inherited from interface javax.swing.table.TableModel
getValueAt
 

Constructor Detail

XTableModel

public XTableModel(SystemConfig config,
                   ColumnData[] columns)
Creates a new XTableModel having the specified columns.

Method Detail

isCellEditable

public boolean isCellEditable(int row,
                              int column)
By default every cell in an XTableModel is editable.

Specified by:
isCellEditable in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel

getColumnWidth

public int getColumnWidth(int column)

getColumnAlignment

public int getColumnAlignment(int column)

getIdentifyingColumn

public abstract int getIdentifyingColumn()
Gets the index of the identifying column. Every row in a table is identified by the value of a specific column, e.g. the user table is identified by its login column, the repository table is identified by its repositoryID column, etc.

Returns:
The index of the identifying column (0-based).

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getRowIndex

public int getRowIndex(String rowID)
Gets the index of the row having the specified value as its identifier.

Parameters:
rowID - A value for the identifying column in the table.
Returns:
The row index (0-based), or -1 if the ID was not found.

addNewRow

public void addNewRow(int rowIdx)
Adds a new row at the supplied row index

Parameters:
rowIdx - The index of the new row in the table.

removeNewRow

public void removeNewRow()
Removes the new row


rowIsNew

public boolean rowIsNew(int rowIdx)
Checks if the row at the supplied row index is new.

Parameters:
rowIdx - An row index.
Returns:
true if the row was new, false otherwise.

valueIsNew

public boolean valueIsNew(int row,
                          int column)
Checks if the value at the supplied row and column index is new.

Parameters:
row - Row index
column - Column index
Returns:
Boolean indicating if the value is new


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.