Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

oracle.jbo.uicli.jui
Class JUComboBoxBinding

java.lang.Object
  extended by java.util.AbstractMap
      extended by oracle.jbo.common.JboAbstractMap
          extended by oracle.adf.model.binding.DCControlBinding
              extended by oracle.jbo.uicli.binding.JUControlBinding
                  extended by oracle.jbo.uicli.binding.JUCtrlValueBinding
                      extended by oracle.jbo.uicli.binding.JUCtrlAttrsBinding
                          extended by oracle.jbo.uicli.binding.JUCtrlListBinding
                              extended by oracle.jbo.uicli.jui.JUComboBoxCtrlBinding
                                  extended by oracle.jbo.uicli.jui.JUComboBoxBinding
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.util.Map, javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.MutableComboBoxModel, AttributeBinding, ControlBinding, RowNavigationListener, RowSetListener, RowSetManagementListener, StructureDef, JUCtrlInputValueHandler, JUCtrlValueHandler

public class JUComboBoxBinding
extends JUComboBoxCtrlBinding
implements java.awt.event.ActionListener, javax.swing.MutableComboBoxModel

Implements binding a Swing JComboBox to a BC4J Attribute or ViewObject or as an LOV (list of values).

A combobox can be bound in the following ways:

This class also implements ActionListener interface and listens to ActionEvents from the bound combobox. On an action event, it either performs an update of the target ViewObject attributes, or iterates a target ViewObject as per the list operation mode set in the constructor.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class oracle.jbo.uicli.jui.JUComboBoxCtrlBinding
mCellRenderer, mComboModel, mEditor, mSettingValue
 
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_ADD_NULL_AT_END, LIST_ADD_NULL_AT_START, LIST_ADD_NULL_NOWHERE, LIST_ADD_NULL_UNINIT, LIST_OPER_MULTI_SELECT, LIST_OPER_NAVIGATE, LIST_OPER_SET_ATTRIBUTE, LISTITEM_DisplayValues, LISTITEM_Index, LISTITEM_Prompt, LISTITEM_Selected, LISTITEM_SelectedIndex, LISTITEM_SelectedIndices, LOV_SRC_ATTRNAMES, LOV_SRC_EL_EXPR, LOV_SRC_ROW, LOV_SRC_ROW_DATA, mFirstDisplayAttr, mListAttrNames, mListDisplayAttrNames, mListIterBinding, mNullValueFlag, mSingleAttrList, mStaticList, mValueList, ROW
 
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_AUTOSUBMIT, ATTR_DISPLAY_HEIGHT, ATTR_DISPLAY_HINT, ATTR_DISPLAY_WIDTH, ATTR_FORMAT, ATTR_FORMATS, ATTR_HINTS, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_PATH, ATTR_TOOLTIP, ATTR_UPDATEABLE, ATTR_VIEWABLE, DATACHANGE_EVENT_POLICY, GET_ALLOWS, mAttrs, 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, DC_BINDING_ERROR, mAttributeListener, mInternalGet_KeyResolved, mPermission, mPermissionInfo, ROW_KEY_STR
 
Fields inherited from class oracle.jbo.common.JboAbstractMap
MAP_NULL_VALUE
 
Constructor Summary
protected JUComboBoxBinding(java.lang.Object cb, DCIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.String lbName)
          *** For internal framework use only ***
  JUComboBoxBinding(java.lang.Object cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode)
          Binds a ComboBox 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.
  JUComboBoxBinding(java.lang.Object cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, JUIteratorBinding listIterBinding, java.lang.String[] listAttrNames, java.lang.String[] listDisplayAttrNames)
          Binds separate ViewObject/RowSets for display and update to the same ComboBox.
  JUComboBoxBinding(java.lang.Object cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList)
          Binds a combobox to an attribute in the associated RowSet.
 
Method Summary
 int getDisplayWidth()
          Returns the display width for this attribute.
protected  boolean hasServerBindingChanged()
           
protected  void init(javax.swing.JComboBox cb)
           
protected  void initFromServerBinding()
           
protected  void setupListItems(boolean clean, boolean keepSelectedIndex)
          This method is used by the framwork to setup the list of values (LOV) that will be displayed in this combobox.
 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.jui.JUComboBoxCtrlBinding
