Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo.uicli.jui
Class JUTableBinding

`java.lang.Object
java.util.AbstractMap
oracle.jbo.common.JboAbstractMap
oracle.adf.model.binding.DCControlBinding
oracle.jbo.uicli.binding.JUControlBinding
oracle.jbo.uicli.binding.JUCtrlValueBinding
oracle.jbo.uicli.binding.JUCtrlRangeBinding
oracle.jbo.uicli.jui.JUTableBinding`

All Implemented Interfaces:
  ControlBinding, oracle.adf.model.ControlBinding, java.util.EventListener, java.awt.event.HierarchyListener, JUCtrlInputValueHandler, JUCtrlValueHandler, JUPanelStopEditingListener, java.util.Map, oracle.adf.model.RangeBinding, RangeBinding, StructureDef, 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:

- Perform application-specific sorting of rows displayed in a JTable.
- Dynamically display/hide certain columns based on user preferences or application logic.

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

- Managing Row and iterator events from BC4J layer and calls appropriate JTableModel methods to update JTable display.
- Manages edits using the current Cell Editor by cancelling/accepting edits from the current cell editor.

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.

Nested classes inherited from class java.util.Map
`java.util.Map.Entry`

Field Summary
`static int` | `CS_FULL`
`static int` | `CS_NONE`
`static int` | `CS_RANGE`
`boolean` | `mSortAscending`
`int` | `mSortColumn`
`static int` | `TBL_SCROLL_ACTIVE`
`static int` | `TBL_SCROLL_PASSIVE`

Fields inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
`ATTR_ATTRIBUTE, ATTR_ATTRIBUTE_DEF, ATTR_ATTRIBUTE_DEFS, ATTR_ATTRIBUTE_VALUE, ATTR_ATTRIBUTE_VALUES, ATTR_ATTRIBUTES, ATTR_DISPLAY_HEIGHT, ATTR_DISPLAY_HINT, ATTR_DISPLAY_WIDTH, ATTR_FORMAT, ATTR_FORMATS, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_PATH, ATTR_TOOLTIP, ATTR_UPDATEABLE, ATTR_VIEWABLE, mHasInputVal, mInputVal, SEP_LIST_DISPLAY`

Fields inherited from class oracle.adf.model.binding.DCControlBinding
`ATTR_CURRENTROW, ATTR_DEF, ATTR_ERROR, ATTR_ERRORS, ATTR_FULLNAME, ATTR_ITER, ATTR_NAME, mAttributeListener, mInternalGet_KeyResolved, ROW_KEY_STR`

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)`
`java.lang.Object` | `getControlModel(java.lang.Object control)` Gets the associated View's model object.
`protected int` | `getDefaultVisibleRowCount()` Subclasses may override this to provide a default visible row count for a table binding where the table is not in a scrollpane or the table has not been appropriately sized yet and table needs to know the visible row count.
`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()`
`int` | `getScrolMode()`
`java.lang.Object` | `getValueAt(int rowIndex, int columnIndex)`
`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` | `release(int flags)` Releases this ControlBinding.
`void` | `removeTableModelListener(javax.swing.event.TableModelListener l)`
`int` | `rowIndexToRangeIndex(int rowIndex)`
`void` | `setColumnProperties(java.util.HashMap columnProperties)`
`void` | `setControl(java.lang.Object ctrl)` Bind this binding to a control.
`void` | `setLayoutObject(javax.swing.JScrollPane scrollPane)` *** For internal framework use only ***
`void` | `setScrollMode(int x)`
`void` | `setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)`
`void` | `stopEditing()` Notification method to this listener to stop editing.
`protected void` | `updateColumnModel(javax.swing.JTable control)`
`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
`createValueBindingRef, getCurrentRowIndex, getEstimatedRowCount, getInputErrorsForRowKey, getInputValueInRow, getRangeSet, getRangeSize, getRangeStart, internalGet, needsEstimatedRowCount, refreshControl, setCurrentRowAtIndex, setInputValueInRow, setRangeStart, updateValuesFromRow`

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
`compareAndSetAttribute, displayInShortForm, ensureVariableManager, findAttributeDef, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDef, getAttributeDefs, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributeNames, getAttributes, getAttributes, getAttributeUIHelper, getAttributeValidators, getAttributeValidators, getAttributeValue, getAttributeValue, getAttributeValueFromRow, getAttributeValues, getAttributeValues, getControlType, getDisplayHeight, getDisplayHint, getDisplayWidth, getError, getErrors, getFormat, getFormats, getHint, getHint, getInputValue, getInputValue, getInputValueHandler, getLabel, getLabel, getLabels, getLabelSet, getLocaleContext, getMergedAttributeValues, getNullValueString, getPath, getTooltip, getTooltip, hasFormatInformation, hasVariables, initResources, internalGetRow, internalHasPermission, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isAttributeUpdateable, isMandatory, isNewInputValue, isUpdateable, lookupAttributeDef, processInputException, processNewInputValue, put, resetInputState, resolvePath, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeValue, setError, setInputValue, setInputValue, setInputValueHandler, setNullValueString, validateInputValue`

Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
`getCurrentRow, getFormBinding, getIteratorBinding, reportException, setFormBinding`

