public final class PGroupSharingTableModel extends PAbstractSortingTableModel
listenerList
Constructor and Description |
---|
PGroupSharingTableModel(String sharingType,
boolean selectionMode)
Constructs an
PGroupModel with the specified mode. |
Modifier and Type | Method and Description |
---|---|
void |
fireTableDataChanged()
Notifies all listeners that all cell values in the table's
rows may have changed.
|
protected void |
formatTable(JTable table)
Customizing the table according to derived class needs.
|
Class |
getColumnClass(int columnIndex)
Returns objects class with respect to
columnIndex . |
int |
getColumnCount()
Returns the number of columns in the model.
|
String |
getColumnName(int col)
Returns the name of the column at
col . |
Object |
getValueForColumn(Object e,
int columnIndex)
Returns the cell value from the passed row data structure
at
columnIndex . |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns
true only for the selection column. |
void |
setData(ArrayList l)
Setting of data to the model.
|
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
This will provide the implementation to set the
selection of the sharing only.
|
protected void |
sortOnColumn(int sortColumn)
This will sort the data structure on the passed column index
sortColumn and fire the model to update the view. |
getLastClickedColumn, getRowAt, getRowCount, getSelectedData, getSelectedDataArray, getTable, getValueAt, setAscending, setData, sortOnColumnOfRange
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public PGroupSharingTableModel(String sharingType, boolean selectionMode)
PGroupModel
with the specified mode.
If the selection mode is true this model will provide
an extra column to give selection through check boxes.sharingType
- String the sharing type keyselectionMode
- booleanpublic Object getValueForColumn(Object e, int columnIndex)
columnIndex
.getValueForColumn
in class PAbstractSortingTableModel
e
- Object the row objectcolumnIndex
- int the column whose value is to be queriedpublic String getColumnName(int col)
col
. This is used
to initialize the table's column header name. Note: this name does
not need to be unique; two columns in a table can have the same name.getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
col
- the index of the columnpublic int getColumnCount()
JTable
uses this method to determine how many columns it
should create and display by default.public boolean isCellEditable(int rowIndex, int columnIndex)
true
only for the selection column.isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
rowIndex
- the row being queriedcolumnIndex
- the column being queriedpublic Class getColumnClass(int columnIndex)
columnIndex
.getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
columnIndex
- the column being queriedpublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
aValue
- value to assign to cellrowIndex
- row of cellcolumnIndex
- column of cellpublic void fireTableDataChanged()
JTable
should redraw the
table from scratch. The structure of the table (as in the order of the
columns) is assumed to be the same.
This is overriden method of AbstractTableModel
to
re set the row heights.fireTableDataChanged
in class AbstractTableModel
public void setData(ArrayList l)
l
- ArrayList the sharingsprotected void formatTable(JTable table)
formatTable
in class PAbstractSortingTableModel
table
- JTable
Subclasses should override this, but also call super.formatTable(table)protected void sortOnColumn(int sortColumn)
sortColumn
and fire the model to update the view.
Subclasses should override this, but also call
super.sortOnColumn(sortColumn) for simple sorringsortOnColumn
in class PAbstractSortingTableModel
sortColumn
- int the column index on which sorting should happen.Copyright © 2003, 2023, Oracle and/or its affiliates.