Package com.portal.app.cc.sharing
Class PGroupModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.portal.app.cc.sharing.PAbstractSortingTableModel
com.portal.app.cc.sharing.PGroupModel
- All Implemented Interfaces:
Serializable
,TableModel
PGroupModel is a simple table model to display groups having
current account as owner
extending from PAbstractSortingTableModel.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionPGroupModel
(String sharingType, POwnershipPanel parent) Constructs anPGroupModel
with the specified sharing type key. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
formatTable
(JTable table) Customizing the table according to derived class needs.getColumnClass
(int columnIndex) Returns objects class with respect tocolumnIndex
.int
Returns the number of columns in the model.getColumnName
(int col) Returns the name of the column atcol
.protected Object
getValueForColumn
(Object element, int columnIndex) Returns the cell value from the passed row data structure atcolumnIndex
.void
Setting of data to the model.protected void
sortOnColumn
(int sortColumn) This will sort the data structure on the passed column indexsortColumn
and fire the model to update the view.Methods inherited from class com.portal.app.cc.sharing.PAbstractSortingTableModel
getLastClickedColumn, getRowAt, getRowCount, getSelectedData, getSelectedDataArray, getTable, getValueAt, setAscending, setData, sortOnColumnOfRange
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
PGroupModel
Constructs anPGroupModel
with the specified sharing type key.- Parameters:
sharingType
- the sharing type key.parent
- POwnershipPanel the owner ship panel.
-
-
Method Details
-
getValueForColumn
Returns the cell value from the passed row data structure atcolumnIndex
.- Specified by:
getValueForColumn
in classPAbstractSortingTableModel
- Parameters:
element
- Object the row objectcolumnIndex
- int the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
getColumnName
Returns the name of the column atcol
. 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.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
col
- the index of the column- Returns:
- the name of the column
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model. AJTable
uses this method to determine how many columns it should create and display by default.- Returns:
- the number of columns in the model
-
getColumnClass
Returns objects class with respect tocolumnIndex
.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried
-
setData
Setting of data to the model. As well resetting the row height of a table for the updated data.- Parameters:
l
- ArrayList the groups
-
formatTable
Customizing the table according to derived class needs.- Overrides:
formatTable
in classPAbstractSortingTableModel
- Parameters:
table
- JTable Subclasses should override this, but also call super.formatTable(table)
-
sortOnColumn
protected void sortOnColumn(int sortColumn) This will sort the data structure on the passed column indexsortColumn
and fire the model to update the view. Subclasses should override this, but also call super.sortOnColumn(sortColumn) for simple sorring- Overrides:
sortOnColumn
in classPAbstractSortingTableModel
- Parameters:
sortColumn
- int the column index on which sorting should happen.
-