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


oracle.jbo.uicli.binding
Class JUCtrlListBinding

java.lang.Object
  |
  +--oracle.jbo.uicli.binding.JUControlBinding
        |
        +--oracle.jbo.uicli.binding.JUCtrlValueBinding
              |
              +--oracle.jbo.uicli.binding.JUCtrlAttrsBinding
                    |
                    +--oracle.jbo.uicli.binding.JUCtrlListBinding
All Implemented Interfaces:
AttributeList, java.util.EventListener, RowNavigationListener, RowSetListener
Direct Known Subclasses:
JUButtonGroupBinding, JUComboBoxBinding, JUCtrlBoolBinding, JUListSingleSelBinding, JULovButtonBinding, JUSpinnerBinding

public abstract class JUCtrlListBinding
extends JUCtrlAttrsBinding
implements RowSetListener

A JUCtrlAttrsBinding class responsible displaying a list of values from a static list or a list calculated at runtime using another BC4J ViewObject/RowIterator. This binding operates in two ways:

The operating mode is to be setup in the constructor of this binding.

This binding works in two updateable modes:

This binding can also be used to iterator through a RowIterator object and display single or multiple attributes from the rows.


Field Summary
static int LIST_OPER_NAVIGATE
          Indicates that list binding will be used to navigate Rows in a RowIterator.
static int LIST_OPER_SET_ATTRIBUTE
          Indicates this list binding will be used to update attributes in a target ViewObject.
protected  AttributeDef mFirstDisplayAttr
           
protected  java.lang.String[] mListAttrNames
          Ordered list of attribute names that this control binding should use to update the target ViewObject's attributes.
protected  java.lang.String[] mListDisplayAttrNames
          Ordered list of attributes that this control binding should use to display the Rows from the LOV ViewObject.
protected  JUIteratorBinding mListIterBinding
          Iterator Binding object that this binding uses to get the LOV data.
protected  boolean mSingleAttrList
           
protected  boolean mStaticList
          Controls whether the list of values should be fetched once or should this list update itself when the ViewObject for the LOV changes.
protected  java.lang.Object[] mValueList
          List of values displayed in the bound control.

 

Constructor Summary
  JUCtrlListBinding(java.lang.Object control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode)
          **For Testing purposes only*** Uses the same Iterator Binding to update as well as display values.
protected JUCtrlListBinding(java.lang.Object control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, JUIteratorBinding listIterBinding, java.lang.String[] listAttrNames, java.lang.String[] listDisplayAttrNames)
          Uses the listIterBinding object to get the iterator and attribute names from listDisplayAttrNames to display attributes from the BC4J Rows in the iterator.
  JUCtrlListBinding(java.lang.Object control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList)
          Uses the given static list of value objects to display data in the control.

 

Method Summary
 void convertValueList()
          *** For internal framework use only ***
 int findListIndex(java.lang.Object val)
           
 java.lang.Object findMatchingListValue(java.lang.Object val)
           
 java.lang.Object findValue(java.lang.Object val)
           
static java.lang.Object[] getAttrValuesFromRSI(JUIteratorBinding iterBinding, RowSetIterator listRSI, java.lang.String[] listAttrNames, RowSetListener listener)
           
 int getListOperMode()
          Returns whether this list binding is used for Row Navigation or updating attributes on a target ViewObject (default).
 int getSelectedIndex()
           
 java.lang.Object getSelectedValue()
           
 java.lang.Object getValueAt(int attrIndex)
          Gets the value from the control for the attribute at the given index.
 java.lang.Object getValueFromList(int listIndex)
           
 java.lang.Object[] getValueList()
           
 boolean isSingleAttrList()
          *** For internal framework use only ***
