Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


oracle.jbo.uicli.jui
Class JUTableBinding

java.lang.Object
  |
  +--oracle.jbo.uicli.binding.JUControlBinding
        |
        +--oracle.jbo.uicli.binding.JUCtrlValueBinding
              |
              +--oracle.jbo.uicli.binding.JUCtrlRangeBinding
                    |
                    +--oracle.jbo.uicli.jui.JUTableBinding
All Implemented Interfaces:
AttributeList, java.util.EventListener, java.awt.event.HierarchyListener, JUPanelStopEditingListener, javax.swing.table.TableModel

public class JUTableBinding
extends JUCtrlRangeBinding
implements javax.swing.table.TableModel, JUPanelStopEditingListener, java.awt.event.HierarchyListener

A lightweight TableModel that implements binding a javax.swing.JTable to a RowIterator for a BC4J ViewObject.

Applications should subclass this binding and return a subclass of JUTableModel that can:

This class creates a runtime instance of JUTableModel to interact with a JTable instance. It is responsible for:

See Also:
RowIterator, ViewObject, JTable, TableModel, AbstractTableModel

Nested Class Summary
protected  class JUTableBinding.JUTableModel
          This TableModel is used by JUTableBinding to perform updates of the JTable control to which it is bound.

 

Constructor Summary
JUTableBinding(javax.swing.JTable control, JUIteratorBinding iterBinding, java.lang.String[] attrNames)
          Creates an instance of JUTableModel that performs the binding of a BC4J ViewObject with a JTable.

 

Method Summary
 void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
          *** For internal framework use only ***
 void addTableModelListener(javax.swing.event.TableModelListener l)
           
static javax.swing.table.TableModel createAttributeListBinding(JUPanelBinding formBinding, javax.swing.JTable control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames)
          Creates an instance of JUTableBinding to return.
static javax.swing.table.TableModel createAttributeListBinding(JUPanelBinding formBinding, javax.swing.JTable control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames, boolean columnSort, JUTableSortModel sorter)
          Creates an instance of JUTableBinding to return.
 java.lang.Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
static javax.swing.table.TableModel getInstance(JUPanelBinding formBinding, javax.swing.JTable control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames)
          Deprecated. since 9.0.2
 java.lang.Object getLayoutObject()
          *** For internal framework use only ***
 JUTableBinding.JUTableModel getModel()
           
protected  JUTableBinding.JUTableModel getModelImpl(javax.swing.JTable control)
          Returns an instance of JUTableModel that this binding works with and is applied as the JTableModel to the given JTable control.
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the value as stored in the control at a given row and column index.
 void hierarchyChanged(java.awt.event.HierarchyEvent e)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
protected  boolean isControlQueriable()
          Returns true by default to imply that this binding supports Find mode.
 void removeTableModelListener(javax.swing.event.TableModelListener l)
           
 void setLayoutObject(javax.swing.JScrollPane scrollPane)
          *** For internal framework use only ***
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          Sets the given value from a BC4J row into the control at the given row/column.
 void stopEditing()
          Notification method to this listener to stop editing.
 void updateNavigated(NavigationEvent event)
          Adjusts the display to move the current row selection to the new current row.
 void updateRangeScrolled(ScrollEvent event)
          Adjusts the scrollbar of the associated JTable and also refreshes the display with the current set of rows in range in the associated RowIterator.
 void updateRowDeleted(DeleteEvent event)
          When a row is deleted in the associated iterator, this method gets invoked by the framework, so that this binding can update the displayed rows in the JTable after stopping the edit function on the current cell (if a cell was being edited).
 void updateRowInserted(InsertEvent event)
          When a new row is inserted into the associated Iterator, this method gets invoked by the framework.
 void updateValuesFromRows(Row[] rows, boolean clear)
          Updates the JTable's display with the given set of rows after optionally clearing out the current rows (if clear is true).

 

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlRangeBinding
getEstimatedRowCount, refreshControl, updateValuesFromRow

 

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
findAttributeDef, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDefs, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributeNames, getAttributeValues, isArrayIteratorType, isAttributeUpdateable, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow

 

Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
executeQuery, executeQueryIfNeeded, getAllRowsInRange, getApplicationModule, getControl, getCurrentRow, getDef, getFormBinding, getIteratorBinding, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, reportException, reportException, setFormBinding, setName

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

JUTableBinding

public JUTableBinding(javax.swing.JTable control,
JUIteratorBinding iterBinding,
                      java.lang.String[] attrNames)
Creates an instance of JUTableModel that performs the binding of a BC4J ViewObject with a JTable. This binding class performs the role of an intermediary between the JUTableModel which implements a TableModel to work with the JTable object and the BC4J framework.

This class is responsible for:

Method Detail

createAttributeListBinding

public static javax.swing.table.TableModel createAttributeListBinding(JUPanelBinding formBinding,
                                                                      javax.swing.JTable control,
                                                                      java.lang.String voInstanceName,
                                                                      java.lang.String voIterName,
                                                                      java.lang.String voIterBindingName,
                                                                      java.lang.String[] attrNames)