Methods inherited from class oracle.adf.model.binding.DCControlBinding
`addToDCExceptions, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getBindingContainer, getControl, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, hashCode, internalHasPermission, internalSetName, removeFromDCExceptions, reportException, resetAttributeExceptionInRow, setBindingContainer, setListener, setListener, setName, toString`

Methods inherited from class oracle.jbo.common.JboAbstractMap
`entrySet, equals, internalPut`

Methods inherited from class java.util.AbstractMap
`clear, clone, containsKey, containsValue, isEmpty, keySet, putAll, remove, size, values`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface oracle.adf.model.RangeBinding
`getLabelSet`

Methods inherited from interface oracle.adf.model.ControlBinding
`setListener`

Methods inherited from interface oracle.binding.ControlBinding
`getName, getPath, resolvePath, setListener`

Methods inherited from interface oracle.jbo.StructureDef
`getDefFullName, getDefName, getFullName, getName`

Field Detail

### TBL_SCROLL_ACTIVE

    public static final int TBL_SCROLL_ACTIVE

  See Also:
    Constant Field Values

### TBL_SCROLL_PASSIVE

    public static final int TBL_SCROLL_PASSIVE

  See Also:
    Constant Field Values

### CS_FULL

    public static final int CS_FULL

  See Also:
    Constant Field Values

### CS_NONE

    public static final int CS_NONE

  See Also:
    Constant Field Values

### CS_RANGE

    public static final int CS_RANGE

  See Also:
    Constant Field Values

### mSortAscending

    public boolean mSortAscending

### mSortColumn

    public int mSortColumn

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:

  - Calculating how many rows to display in a JTable (based on JTable size).
  - Reacting to the BC4J row and iterator events to update display and currency.

Method Detail

### getControlModel

    public java.lang.Object getControlModel(java.lang.Object control)

  Gets the associated View's model object.

### 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

### setControl

    public void setControl(java.lang.Object ctrl)

  Bind this binding to a control.

### setColumnProperties

    public void setColumnProperties(java.util.HashMap columnProperties)

### updateColumnModel

    protected void updateColumnModel(javax.swing.JTable control)

### 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:

  - Implementing client-side sorting of rows in the grid.
  - Relay out the column order based on some user-preference.
  - Hide some columns from the display.
  - Provide custom renderers or change default renderers.

### 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.

### addControlToPanel

    public void addControlToPanel(java.lang.Object panel,
                                  java.lang.Object layoutObject,
                                  java.lang.Object layoutCons)

  *** For internal framework use only ***
  Overrides:
    `addControlToPanel` in class `JUCtrlRangeBinding`

### 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.

### setLayoutObject

    public void setLayoutObject(javax.swing.JScrollPane scrollPane)

  *** For internal framework use only ***

### getDefaultVisibleRowCount

    protected int getDefaultVisibleRowCount()

  Subclasses may override this to provide a default visible row count for a table binding where the table is not in a scrollpane or the table has not been appropriately sized yet and table needs to know the visible row count.

### 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`

### 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)

  Specified by:
    `getValueAt` in interface `javax.swing.table.TableModel`
  Overrides:
    `getValueAt` in class `JUCtrlRangeBinding`

### setValueAt

    public void setValueAt(java.lang.Object aValue,
                           int rowIndex,
                           int columnIndex)

  Specified by:
    `setValueAt` in interface `javax.swing.table.TableModel`
  Overrides:
    `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`

### release

    public void release(int flags)

  Description copied from interface: `ControlBinding`
  Releases this ControlBinding. This method is called when the view component has finished using this ControlBinding.
  Specified by:
    `release` in interface `oracle.adf.model.ControlBinding`
  Overrides:
    `release` in class `JUCtrlRangeBinding`

### rowIndexToRangeIndex

    public int rowIndexToRangeIndex(int rowIndex)

### getScrolMode

    public int getScrolMode()

### setScrollMode

    public void setScrollMode(int x)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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