|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.uicli.binding.JUControlBinding | +--oracle.jbo.uicli.binding.JUCtrlValueBinding | +--oracle.jbo.uicli.binding.JUCtrlAttrsBinding | +--oracle.jbo.uicli.binding.JUCtrlListBinding | +--oracle.jbo.uicli.jui.JUComboBoxBinding
Implements binding a swing JComboBox to a BC4J Attribute or ViewObject or as LOV.
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.
Fields inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding |
LIST_OPER_NAVIGATE, LIST_OPER_SET_ATTRIBUTE, mListAttrNames,
mListDisplayAttrNames, mListIterBinding, mStaticList,
mValueList |
Constructor Summary |
JUComboBoxBinding(javax.swing.JComboBox 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(javax.swing.JComboBox 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(javax.swing.JComboBox cb,
JUIteratorBinding iterBinding,
java.lang.String[] attrNames,
java.lang.Object[] valueList)
Binds a combobox to an attribute in the associated RowSet. |
Method Summary |
Type | Method |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Based on listOperMode, this binding either navigates the target rowset to the selected row or sets the attribute/attributes as per the settings in the constructor. |
void |
addControlToPanel(java.lang.Object panel,
java.lang.Object layoutObject,
java.lang.Object layoutCons)
*** For internal framework use only *** |
void |
addElement(java.lang.Object obj)
|
void |
addListDataListener(javax.swing.event.ListDataListener l)
|
static javax.swing.MutableComboBoxModel |
createEnumerationBinding(JUFormBinding formBinding,
javax.swing.JComboBox 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 combobox control to a ViewObject/RowSet identified by voInstanceName when a static list of values are displayed in the combobox, and the combobox is used to display update the same attribute in the same viewobject. |
static javax.swing.MutableComboBoxModel |
createLovBinding(JUFormBinding formBinding,
javax.swing.JComboBox 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,
javax.swing.ComboBoxEditor editor)
Use this binding when two ViewObjects are to be used in this combobox, one for displaying the list of values and the other ViewObject, rows of which are updated. |
static javax.swing.MutableComboBoxModel |
createNavigationBinding(JUFormBinding formBinding,
javax.swing.JComboBox control,
java.lang.String voInstanceName,
java.lang.String voIterName,
java.lang.String voIterBindingName,
java.lang.String[] voAttrNames,
javax.swing.ListCellRenderer cellRenderer,
javax.swing.ComboBoxEditor editor)
Use this binding when the given combobox is used as a navigation control to iterate through a range or rows in a RowSet. |
java.lang.Object |
getElementAt(int index)
|
static javax.swing.MutableComboBoxModel |
getInstance(JUFormBinding formBinding,
javax.swing.JComboBox 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,
javax.swing.ComboBoxEditor editor)
Deprecated. since 9.0.2 use createEnumerationBinding, createNavigationBinding or createLovBinding instead |
static javax.swing.MutableComboBoxModel |
getInstance(JUFormBinding formBinding,
javax.swing.JComboBox 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 |
protected javax.swing.MutableComboBoxModel |
getModelImpl(javax.swing.JComboBox control)
Sets the model reference in this binding class by using the current model in the combobox. |
java.lang.Object |
getSelectedItem()
|
int |
getSize()
|
java.lang.Object |
getValueAt(int attrIndex)
Returns the currently selected item from the list model. |
void |
insertElementAt(java.lang.Object obj,
int index)
|
void |
removeElement(java.lang.Object obj)
|
void |
removeElementAt(int index)
|
void |
removeListDataListener(javax.swing.event.ListDataListener l)
|
void |
setAttribute(int index,
java.lang.Object value)
A Helper method that sets the attribute at the index (into the attrNames array as provided in the constructor) with the given value. |
void |
setDataValueAt(java.lang.Object value,
int attrIndex)
Should be used by applications to update both the combobox selection and the correpsonding attributes in the current row of the target viewobject. |
void |
setSelectedIndex(int listIndex)
Sets the item at the given index as current selection in the listbox. |
void |
setSelectedItem(java.lang.Object anItem)
|
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 combobox. |
void |
setValueAt(java.lang.Object value,
int attrIndex)
Finds the item in the combobox that matches the given value and sets it as the current item |
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding |
convertValueList, findListIndex, findMatchingListValue,
findValue, getAttrValuesFromRSI, getListOperMode, getSelectedIndex, getSelectedValue,
getValueFromList, getValueList, isSingleAttrList,
matchTargetWithLov, navigated,
rangeRefreshed, rangeScrolled,
rowDeleted, rowInserted, rowUpdated,
setAttributeFromValueList, setListOperMode, setSingleAttrList,
setTargetAttrsFromLovRow, setValueList,
updateValuesFromRow |
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding |
updateNavigated, updateRangeScrolled,
updateValuesFromRows |
Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding |
executeQuery, executeQueryIfNeeded, getAllRowsInRange,
getApplicationModule, getControl, getCurrentRow,
getDef, getFormBinding, getIteratorBinding,
getLayoutObject, getName, getRowAtRangeIndex,
getRowIterator, getTransaction, getViewObject,
isControlQueriable, reportException, setFormBinding,
setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JUComboBoxBinding(javax.swing.JComboBox cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode)
cb
- ComboBox to associate this binding with.iterBinding
- provides the RowSet from which this binding accesses data
to display in the combobox and optionally 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:
public JUComboBoxBinding(javax.swing.JComboBox cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList)
cb
- ComboBox to associate this binding with.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 that are displayed as options in the combobox
to select from.public JUComboBoxBinding(javax.swing.JComboBox cb, JUIteratorBinding iterBinding, java.lang.String[] attrNames, JUIteratorBinding listIterBinding, java.lang.String[] listAttrNames, java.lang.String[] listDisplayAttrNames)
cb
- ComboBox 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, the attribute names for display
are set the same as attrNameslistDisplayAttrNames
- An ordered list of attribute names that specify
the attributes to display from rows in the display ViewObject/RowSet.
If this list is null, attribute names are assumed to be same as in attrNamesMethod Detail |
protected javax.swing.MutableComboBoxModel getModelImpl(javax.swing.JComboBox control)
public void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
addControlToPanel
in class JUControlBinding
protected void setupListItems(boolean clean, boolean keepSelectedIndex)
setupListItems
in class JUCtrlListBinding
clean
- means whether to clean the existing entries in the combobox.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 combobox, the selection
is reset to the first item.public java.lang.Object getValueAt(int attrIndex)
getValueAt
in class JUCtrlListBinding
attrIndex
- This argument is ignored by this methodpublic void setValueAt(java.lang.Object value, int attrIndex)
setValueAt
in class JUCtrlAttrsBinding
value
- This value is used in findMatchingListValue method to find out the item in
the combobox 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 methodpublic void setDataValueAt(java.lang.Object value, int attrIndex)
setDataValueAt
in class JUCtrlAttrsBinding
value
- This value is used in findMatchingListValue method to find out the item in
the combobox 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 methodpublic void setSelectedIndex(int listIndex)
setSelectedIndex
in class JUCtrlListBinding
public void setAttribute(int index, java.lang.Object value)
setAttribute
in class JUCtrlValueBinding
oracle.jbo.AttributeList
index
- the attribute's index.value
- the value to be assigned to the attribute.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void setSelectedItem(java.lang.Object anItem)
setSelectedItem
in interface javax.swing.ComboBoxModel
public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public int getSize()
getSize
in interface javax.swing.ListModel
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
public void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener
in interface javax.swing.ListModel
public void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener
in interface javax.swing.ListModel
public void addElement(java.lang.Object obj)
addElement
in interface javax.swing.MutableComboBoxModel
public void removeElement(java.lang.Object obj)
removeElement
in interface javax.swing.MutableComboBoxModel
public void insertElementAt(java.lang.Object obj, int index)
insertElementAt
in interface javax.swing.MutableComboBoxModel
public void removeElementAt(int index)
removeElementAt
in interface javax.swing.MutableComboBoxModel
public static javax.swing.MutableComboBoxModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JComboBox control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] values)
public static javax.swing.MutableComboBoxModel getInstance(JUFormBinding formBinding, javax.swing.JComboBox control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] values)
public static javax.swing.MutableComboBoxModel createLovBinding(JUFormBinding formBinding, javax.swing.JComboBox 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, javax.swing.ComboBoxEditor editor)
public static javax.swing.MutableComboBoxModel createNavigationBinding(JUFormBinding formBinding, javax.swing.JComboBox control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] voAttrNames, javax.swing.ListCellRenderer cellRenderer, javax.swing.ComboBoxEditor editor)
public static javax.swing.MutableComboBoxModel getInstance(JUFormBinding formBinding, javax.swing.JComboBox 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, javax.swing.ComboBoxEditor editor)
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |