Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02


oracle.jbo.uicli.jui
Class JUListSingleSelBinding

java.lang.Object
  extended byjava.util.AbstractMap
      extended byoracle.jbo.common.JboAbstractMap
          extended byoracle.adf.model.binding.DCControlBinding
              extended byoracle.jbo.uicli.binding.JUControlBinding
                  extended byoracle.jbo.uicli.binding.JUCtrlValueBinding
                      extended byoracle.jbo.uicli.binding.JUCtrlAttrsBinding
                          extended byoracle.jbo.uicli.binding.JUCtrlListBinding
                              extended byoracle.jbo.uicli.jui.JUListSingleSelBinding

All Implemented Interfaces:
java.util.EventListener, JUCtrlInputValueHandler, javax.swing.ListModel, javax.swing.event.ListSelectionListener, java.util.Map, RowNavigationListener, RowSetListener, RowSetManagementListener, StructureDef

public class JUListSingleSelBinding
extends JUCtrlListBinding
implements javax.swing.event.ListSelectionListener, javax.swing.ListModel

Implements binding a Swing JList (in single selection mode) to a BC4J Attribute, ViewObject, or as an LOV.

A list can be bound in the following ways:

This class also implements ListSelectionListener interface and listens to ListSelectionEvent from the bound list. On selection event, it either performs an update of the target ViewObject attributes or iterates a target ViewObject based on the list operation mode set in the constructor.


Nested Class Summary

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

Field Summary

Fields inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding
DH_CONTROL_TYPE, DH_DISPLAY_HEIGHT, DH_DISPLAY_HINT, DH_DISPLAY_WIDTH, DH_FORMAT, DH_LABEL, DH_TOOLTIP, LIST_OPER_NAVIGATE, LIST_OPER_SET_ATTRIBUTE, LISTITEM_DisplayValues, LISTITEM_Index, LISTITEM_Prompt, LISTITEM_Selected, LISTITEM_SelectedIndex, mFirstDisplayAttr, mListAttrNames, mListDisplayAttrNames, mListIterBinding, mSingleAttrList, mStaticList, mValueList

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_HINT, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_TOOLTIP, ATTR_UPDATEABLE, 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, mInternalGet_KeyResolved, ROW_KEY_STR

Constructor Summary
JUListSingleSelBinding(javax.swing.JList list, JUIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode, boolean shouldScroll)
Binds a ListBox to a RowSet associated with the given iterator binding and, based on listOperMode setting, either iterates the currency on the target iterator or updates the attribute value for the given attribute (in attrNames) in the current row in the target RowSet.
JUListSingleSelBinding(javax.swing.JList list, JUIteratorBinding iterBinding, java.lang.String[] attrNames, JUIteratorBinding listRSI, java.lang.String[] listAttrNames, java.lang.String[] listDisplayedAttrNames, boolean shouldScroll)
Binds separate ViewObject/RowSets for display and updates to the same listbox.
JUListSingleSelBinding(javax.swing.JList list, JUIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList, boolean shouldScroll)
Binds a JList to an attribute in the associated RowSet.