protected  boolean matchTargetWithLov(Row targetRow, Row lovRow)
          *** For internal framework use only ***
 void navigated(NavigationEvent event)
          *** For internal framework use only ***
 void rangeRefreshed(RangeRefreshEvent event)
          *** For internal framework use only ***
 void rangeScrolled(ScrollEvent event)
          *** For internal framework use only ***
 void rowDeleted(DeleteEvent event)
          *** For internal framework use only ***
 void rowInserted(InsertEvent event)
          *** For internal framework use only ***
 void rowUpdated(UpdateEvent event)
          *** For internal framework use only ***
 void setAttributeFromValueList(int listIndex)
           
 void setListOperMode(int listOperMode)
          *** For internal framework use only ***
 void setSelectedIndex(int indx)
           
protected  void setSingleAttrList(boolean flag)
          *** For internal framework use only ***
protected  void setTargetAttrsFromLovRow(Row targetRow, Row lovRow)
          *** For internal framework use only ***
protected  void setupListItems(boolean clean, boolean keepSelectedIndex)
          If this list is displaying a single attribute and updates a single attribute, then this method fetches the attribute value from all the rows in the given LOV list iterator and sets that as the list of values to display in the bound control.
 void setValueList(java.lang.Object[] valueList)
          *** For internal framework use only ***
protected  void updateTargetFromSelectedValue(java.lang.Object val)
           
 void updateValuesFromRow(Row row)
          Updates the control-binding and hence the control with attribute values from the attributes of this Row.

 

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
refreshControl, setDataValueAt, setValueAt, updateNavigated, updateRangeScrolled, updateValuesFromRows

 

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, stopEditing, updateRowDeleted, updateRowInserted

 

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

 

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

 

Field Detail

LIST_OPER_SET_ATTRIBUTE

public static int LIST_OPER_SET_ATTRIBUTE
Indicates this list binding will be used to update attributes in a target ViewObject. This is the default mode

LIST_OPER_NAVIGATE

public static int LIST_OPER_NAVIGATE
Indicates that list binding will be used to navigate Rows in a RowIterator.

mSingleAttrList

protected boolean mSingleAttrList

mValueList

protected java.lang.Object[] mValueList
List of values displayed in the bound control. This could be a list of single attribute values or a list of BC4J Rows.

mListAttrNames

protected java.lang.String[] mListAttrNames
Ordered list of attribute names that this control binding should use to update the target ViewObject's attributes.

mListDisplayAttrNames

protected java.lang.String[] mListDisplayAttrNames
Ordered list of attributes that this control binding should use to display the Rows from the LOV ViewObject.

mListIterBinding

protected JUIteratorBinding mListIterBinding
Iterator Binding object that this binding uses to get the LOV data.

mStaticList

protected boolean mStaticList
Controls whether the list of values should be fetched once or should this list update itself when the ViewObject for the LOV changes.

mFirstDisplayAttr

protected AttributeDef mFirstDisplayAttr
Constructor Detail

JUCtrlListBinding

public JUCtrlListBinding(java.lang.Object control,
JUIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         int listOperMode)
**For Testing purposes only*** Uses the same Iterator Binding to update as well as display values.

JUCtrlListBinding

public JUCtrlListBinding(java.lang.Object control,
JUIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         java.lang.Object[] valueList)
Uses the given static list of value objects to display data in the control.

JUCtrlListBinding

protected JUCtrlListBinding(java.lang.Object control,
JUIteratorBinding iterBinding,
                            java.lang.String[] attrNames,
JUIteratorBinding listIterBinding,
                            java.lang.String[] listAttrNames,
                            java.lang.String[] listDisplayAttrNames)
Uses the listIterBinding object to get the iterator and attribute names from listDisplayAttrNames to display attributes from the BC4J Rows in the iterator. Also maps values from listAttrNames attributes to the set of attributes (attrNames) in the current row of the target iterator referred by iterBinding object
Method Detail

setupListItems

protected void setupListItems(boolean clean,
                              boolean keepSelectedIndex)
If this list is displaying a single attribute and updates a single attribute, then this method fetches the attribute value from all the rows in the given LOV list iterator and sets that as the list of values to display in the bound control.

If this list is displaying multiple attributes and/or is used in navigation mode, then the valueList is set with the list of all rows from the LOV Iterator binding. In this case, this binding also listens to events from the RowSetIterator for row currency changes, new rows, etc.