actionPerformed, addControlToPanel, addElement, addListDataListener, createEnumerationBinding, createLovBinding, createNavigationBinding, getComboDisplayAttrs, getControlCombo, getControlModel, getDisplayData, getElementAt, getInstance, getInstance, getModelImpl, getNullValueString, getSelectedItem, getSize, getValueAt, insertElementAt, isControlQueriable, isRefreshingList, isViewInitialized, refreshComboList, refreshControl, refreshListItem, release, removeElement, removeElementAt, removeListDataListener, setDataValueAt, setSelectedIndex, setSelectedItem, setValueAt, updateTargetFromSelectedValue, updateValueToCurrentRow
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding
addBindingChangeListener, addNullAndSetValueList, addRowToMRU, addSelectionToMRU, bindRowSetIterator, clearMRU, clearSelectedIndices, convertValueList, createListIterBinding, createRowSetIterator, filterList, findAndUpdateSelectedIndex, findListIndex, findListIndex, findMatchingListValue, findShuttleAvailableRows, findShuttleSelectedRows, findValue, getAttributeDefs, getComboDisplayAttributeCount, getDisplayAttributeDefs, getDisplayCriteriaName, getDisplayHints, getDisplayListIterator, getFilteredRowSetIterator, getFilteredRowSetIteratorWithCaseCheck, getInputValueInRow, getInputValueOnError, getIterBindingDefOptions, getListBindingName, getListDisplayAttrNames, getListIterBinding, getListOperMode, getListRowSetIterator, getMRUSize, getMRUString, getNullValueFlag, getNullValueIndex, getPreferredListIterBinding, getPreferredListMode, getPreferredListRowSetIterator, getSelectedIndex, getSelectedIndexValue, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionAttributeName, getServerBindingName, getTargetRowData, getValueFromList, getValueList, handleFilteredList, hasMRU, hasNullValue, initResources, internalGet, isAutoSubmit, isMandatory, isSingleAttrList, isUpdateable, iteratorClosed, iteratorReset, matchTargetWithLov, moveDown, moveToBottom, moveToTop, moveUp, navigated, processNewInputValue, put, rangeRefreshed, rangeScrolled, removeBindingChangeListener, resetAttributeDefs, resetShuttle, rowDeleted, rowInserted, rowUpdated, setAllowBlindMatchInFilter, setAttributeFromValueList, setDef, setFetchDataOnSetup, setInputValueInRow, setListIterBinding, setListOperMode, setListValueAsSelected, setNullValueProperties, setPreferredListMode, setSelectedIndexValue, setSelectedIndices, setServerBindingName, setStaticList, setTargetAttrsFromLovRow, setValueList, shuttle, toString, usesServerBinding
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
createAttributeBinding, setControlEnabled, updateValuesFromRows
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
addBindingContainerChangeListenerForCtxEvent, addDataChangeListener, clearAttrDefs, clearEventsCache, compareAndSetAttribute, createAndNotifyDCE, createEventProducer, displayInShortForm, ensureVariableManager, fetchAttrDefs, findAttributeDef, generateDCE, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDef, getAttributeDefsForRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributeNames, getAttributes, getAttributes, getAttributeUIHelper, getAttributeValidators, getAttributeValidators, getAttributeValue, getAttributeValue, getAttributeValueFromRow, getAttributeValues, getAttributeValues, getAttrViewExpressions, getBindingHint, getCachedEvents, getChangeEventPolicy, getColumnNameForQuery, getControlType, getDataChangeEventPolicy, getDataChangeListener, getDisplayHeight, getDisplayHint, getError, getErrors, getEventProducer, getFormat, getFormats, getFormattedAttributeValue, getHint, getHint, getHints, getInputErrorsForRowKey, getInputValue, getInputValue, getInputValueHandler, getIteratorBindingForDCE, getIteratorRenderHint, getLabel, getLabel, getLabels, getLabelSet, getLastEventId, getLocaleContext, getMasterKeyPathForDCE, getMergedAttributeValues, getPath, getPermissionDef, getPermissionHolder, getPermissionInfo, getSelectionDef, getState, getTooltip, getTooltip, hasEventProducer, hasFormatInformation, hasVariables, internalGetRow, internalHasPermission, internalHasPermission, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isAttributeUpdateable, isAttributeUpdateable, isAttributeUpdateable, isEventsCachingEnabled, isNewInputValue, isNullInsertKeyPathForDCE, isPushOrPollDataChangeEvents, isViewable, lookupAttributeDef, notifyDataChangeEvent, notifyDataExceptionEvent, notifyDCE, pinDataControl, processInputException, removeAttrName, removeDataChangeListener, removeFromDCExceptions, resetInputState, resolvePath, restoreFromState, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeNames, setAttributes, setAttributeValue, setAttributeValuesInRow, setAttrViewExpressions, setError, setEventProducer, setEventsCaching, setInputValue, setInputValue, setInputValueHandler, setIteratorBinding, setListener, setNullValueString, startEvents, stopEditing, stopEvents, updateNavigated, updateRangeScrolled, updateRow, updateRowDeleted, updateRowInserted, useRowSpecificHints, 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, evaluateBooleanExpression, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getAttributeListener, getBindingContainer, getControl, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getLayoutObject, getName, getPermission, getPermissionTargetName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewableExpr, getViewObject, hashCode, internalSetName, isControlViewable, isReleased, needsEstimatedRowCount, release, reportException, resetAttributeExceptionInRow, setBindingContainer, setControl, setDataControlPinned, setListener, setName, setViewableExpr
 