Method Summary
void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
*** For internal framework use only ***
void addListDataListener(javax.swing.event.ListDataListener l)
static javax.swing.ListModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] values)
Use this method to bind a list control to a ViewObject/RowSet, identified by voInstanceName, when a static list of values are displayed in the listbox, and the listbox is used to display/update the same attribute in the same viewobject.
static javax.swing.ListModel createLovBinding(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames, java.lang.String listVOInstanceName)
static javax.swing.ListModel createLovBinding(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] voAttrNames, java.lang.String lovVOInstanceName, java.lang.String[] lovVOAttrNames, java.lang.String[] lovVODisplayedAttrNames, javax.swing.ListCellRenderer cellRenderer)
Use this binding when two ViewObjects are to be used in this list control: one for displaying the list of values and the other ViewObject whose rows are updated.
static javax.swing.ListModel createNavigationBinding(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] voAttrNames, javax.swing.ListCellRenderer cellRenderer)
Use this binding when the given list control is used as a navigation control to iterate through a range of rows in a RowSet.
java.lang.Object getControlModel(java.lang.Object control)
Gets the associated View's model object.
java.lang.Object getElementAt(int index)
static javax.swing.ListModel getInstance(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames, java.lang.String listVOInstanceName)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead
static javax.swing.ListModel getInstance(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] voAttrNames, java.lang.String lovVOInstanceName, java.lang.String[] lovVOAttrNames, java.lang.String[] lovVODisplayedAttrNames, javax.swing.ListCellRenderer cellRenderer)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead
static javax.swing.ListModel getInstance(JUFormBinding formBinding, javax.swing.JList control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] values)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead
java.lang.Object getLayoutObject()
*** For internal framework use only ***
protected javax.swing.ListModel getModelImpl(javax.swing.JList control)
Sets the model reference in this binding class by using the current model in the listbox.
int getSize()
protected boolean isControlQueriable()
Returns true, so that JTextComponents can participate in a query in the Find Mode of the containing panel.
protected boolean isViewInitialized()
void refreshControl()
*** For internal framework use only ***
void removeListDataListener(javax.swing.event.ListDataListener l)
void setDataValueAt(java.lang.Object value, int attrIndex)
This method is overridden to be a noop.
void setLayoutObject(javax.swing.JScrollPane scrollPane)
*** For internal framework use only ***
void setSelectedIndex(int listIndex)
Sets the item at the given index as current selection in the listbox.
protected void setupListItems(boolean clean, boolean keepSelectedIndex)
This method is used by the framwork to setup the list of values that will be displayed in this listbox.
void setValueAt(java.lang.Object value, int attrIndex)
Finds the item in the list that matches the given value and sets it as the current item.
void valueChanged(javax.swing.event.ListSelectionEvent e)
Based on listOperMode, this binding either navigates the target rowset to the selected row or sets the attribute/attributes based on the settings in the constructor.

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding
convertValueList, findListIndex, findMatchingListValue, findValue, getDisplayAttributeDefs, getDisplayData, getDisplayHints, getDisplayListIterator, getInputValue, getListDisplayAttrNames, getListIterBinding, getListOperMode, getSelectedIndex, getSelectedIndexValue, getSelectedValue, getValueAt, getValueFromList, getValueList, internalGet, isSingleAttrList, iteratorClosed, iteratorReset, matchTargetWithLov, navigated, processNewInputValue, put, rangeRefreshed, rangeScrolled, release, rowDeleted, rowInserted, rowUpdated, setAttributeFromValueList, setInputValue, setListOperMode, setListValueAsSelected, setSelectedIndexValue, setSingleAttrList, setStaticList, setTargetAttrsFromLovRow, setValueList, toString, updateTargetFromSelectedValue, updateValuesFromRow

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
createAttributeBinding, setControlEnabled, updateNavigated, updateRangeScrolled, updateValuesFromRows

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
compareAndSetAttribute, displayInShortForm, 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, getHint, getHint, getLabel, getLabel, getLabels, getLabelSet, getLocaleContext, getMergedAttributeValues, getPath, getTooltip, getTooltip, hasFormatInformation, internalGetRow, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isMandatory, isNewInputValue, isUpdateable, lookupAttributeDef, processInputException, resetInputState, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeValue, setError, setInputValue, setInputValueHandler, stopEditing, updateRowDeleted, updateRowInserted

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

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

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

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.jbo.StructureDef
getDefFullName, getDefName, getFullName, getName

Constructor Detail

JUListSingleSelBinding

public JUListSingleSelBinding(javax.swing.JList list,
                              JUIteratorBinding iterBinding,
                              java.lang.String[] attrNames,
                              int listOperMode,
                              boolean shouldScroll)
Binds a ListBox to a RowSet associated with the given iterator binding and, based on listOperMode setting, either iterates the currency on the target iterator or updates the attribute value for the given attribute (in attrNames) in the current row in the target RowSet. Note that the list will display and (optionally) update the same attribute from a RowSet.
Parameters:
list - JList control instance with which to associate this binding.
iterBinding - Provides the RowSet from which this binding accesses data to display in the list and optionally provides the current row in which attribute(s) is to be updated.
attrNames - An ordered array of attribute names to display and optionally update in a ViewObject.
listOperMode - Can be one of two values:
shouldScroll - When true, indicates scroll the selected item into view if it is not being displayed in the current viewport.

JUListSingleSelBinding

public JUListSingleSelBinding(javax.swing.JList list,
                              JUIteratorBinding iterBinding,
                              java.lang.String[] attrNames,
                              java.lang.Object[] valueList,
                              boolean shouldScroll)