getListOperMode

public int getListOperMode()
Returns whether this list binding is used for Row Navigation or updating attributes on a target ViewObject (default). The possible values are:

setListOperMode

public void setListOperMode(int listOperMode)
*** For internal framework use only ***

Sets the operating mode for this list binding.


setSingleAttrList

protected void setSingleAttrList(boolean flag)
*** For internal framework use only ***

isSingleAttrList

public boolean isSingleAttrList()
*** For internal framework use only ***

setValueList

public void setValueList(java.lang.Object[] valueList)
*** For internal framework use only ***

convertValueList

public void convertValueList()
*** For internal framework use only ***

getSelectedIndex

public int getSelectedIndex()

setSelectedIndex

public void setSelectedIndex(int indx)

getValueAt

public java.lang.Object getValueAt(int attrIndex)
Description copied from class: JUCtrlAttrsBinding
Gets the value from the control for the attribute at the given index. (The index is calculated from the list of attributes this control binding is bound to as passed in the constructor). Framework uses this method to get the attribute value from the control and pass it on to the Row object on the BC4J side.
Specified by:
getValueAt in class JUCtrlAttrsBinding

getValueList

public java.lang.Object[] getValueList()

getSelectedValue

public java.lang.Object getSelectedValue()

matchTargetWithLov

protected boolean matchTargetWithLov(Row targetRow,
Row lovRow)
*** For internal framework use only ***

findMatchingListValue

public java.lang.Object findMatchingListValue(java.lang.Object val)

findListIndex

public int findListIndex(java.lang.Object val)

findValue

public java.lang.Object findValue(java.lang.Object val)

getValueFromList

public java.lang.Object getValueFromList(int listIndex)

updateValuesFromRow

public void updateValuesFromRow(Row row)
Description copied from class: JUCtrlAttrsBinding
Updates the control-binding and hence the control with attribute values from the attributes of this Row. Invokes setValueAt() with the attribute value and attribute index with respect to attributes for which this binding is interested.

This method also enables/disables the Swing control based on the updateability of the first (Default) attribute to which this control is bound.

Overrides:
updateValuesFromRow in class JUCtrlAttrsBinding

setTargetAttrsFromLovRow

protected void setTargetAttrsFromLovRow(Row targetRow,
Row lovRow)
*** For internal framework use only ***

setAttributeFromValueList

public void setAttributeFromValueList(int listIndex)

updateTargetFromSelectedValue

protected void updateTargetFromSelectedValue(java.lang.Object val)

getAttrValuesFromRSI

public static java.lang.Object[] getAttrValuesFromRSI(JUIteratorBinding iterBinding,
RowSetIterator listRSI,
                                                      java.lang.String[] listAttrNames,
RowSetListener listener)

rangeRefreshed

public void rangeRefreshed(RangeRefreshEvent event)
*** For internal framework use only ***
Specified by:
rangeRefreshed in interface RowSetListener
Parameters:
event - a description of the new ranges.

rowInserted

public void rowInserted(InsertEvent event)
*** For internal framework use only ***
Specified by:
rowInserted in interface RowSetListener
Parameters:
event - a description of the new Row object.

rowDeleted

public void rowDeleted(DeleteEvent event)
*** For internal framework use only ***
Specified by:
rowDeleted in interface RowSetListener
Parameters:
event - a description of the deleted Row object.

rowUpdated

public void rowUpdated(UpdateEvent event)
*** For internal framework use only ***
Specified by:
rowUpdated in interface RowSetListener
Parameters:
event - a description of the modified Row object.

navigated

public void navigated(NavigationEvent event)
*** For internal framework use only ***
Specified by:
navigated in interface RowSetListener
Parameters:
event - a description of the new and previous current rows.

rangeScrolled

public void rangeScrolled(ScrollEvent event)
*** For internal framework use only ***
Specified by:
rangeScrolled in interface RowSetListener
Parameters:
event - a description of the new range.

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


 

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