Methods inherited from class oracle.jbo.common.JboAbstractMap
entrySet, equals, internalPut, setThrowIfPropertyNotFoundOnGet
 
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 java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface javax.swing.MutableComboBoxModel
addElement, insertElementAt, removeElement, removeElementAt
 
Methods inherited from interface javax.swing.ComboBoxModel
getSelectedItem, setSelectedItem
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 
Methods inherited from interface oracle.adf.model.AttributeBinding
getErrors, getInputValue, getLabel, setInputValue, validateInputValue
 
Methods inherited from interface oracle.adf.model.ControlBinding
setListener
 
Methods inherited from interface oracle.binding.ControlBinding
getName, getPath, release, resolvePath, setListener
 
Methods inherited from interface oracle.jbo.StructureDef
getDefFullName, getDefName, getFullName, getName
 

Constructor Detail

JUComboBoxBinding

public JUComboBoxBinding(java.lang.Object cb,
                         JUIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         int listOperMode)
Binds a ComboBox 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 combobox will display and (optionally)update the same attribute from a RowSet.

Parameters:
cb - ComboBox with which to associate this binding.
iterBinding - Provides the RowSet from which this binding accesses data to display in the combobox and optionally the current row for which attribute(s) are 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:
  • LIST_OPER_SET_ATTRIBUTE (the default) to indicate that this combobox is to be used to update attributes in the current row of the associated RowSet.
  • LIST_OPER_NAVIGATE to indicate that this combobox should be used to iterate currency in the associated RowSet.

JUComboBoxBinding

public JUComboBoxBinding(java.lang.Object cb,
                         JUIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         java.lang.Object[] valueList)
Binds a combobox to an attribute in the associated RowSet. The values displayed in combobox are provided by the valueList objects.

Parameters:
cb - ComboBox with which to associate this binding.
iterBinding - Provides the RowSet that is used to update current selection from the combobox 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 displayed as options in the combobox from which to select.

JUComboBoxBinding

protected JUComboBoxBinding(java.lang.Object cb,
                            DCIteratorBinding iterBinding,
                            java.lang.String[] attrNames,
                            java.lang.String lbName)
*** For internal framework use only ***


JUComboBoxBinding

public JUComboBoxBinding(java.lang.Object cb,
                         JUIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         JUIteratorBinding listIterBinding,
                         java.lang.String[] listAttrNames,
                         java.lang.String[] listDisplayAttrNames)
Binds separate ViewObject/RowSets for display and update to the same ComboBox. Use this binding constructor to provide a separate iterator binding for update and a separate iterator binding which provides rows for display in the combobox. 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:
cb - JComboBox or JUComboBox to associate this binding with.
iterBinding - Provides the RowSet in which the current row is updated based on selection in the combobox.
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.
listIterBinding - Provides the RowSet which is used to display data in the combobox.
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, then the attribute names for display are set the same as attrNames.
listDisplayAttrNames - An ordered list of attribute names that specify the attributes to display from rows in the display ViewObject/RowSet. If this list is null, then attribute names are assumed to be same as in attrNames.
Method Detail

init

protected void init(javax.swing.JComboBox cb)
Overrides:
init in class JUComboBoxCtrlBinding

initFromServerBinding

protected void initFromServerBinding()
Overrides:
initFromServerBinding in class JUCtrlListBinding

setupListItems

protected void setupListItems(boolean clean,
                              boolean keepSelectedIndex)
This method is used by the framwork to setup the list of values (LOV) that will be displayed in this combobox.

Overrides:
setupListItems in class JUComboBoxCtrlBinding
Parameters:
clean - Controls whether to clean the existing entries in the combobox.
keepSelectedIndex - Controls 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 combobox, then the selection is reset to the first item.

hasServerBindingChanged

protected boolean hasServerBindingChanged()
Overrides:
hasServerBindingChanged in class JUCtrlValueBinding

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 JUCtrlListBinding

getDisplayWidth

public int getDisplayWidth()
Description copied from class: JUCtrlValueBinding
Returns the display width for this attribute.

Calling this on a control-binding that does not have an attribute will throw a NullPointerException

Overrides:
getDisplayWidth in class JUCtrlListBinding

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

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