Binds a JList to an attribute in the associated RowSet. The values displayed in ListBox are provided by the valueList objects.
Parameters:
list - JList control instance with which to associate this binding.
iterBinding - Provides the RowSet that is used to update current selection from the listbox into the current row in the rowset.
attrNames - Provides the name of an attribute (only one attribute is updateable in this mode).
valueList - A static list of values that are displayed in the listbox as options from which to select.
shouldScroll - When true, indicates scroll the selected item into view if it is not being displayed in the current viewport.

JUListSingleSelBinding

public JUListSingleSelBinding(javax.swing.JList list,
                              JUIteratorBinding iterBinding,
                              java.lang.String[] attrNames,
                              JUIteratorBinding listRSI,
                              java.lang.String[] listAttrNames,
                              java.lang.String[] listDisplayedAttrNames,
                              boolean shouldScroll)
Binds separate ViewObject/RowSets for display and updates to the same listbox. Use this binding constructor to provide a separate iterator binding for update and a separate iterator binding which provides rows for display in the listbox. Optionally, the attributes displayed can be different from the attributes that should be used to update a corresponding set of attributes in the target/updateable ViewObject.
Parameters:
list - JList control instance to associate this binding with.
iterBinding - Provides the RowSet in which the current row is updated based on selection in the listbox.
attrNames - An ordered array of attribute names to update in a ViewObject. This list should have the same number of attributes as in listAttrNames which provides the corresponding attribute names from the display ViewObject/RowSet.
listAttrNames - An ordered list of attribute names which are used to get the values to update into the attributes from the attrNames list in the target ViewObject. If this list is null, the attribute names for display are set to the same as attrNames.
shouldScroll - When true, indicates scroll the selected item into view if it is not being displayed in the current viewport.

Method Detail

isViewInitialized

protected boolean isViewInitialized()
Overrides:
isViewInitialized in class JUCtrlListBinding

setupListItems

protected void setupListItems(boolean clean,
                              boolean keepSelectedIndex)
This method is used by the framwork to setup the list of values that will be displayed in this listbox.
Overrides:
setupListItems in class JUCtrlListBinding
Parameters:
clean - Controls whether to clean the existing entries in the listbox.
keepSelectedIndex - Indicates whether to maintain current index as the selected index after the display data is updated. If this value is true, the current index is maintained. However, if the current index is more than the number of items in the listbox, the selection is reset to the first item.

getModelImpl

protected javax.swing.ListModel getModelImpl(javax.swing.JList control)
Sets the model reference in this binding class by using the current model in the listbox. Returns the same model reference. If there is no model in the lsitbox, creates a DefaultListModel and returns that.

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 JUCtrlListBinding

getLayoutObject

public java.lang.Object getLayoutObject()
*** For internal framework use only ***
Overrides:
getLayoutObject in class DCControlBinding

setLayoutObject

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

isControlQueriable

protected boolean isControlQueriable()
Returns true, so that JTextComponents can participate in a query in the Find Mode of the containing panel. When the containing panel Binding object is set to Find mode, it queries all control-bindings in it and disables those controls whose bindings return false for this method during the Find mode. The return value from this method indicates whether to consult an attribute definition for queriability.

An application could create a subclass of this binding object and return false from this method to prevent the associated control from participating in find mode. Additionally, a BC4J attribute itself can control whether that attribute can participate in Query or not. That property takes precedence over this method's return, if this method returns true. In other words, if this binding is bound to a CLOB attribute type and the attribute definition for that attribute indicates that it is not queriable, then the default behavior of JUPanelBinding in Find mode will be to disable this binding's control, even though this method returns true.

Overrides:
isControlQueriable in class JUCtrlListBinding

setValueAt

public void setValueAt(java.lang.Object value,
                       int attrIndex)
Finds the item in the list that matches the given value and sets it as the current item.
Overrides:
setValueAt in class JUCtrlListBinding
Parameters:
value - This value is used in findMatchingListValue method to find out the item in the list that represents the given value. If the value is not found, no item is selected in the list.
attrIndex - This argument is ignored by this method.

setDataValueAt

public void setDataValueAt(java.lang.Object value,
                           int attrIndex)
This method is overridden to be a noop.
Overrides:
setDataValueAt in class JUCtrlListBinding

setSelectedIndex

public void setSelectedIndex(int listIndex)
Sets the item at the given index as current selection in the listbox.
Overrides:
setSelectedIndex in class JUCtrlListBinding

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Based on listOperMode, this binding either navigates the target rowset to the selected row or sets the attribute/attributes based on the settings in the constructor.
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Specified by:
addListDataListener in interface javax.swing.ListModel

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Specified by:
removeListDataListener in interface javax.swing.ListModel

