org.rimudb.editor
Class DataSourceTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.rimudb.editor.swing.ATableModel
          extended by org.rimudb.editor.DataSourceTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class DataSourceTableModel
extends ATableModel

This class extends ATableModel to provide the model for a JTable that displays data sources.

Author:
Simon Ritchie
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DataSourceTableModel()
           
 
Method Summary
 void addElement(DataSourceEntry dataSource)
          Add the element DataSourceEntry to the end of the list.
 boolean containsName(java.lang.String name)
          Return true if the model contains a DataSourceEntry with the given name.
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
           
 int getColumnWidthPercent(int col)
          Return the width of a given column as a percent of the entire width.
 java.util.ArrayList<DataSourceEntry> getDataSources()
          Return a List of DataSourceEntry instances.
 DataSourceEntry getElement(int rowIndex)
          Return the element at rowIndex.
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 void remove(int row)
          Remove the row from the model.
 void updateElement(int selectedRow, DataSourceEntry dataSource)
          Update the element at selectedRow with a DataSourceEntry.
 
Methods inherited from class org.rimudb.editor.swing.ATableModel
getColumnFixedWidth
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceTableModel

public DataSourceTableModel()
Method Detail

getColumnWidthPercent

public int getColumnWidthPercent(int col)
Description copied from class: ATableModel
Return the width of a given column as a percent of the entire width.

Specified by:
getColumnWidthPercent in class ATableModel

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

getColumnName

public java.lang.String getColumnName(int column)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

remove

public void remove(int row)
Remove the row from the model.

Parameters:
row - int

getElement

public DataSourceEntry getElement(int rowIndex)
Return the element at rowIndex.

Parameters:
rowIndex - int
Returns:
DataSourceEntry

addElement

public void addElement(DataSourceEntry dataSource)
Add the element DataSourceEntry to the end of the list.

Parameters:
dataSource - DataSourceEntry

updateElement

public void updateElement(int selectedRow,
                          DataSourceEntry dataSource)
Update the element at selectedRow with a DataSourceEntry.

Parameters:
selectedRow - int
dataSource - DataSourceEntry

containsName

public boolean containsName(java.lang.String name)
Return true if the model contains a DataSourceEntry with the given name.

Parameters:
name - String
Returns:
boolean

getDataSources

public java.util.ArrayList<DataSourceEntry> getDataSources()
Return a List of DataSourceEntry instances.

Returns:
ArrayList


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.