|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
oracle.dacf.control.swing.GridDataSource
This class provides data to the JFC GridControl.
The data is obtained from a bound InfoBus data item that implements the ScrollableRowsetAccess interface. Other access interfaces (such as ArrayAccess) are not supported.
If the data item also implements the DataItemView interface, data retrieval will be much faster. Since the JTable object frequently requests data (for example, whenever it repaints a cell), performance of the JTable will be unacceptable unless the data item implements the DataItemView interface.
Field Summary | |
protected java.lang.String[] |
_columnLabels
|
protected javax.infobus.ScrollableRowsetAccess |
_cursor
|
protected GridControl |
_gridControl
|
protected int |
_rangeSize
|
protected int |
_rangeStart
|
protected int |
_rowCount
|
protected javax.infobus.ScrollableRowsetAccess |
_rowset
|
protected javax.swing.JTable |
_table
|
protected javax.infobus.DataItemView |
_view
|
protected javax.swing.JViewport |
_viewPort
|
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
GridDataSource(GridControl gridControl,
boolean forceReadOnly)
Creates the data source. |
Method Summary | |
protected oracle.dacf.control.swing.GridTableColumnModel |
_buildColumnModel(javax.infobus.ScrollableRowsetAccess rowset)
build a table column model, based on the widths specified. |
protected int |
_computeVisibleRowcount()
|
protected void |
_fireTableChanged(javax.swing.event.TableModelEvent event)
Fires the TableChanged event to the table. |
protected java.lang.Object |
_getColumnItem(javax.infobus.RowsetAccess rsAccess,
int colIndex)
|
protected void |
_getColumnLabels(javax.infobus.ScrollableRowsetAccess rowset)
|
protected java.lang.Object |
_getItemAt(int rowIndex,
int columnIndex)
Returns the data item value for the cell at columnIndex and rowIndex. |
protected int |
_getRecommendedRangeSize()
|
protected void |
_handleDataItemAdded(javax.infobus.DataItemAddedEvent e)
Indicates that a new item was added to the bound aggregate data item (e.g. |
protected void |
_handleDataItemDeleted(javax.infobus.DataItemDeletedEvent e)
Indicates that an item was deleted from the bound aggregate data item (e. |
protected void |
_handleDataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
Indicates a changed value in the bound data item. |
protected boolean |
_shouldUpdateRowcount(javax.infobus.DataItemValueChangedEvent e)
|
void |
dataItemAdded(javax.infobus.DataItemAddedEvent e)
Indicates that a new item was added to the bound aggregate data item (e.g. |
void |
dataItemChanged(java.lang.Object oldDataItem,
java.lang.Object newDataItem)
Notifies the data source that the bound data item has changed. |
void |
dataItemDeleted(javax.infobus.DataItemDeletedEvent e)
Indicates that an item was deleted from the bound aggregate data item (e. |
void |
dataItemRevoked(javax.infobus.DataItemRevokedEvent e)
Indicates that the bound data item (and its sub-items, if any) has been revoked, and is temporarily unavailable. |
void |
dataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
Indicates a changed value in the bound data item. |
java.lang.Class |
getColumnClass(int columnIndex)
Returns the lowest common denominator Class in the column. |
int |
getColumnCount()
Returns the number of columns managed by the data source object. |
java.lang.String |
getColumnName(int columnIndex)
Returns the name of the column at columnIndex. |
int |
getRowCount()
Returns the number of records managed by the data source object. |
protected int |
getRowCountFromRowsetAccess(javax.infobus.ScrollableRowsetAccess scr)
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns an attribute value for the cell at columnIndex and rowIndex. |
void |
init()
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns true if the cell at rowIndex and columnIndex is editable. |
protected boolean |
isForceReadOnly()
should the grid be forced to work in read only mode |
void |
rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent e)
Indicates that the cursor for the bound RowsetAccess data item has changed rows. |
protected void |
setForceReadOnly(boolean forceReadOnly)
set the grid to work in read only mode |
void |
setValueAt(java.lang.Object value,
int rowIndex,
int columnIndex)
Sets an attribute value for the record in the cell at columnIndex and rowIndex. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GridControl _gridControl
protected javax.swing.JTable _table
protected javax.infobus.ScrollableRowsetAccess _rowset
protected javax.infobus.ScrollableRowsetAccess _cursor
protected javax.infobus.DataItemView _view
protected int _rowCount
protected java.lang.String[] _columnLabels
protected javax.swing.JViewport _viewPort
protected int _rangeStart
protected int _rangeSize
Constructor Detail |
public GridDataSource(GridControl gridControl, boolean forceReadOnly)
gridControl
- The JFC GridControl.Method Detail |
public void init()
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
protected boolean isForceReadOnly()
protected void setForceReadOnly(boolean forceReadOnly)
forceReadOnly
- true if the grid should work in read only modepublic void dataItemChanged(java.lang.Object oldDataItem, java.lang.Object newDataItem)
This method is invoked by the GridControl.
oldDataItem
- The previously bound data item.newDataItem
- The new data item to bind to.public void dataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
A reference to the data item that changed can be obtained from the event.
dataItemValueChanged
in interface javax.infobus.DataItemChangeListener
DataItemChangeListener.dataItemValueChanged(javax.infobus.DataItemValueChangedEvent)
public void dataItemAdded(javax.infobus.DataItemAddedEvent e)
A reference to the data item that was added, and a reference to the one that gained it, can be obtained from the event.
dataItemAdded
in interface javax.infobus.DataItemChangeListener
DataItemChangeListener.dataItemAdded(javax.infobus.DataItemAddedEvent)
public void dataItemDeleted(javax.infobus.DataItemDeletedEvent e)
A reference to the data item that was deleted, and a reference to the one that lost it, can be obtained from the event.
dataItemDeleted
in interface javax.infobus.DataItemChangeListener
DataItemChangeListener.dataItemDeleted(javax.infobus.DataItemDeletedEvent)
public void dataItemRevoked(javax.infobus.DataItemRevokedEvent e)
A reference to the data item that was revoked can be obtained from the event.
dataItemRevoked
in interface javax.infobus.DataItemChangeListener
DataItemChangeListener.dataItemRevoked(javax.infobus.DataItemRevokedEvent)
public void rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent e)
A reference to the rowset data item can be obtained from the event.
rowsetCursorMoved
in interface javax.infobus.DataItemChangeListener
DataItemChangeListener.rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent)
public java.lang.String getColumnName(int columnIndex)
This is used to initialize the table's column header name. Note, this name does not need to be unique. Two columns on a table can have the same name.
getColumnName
in interface javax.swing.table.TableModel
columnIndex
- The column index.
public java.lang.Class getColumnClass(int columnIndex)
This is used by the table to set up a default renderer and editor for the column.
getColumnClass
in interface javax.swing.table.TableModel
columnIndex
- The column index.
public boolean isCellEditable(int rowIndex, int columnIndex)
Otherwise, setValueAt() on the cell will not change the value of that cell.
isCellEditable
in interface javax.swing.table.TableModel
rowIndex
- The row whose value is to be looked up.columnIndex
- The column whose value is to be looked up.
#setValueAt()
public int getColumnCount()
A JTable uses this method to determine how many columns it should create and display on initialization.
getColumnCount
in interface javax.swing.table.TableModel
getRowCount()
public int getRowCount()
A JTable uses this method to determine how many rows it should create and display.
This method should be quick, as it is called by JTable quite frequently.
getRowCount
in interface javax.swing.table.TableModel
getColumnCount()
protected int getRowCountFromRowsetAccess(javax.infobus.ScrollableRowsetAccess scr)
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
rowIndex
- The row whose value is to be looked up.columnIndex
- The column whose value is to be looked up.
public void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
setValueAt
in interface javax.swing.table.TableModel
value
- The new value.rowIndex
- The row whose value is to be changed.columnIndex
- The column whose value is to be changed.#getValueAt()
,
#isCellEditable()
protected java.lang.Object _getItemAt(int rowIndex, int columnIndex)
This method is used internally and is invoked by the GridControl directly for validation support.
rowIndex
- The row whose value is to be looked up.columnIndex
- The column whose value is to be looked up.
protected int _getRecommendedRangeSize()
protected int _computeVisibleRowcount()
protected void _handleDataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
Does the real work of handling the DataItemValueChanged event. A reference to the data item that changed can be obtained from the event.
DataItemChangeListener.dataItemValueChanged(javax.infobus.DataItemValueChangedEvent)
protected boolean _shouldUpdateRowcount(javax.infobus.DataItemValueChangedEvent e)
protected void _handleDataItemAdded(javax.infobus.DataItemAddedEvent e)
A reference to the data item that was added, and a reference to the one that gained it, can be obtained from the event.
DataItemChangeListener.dataItemAdded(javax.infobus.DataItemAddedEvent)
protected void _handleDataItemDeleted(javax.infobus.DataItemDeletedEvent e)
A reference to the data item that was deleted, and a reference to the one that lost it, can be obtained from the event.
DataItemChangeListener.dataItemDeleted(javax.infobus.DataItemDeletedEvent)
protected void _fireTableChanged(javax.swing.event.TableModelEvent event)
This class is not thread-safe for Swing.
#_fireTableChangedLater
protected void _getColumnLabels(javax.infobus.ScrollableRowsetAccess rowset)
protected oracle.dacf.control.swing.GridTableColumnModel _buildColumnModel(javax.infobus.ScrollableRowsetAccess rowset)
rowset
- for which the table column model has to be built
protected java.lang.Object _getColumnItem(javax.infobus.RowsetAccess rsAccess, int colIndex)
|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.