Creates an instance of JUTableBinding to return. Registers this binding as a binding that has its own cell-editor that needs to be notified for stopping/cancelling edits when the panel needs to invoke a panel-level operation like changing find/data mode and so forth.

createAttributeListBinding

public static javax.swing.table.TableModel createAttributeListBinding(JUPanelBinding formBinding,
                                                                      javax.swing.JTable control,
                                                                      java.lang.String voInstanceName,
                                                                      java.lang.String voIterName,
                                                                      java.lang.String voIterBindingName,
                                                                      java.lang.String[] attrNames,
                                                                      boolean columnSort,
JUTableSortModel sorter)
Creates an instance of JUTableBinding to return. Registers this binding as a binding that has it's own cell-editor that needs to be notified for stopping/cancelling edits when the panel needs to invoke a panel-level operation like change find/datamode etc.

getInstance

public static javax.swing.table.TableModel getInstance(JUPanelBinding formBinding,
                                                       javax.swing.JTable control,
                                                       java.lang.String voInstanceName,
                                                       java.lang.String voIterName,
                                                       java.lang.String voIterBindingName,
                                                       java.lang.String[] attrNames)
Deprecated. since 9.0.2

stopEditing

public void stopEditing()
Description copied from interface: JUPanelStopEditingListener
Notification method to this listener to stop editing.
Specified by:
stopEditing in interface JUPanelStopEditingListener
Overrides:
stopEditing in class JUCtrlValueBinding

getModel

public JUTableBinding.JUTableModel getModel()

getModelImpl

protected JUTableBinding.JUTableModel getModelImpl(javax.swing.JTable control)
Returns an instance of JUTableModel that this binding works with and is applied as the JTableModel to the given JTable control.

Override this method to return a subclass of JUTableModel to perform customizations on the table model like:


isControlQueriable

protected boolean isControlQueriable()
Returns true by default to imply that this binding supports Find mode. Subclasses can override this method to return false if this binding should not display ViewCriteria rows in Find mode.
Overrides:
isControlQueriable in class JUControlBinding

addControlToPanel

public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
*** For internal framework use only ***
Specified by:
addControlToPanel in class JUControlBinding

getLayoutObject

public java.lang.Object getLayoutObject()
*** For internal framework use only ***

Returns the scrollpane object in which the JTable control is displayed. If JTable is not displayed in a scrollpane, then this method returns the JTable control instance.

Overrides:
getLayoutObject in class JUControlBinding

setLayoutObject

public void setLayoutObject(javax.swing.JScrollPane scrollPane)
*** For internal framework use only ***

updateValuesFromRows

public void updateValuesFromRows(Row[] rows,
                                 boolean clear)
Updates the JTable's display with the given set of rows after optionally clearing out the current rows (if clear is true).
Overrides:
updateValuesFromRows in class JUCtrlRangeBinding

updateRangeScrolled

public void updateRangeScrolled(ScrollEvent event)
Adjusts the scrollbar of the associated JTable and also refreshes the display with the current set of rows in range in the associated RowIterator. This method does not change the currency of the iterator.
Overrides:
updateRangeScrolled in class JUCtrlRangeBinding
See Also:
ScrollEvent

updateRowInserted

public void updateRowInserted(InsertEvent event)
When a new row is inserted into the associated Iterator, this method gets invoked by the framework. This binding stops the current cell editing (if there is a current cell being edited) and then refreshes the JTable's display to accommodate the new row.
Overrides:
updateRowInserted in class JUCtrlValueBinding

updateRowDeleted

public void updateRowDeleted(DeleteEvent event)
When a row is deleted in the associated iterator, this method gets invoked by the framework, so that this binding can update the displayed rows in the JTable after stopping the edit function on the current cell (if a cell was being edited).
Overrides:
updateRowDeleted in class JUCtrlValueBinding

updateNavigated

public void updateNavigated(NavigationEvent event)
Adjusts the display to move the current row selection to the new current row. This method removes/cancels the current cell being edited (if any) before moving the row selection to the new current row.
Overrides:
updateNavigated in class JUCtrlRangeBinding

hierarchyChanged

public void hierarchyChanged(java.awt.event.HierarchyEvent e)
Specified by:
hierarchyChanged in interface java.awt.event.HierarchyListener

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int columnIndex)
Specified by:
getColumnName in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Description copied from class: JUCtrlRangeBinding
Returns the value as stored in the control at a given row and column index. This value is used by the binding to update attribute values in BC4J rows.
Specified by:
getValueAt in interface javax.swing.table.TableModel
Specified by:
getValueAt in class JUCtrlRangeBinding

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Description copied from class: JUCtrlRangeBinding
Sets the given value from a BC4J row into the control at the given row/column. This method is used by the framework to pass attribute values from Row objects into a control with which this binding works.
Specified by:
setValueAt in interface javax.swing.table.TableModel
Specified by:
setValueAt in class JUCtrlRangeBinding

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel

Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


 

Copyright © 1997, 2003, Oracle. All rights reserved.