org.glite.wmsui.guij
Class JobTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byjavax.swing.table.DefaultTableModel
          extended byorg.glite.wmsui.guij.JobTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class JobTableModel
extends javax.swing.table.DefaultTableModel

Implementation of the JobTableModel class

Version:
1.0
Author:
Giuseppe Avellino
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JobTableModel(java.util.Vector columnNames, int rowCount)
          Constructor.
JobTableModel(java.util.Vector data, java.util.Vector columnNames)
          Constructor.
 
Method Summary
 int getColumnPreferredWidth(javax.swing.JTable table, javax.swing.table.TableColumn column)
          Gets the column preferred width necessary to show the widest element present in the column.
 int getElementPresentInColumnCount(java.lang.String element, int column)
          Checks if the specified element is present in the specified column and returns the number of the element occurences.
 int getElementPresentInColumnCountCi(java.lang.String element, int column)
          Checks if the specified element is present in the specified column and returns the number of the element occurences.
 int getIndexOfElementInColumn(java.lang.String element, int column)
          Checks if the specified element is present in the specified column and returns the index of the first occurence of the element.
 int getIndexOfElementInColumnCi(java.lang.String element, int column)
          Checks if the specified element is present in the specified column and returns the index of the first occurence of the element.
 int getIndexOfRow(java.lang.String rowElement)
          Checks if the specified row is present in the table and returns the index of the first occurence of the row.
 boolean isCellEditable(int row, int column)
          Checks if the specified table cell is editable or not.
 boolean isElementPresentInColumn(java.lang.String element, int column)
          Checks if the specified element is present in the specified column.
 boolean isElementPresentInColumnCi(java.lang.String element, int column)
          Checks if the specified element is present in the specified column.
 boolean isRowPresent(java.lang.String rowElement)
          Checks if the specified row is present in the table.
 void removeAllRows()
          Removes all table rows.
 void setColumnEditable(int index, boolean bool)
          Sets whether or not specified column is editable.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobTableModel

public JobTableModel(java.util.Vector columnNames,
                     int rowCount)
Constructor.


JobTableModel

public JobTableModel(java.util.Vector data,
                     java.util.Vector columnNames)
Constructor.

Method Detail

removeAllRows

public void removeAllRows()
Removes all table rows.


isCellEditable

public boolean isCellEditable(int row,
                              int column)
Checks if the specified table cell is editable or not.

Parameters:
row - cell row index
column - cell column index
Returns:
true if the cell is editable, false otherwise or if row or column of the specified cell is out of bounds

setColumnEditable

public void setColumnEditable(int index,
                              boolean bool)
Sets whether or not specified column is editable.

Parameters:
index - column index
bool - true if this component should be editable, false otherwise

isRowPresent

public boolean isRowPresent(java.lang.String rowElement)
Checks if the specified row is present in the table.

Parameters:
rowElement - string concatenation of the table row cells
Returns:
true if the specified row is present, false otherwise

getIndexOfRow

public int getIndexOfRow(java.lang.String rowElement)
Checks if the specified row is present in the table and returns the index of the first occurence of the row.

Parameters:
rowElement - string concatenation of the table row cells
Returns:
the index of the row if present, -1 otherwise

isElementPresentInColumn

public boolean isElementPresentInColumn(java.lang.String element,
                                        int column)
Checks if the specified element is present in the specified column.

Parameters:
element - element to find
column - column index
Returns:
true if the element is present, false otherwise

isElementPresentInColumnCi

public boolean isElementPresentInColumnCi(java.lang.String element,
                                          int column)
Checks if the specified element is present in the specified column. The search for element is case insensitive.

Parameters:
element - element to find
column - column index
Returns:
true if the element is present, false otherwise

getIndexOfElementInColumn

public int getIndexOfElementInColumn(java.lang.String element,
                                     int column)
Checks if the specified element is present in the specified column and returns the index of the first occurence of the element.

Parameters:
element - element to find
column - column index
Returns:
the table row index where the element is present, if one, -1 otherwise

getIndexOfElementInColumnCi

public int getIndexOfElementInColumnCi(java.lang.String element,
                                       int column)
Checks if the specified element is present in the specified column and returns the index of the first occurence of the element. The search for the element is case insensitive.

Parameters:
element - element to find
column - column index
Returns:
the table row index where the element is present, if one, -1 otherwise

getElementPresentInColumnCount

public int getElementPresentInColumnCount(java.lang.String element,
                                          int column)
Checks if the specified element is present in the specified column and returns the number of the element occurences.

Parameters:
element - element to find
column - column index
Returns:
number of occurences of the element in the specified table column

getElementPresentInColumnCountCi

public int getElementPresentInColumnCountCi(java.lang.String element,
                                            int column)
Checks if the specified element is present in the specified column and returns the number of the element occurences. The search of the element is case insensitive.

Parameters:
element - element to find
column - column index
Returns:
number of occurences of the element in the specified table column

getColumnPreferredWidth

public int getColumnPreferredWidth(javax.swing.JTable table,
                                   javax.swing.table.TableColumn column)
Gets the column preferred width necessary to show the widest element present in the column.

Parameters:
table - the table containing the column
column - table column
Returns:
the column preferred width