refreshControl

public void refreshControl()
Description copied from class: JUCtrlAttrsBinding
*** For internal framework use only ***

Updates the values in a control that is bound using an Iterator already in use. (a valid row iterator) If you do not call this method, your control won't update unless you refresh the Iterator.

Overrides:
refreshControl in class JUCtrlAttrsBinding

getControlModel

public java.lang.Object getControlModel(java.lang.Object control)
Gets the associated View's model object.
Overrides:
getControlModel in class DCControlBinding

createLovBinding

public static javax.swing.ListModel createLovBinding(JUFormBinding formBinding,
                                                     javax.swing.JList control,
                                                     java.lang.String voInstanceName,
                                                     java.lang.String voIterName,
                                                     java.lang.String voIterBindingName,
                                                     java.lang.String[] attrNames,
                                                     java.lang.String listVOInstanceName)

getInstance

public static javax.swing.ListModel getInstance(JUFormBinding formBinding,
                                                javax.swing.JList control,
                                                java.lang.String voInstanceName,
                                                java.lang.String voIterName,
                                                java.lang.String voIterBindingName,
                                                java.lang.String[] attrNames,
                                                java.lang.String listVOInstanceName)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead

createEnumerationBinding

public static javax.swing.ListModel createEnumerationBinding(JUFormBinding formBinding,
                                                             javax.swing.JList control,
                                                             java.lang.String voInstanceName,
                                                             java.lang.String voIterName,
                                                             java.lang.String voIterBindingName,
                                                             java.lang.String attrName,
                                                             java.lang.Object[] values)
Use this method to bind a list control to a ViewObject/RowSet, identified by voInstanceName, when a static list of values are displayed in the listbox, and the listbox is used to display/update the same attribute in the same viewobject.

getInstance

public static javax.swing.ListModel getInstance(JUFormBinding formBinding,
                                                javax.swing.JList control,
                                                java.lang.String voInstanceName,
                                                java.lang.String voIterName,
                                                java.lang.String voIterBindingName,
                                                java.lang.String attrName,
                                                java.lang.Object[] values)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead

createLovBinding

public static javax.swing.ListModel createLovBinding(JUFormBinding formBinding,
                                                     javax.swing.JList control,
                                                     java.lang.String voInstanceName,
                                                     java.lang.String voIterName,
                                                     java.lang.String voIterBindingName,
                                                     java.lang.String[] voAttrNames,
                                                     java.lang.String lovVOInstanceName,
                                                     java.lang.String[] lovVOAttrNames,
                                                     java.lang.String[] lovVODisplayedAttrNames,
                                                     javax.swing.ListCellRenderer cellRenderer)
Use this binding when two ViewObjects are to be used in this list control: one for displaying the list of values and the other ViewObject whose rows are updated. Optionally, a UI can provide a cell renderer for the list and an editor which can be used to implement ComboBox customization. By default, if this binding method creates an instance of JUMultiAttrListCellRenderer and JUMultiAttrListCellEditor to display and edit LOVs.

getInstance

public static javax.swing.ListModel getInstance(JUFormBinding formBinding,
                                                javax.swing.JList control,
                                                java.lang.String voInstanceName,
                                                java.lang.String voIterName,
                                                java.lang.String voIterBindingName,
                                                java.lang.String[] voAttrNames,
                                                java.lang.String lovVOInstanceName,
                                                java.lang.String[] lovVOAttrNames,
                                                java.lang.String[] lovVODisplayedAttrNames,
                                                javax.swing.ListCellRenderer cellRenderer)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead

createNavigationBinding

public static javax.swing.ListModel createNavigationBinding(JUFormBinding formBinding,
                                                            javax.swing.JList control,
                                                            java.lang.String voInstanceName,
                                                            java.lang.String voIterName,
                                                            java.lang.String voIterBindingName,
                                                            java.lang.String[] voAttrNames,
                                                            javax.swing.ListCellRenderer cellRenderer)
Use this binding when the given list control is used as a navigation control to iterate through a range of rows in a RowSet. Optionally, a UI can provide a cell renderer for the list and an editor which can be used to implement ComboBox customization. By default, this binding method creates an instance of JUMultiAttrListCellRenderer and JUMultiAttrListCellEditor to display and edit LOVs.

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02


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