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


oracle.jbo.uicli.jui
Class JUSpinnerBinding

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.JUSpinnerBinding
All Implemented Interfaces:
AttributeList, java.util.EventListener, RowNavigationListener, RowSetListener

public class JUSpinnerBinding
extends JUCtrlListBinding

Implements binding for JSpinner control. JSpinner can be bound in the following ways:


Nested Class Summary
static class JUSpinnerBinding.JUSpinnerEditor
           

 

Field Summary
protected  javax.swing.SpinnerModel modelImpl
           
protected  boolean mValueUpdating
           

 

Fields inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding
LIST_OPER_NAVIGATE, LIST_OPER_SET_ATTRIBUTE, mFirstDisplayAttr, mListAttrNames, mListDisplayAttrNames, mListIterBinding, mSingleAttrList, mStaticList, mValueList

 

Constructor Summary
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode)
          JUSpinnerBinding to be used in Navigation mode.
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, JUIteratorBinding listRSI, java.lang.String[] listAttrNames, java.lang.String[] listDisplayedAttrNames)
          Binds separate ViewObject/RowSets for display and updates to the same listbox.
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList)
           
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, javax.swing.SpinnerDateModel sdm)
           
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, javax.swing.SpinnerListModel slm)
           
JUSpinnerBinding(javax.swing.JSpinner control, JUIteratorBinding iterBinding, java.lang.String[] attrNames, javax.swing.SpinnerNumberModel snm)
           

 

Method Summary
 void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
          *** For internal framework use only ***
static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JSpinner 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 JSpinner control to a ViewObject/RowSet, identified by voInstanceName.
static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JSpinner control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, javax.swing.SpinnerDateModel sdm)
          Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName.
static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JSpinner control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, javax.swing.SpinnerListModel slm)
          Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName.
static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding, javax.swing.JSpinner control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, javax.swing.SpinnerNumberModel snm)
          Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName.
static javax.swing.SpinnerModel createLovBinding(JUFormBinding formBinding, javax.swing.JSpinner control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] attrNames, java.lang.String listVOInstanceName)
          Use this binding when the JSpinner control is used in LOV mode to update another attribute in a BC4J View Object.
static javax.swing.SpinnerModel createLovBinding(JUFormBinding formBinding, javax.swing.JSpinner 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)
          Use this binding when two ViewObjects are to be used in this Spinner control: one for displaying of values and the other ViewObject whose rows are updated.
static javax.swing.SpinnerModel createNavigationBinding(JUFormBinding formBinding, javax.swing.JSpinner control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String[] voAttrNames)
          Use this binding when the JSpinner control is used as a navigation control to iterate through a range of rows in a RowSet.
 java.lang.Object findMatchingListValue(java.lang.Object value)
           
protected  java.lang.String getDateFormatString(java.lang.String attrName, boolean useDefaultIfNull)
           
protected  java.lang.String getDefaultDateFormatString()
           
protected  java.lang.String getDefaultNumericFormatString()
           
protected  javax.swing.SpinnerModel getModelImpl()
           
protected  java.lang.String getNumericFormatString(java.lang.String attrName, boolean useDefaultIfNull)
           
 java.lang.Object getValueAt(int attrIndex)
          Gets the value from the control for the attribute at the given index.
 void navigated(NavigationEvent event)
          *** For internal framework use only ***
protected  void navigateTo(javax.swing.event.ChangeEvent e)
           
protected  void navigateTo(int rangeIndex)
           
 void setDataValueAt(java.lang.Object value, int attrIndex)
           
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 setValueAt(java.lang.Object value, int attrIndex)
          Updates the control/control-binding with the latest value of the attribute at the given index with the given value.
protected  void updateAttributeValue(java.lang.Object value)
           
protected  void updateTargetFromSelectedValue(java.lang.Object val)
           

 

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding
convertValueList, findListIndex, findValue, getAttrValuesFromRSI, getListOperMode, getSelectedIndex, getSelectedValue, getValueFromList, getValueList, isSingleAttrList, matchTargetWithLov, rangeRefreshed, rangeScrolled, rowDeleted, rowInserted, rowUpdated, setAttributeFromValueList, setListOperMode, setSelectedIndex, setSingleAttrList, setTargetAttrsFromLovRow, setValueList, updateValuesFromRow

 

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
refreshControl, 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
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

modelImpl

protected javax.swing.SpinnerModel modelImpl

mValueUpdating

protected boolean mValueUpdating
Constructor Detail

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
                        int listOperMode)
JUSpinnerBinding to be used in Navigation mode.
Parameters:
control - The control instance which should be bound to a ViewObject's attribute.
iterBinding - iterator binding to use

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
                        java.lang.Object[] valueList)

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
                        javax.swing.SpinnerListModel slm)

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
                        javax.swing.SpinnerDateModel sdm)

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
                        javax.swing.SpinnerNumberModel snm)

JUSpinnerBinding

public JUSpinnerBinding(javax.swing.JSpinner control,
JUIteratorBinding iterBinding,
                        java.lang.String[] attrNames,
JUIteratorBinding listRSI,
                        java.lang.String[] listAttrNames,
                        java.lang.String[] listDisplayedAttrNames)
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:
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.
Method Detail

createNavigationBinding

public static javax.swing.SpinnerModel createNavigationBinding(JUFormBinding formBinding,
                                                               javax.swing.JSpinner control,
                                                               java.lang.String voInstanceName,
                                                               java.lang.String voIterName,
                                                               java.lang.String voIterBindingName,
                                                               java.lang.String[] voAttrNames)
Use this binding when the JSpinner control is used as a navigation control to iterate through a range of rows in a RowSet.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read data in this given JUPanelBinding instance.
Returns:
JUSpinnerBinding An instance of control binding that works with the given JSpinner.

createLovBinding

public static javax.swing.SpinnerModel createLovBinding(JUFormBinding formBinding,
                                                        javax.swing.JSpinner control,
                                                        java.lang.String voInstanceName,
                                                        java.lang.String voIterName,
                                                        java.lang.String voIterBindingName,
                                                        java.lang.String[] attrNames,
                                                        java.lang.String listVOInstanceName)
Use this binding when the JSpinner control is used in LOV mode to update another attribute in a BC4J View Object.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read/write data in this given JUPanelBinding instance.
attrNames - The name of the attribute of this ViewObject rows that contain data to display/edit in the associated control.
listVOInstanceName - list View Object instance name
Returns:
JUSpinnerBinding An instance of control binding that works with the given JSpinner.

createLovBinding

public static javax.swing.SpinnerModel createLovBinding(JUFormBinding formBinding,
                                                        javax.swing.JSpinner 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)
Use this binding when two ViewObjects are to be used in this Spinner control: one for displaying of values and the other ViewObject whose rows are updated.

createEnumerationBinding

public static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding,
                                                                javax.swing.JSpinner 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 JSpinner control to a ViewObject/RowSet, identified by voInstanceName. The values for the spinner is specified as a static list of values. The control is used to display/update a particular attribute in a ViewObject.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read data in this given JUPanelBinding instance.
attrName - The name of the attribute of this ViewObject to update
values - static list of values for the spinner
Returns:
Object that can be used as model for JSpinner and can display/update attribute in BC4J ViewOject.

createEnumerationBinding

public static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding,
                                                                javax.swing.JSpinner control,
                                                                java.lang.String voInstanceName,
                                                                java.lang.String voIterName,
                                                                java.lang.String voIterBindingName,
                                                                java.lang.String attrName,
                                                                javax.swing.SpinnerListModel slm)
Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName. The model object returned extends SpinnerListModel. The list of values for the JSpinner is specified through an instance of SpinnerListModel.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read data in this given JUPanelBinding instance.
attrName - The name of the attribute of this ViewObject to update
slm - instance of SpinnerNumberModel which provides the range of value for the spinner as well as the step size.
Returns:
Object that can be used as model for JSpinner and can display/update attribute in BC4J ViewOject.

createEnumerationBinding

public static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding,
                                                                javax.swing.JSpinner control,
                                                                java.lang.String voInstanceName,
                                                                java.lang.String voIterName,
                                                                java.lang.String voIterBindingName,
                                                                java.lang.String attrName,
                                                                javax.swing.SpinnerDateModel sdm)
Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName. The model object returned extends SpinnerDateModel. This method also sets an instance of JSpinner.DateEditor as the editor for the control. The format string UI hint defined in the middle tier is used as default format for the editor. The range of values for the JSpinner and the step size is specified through an instance of SpinnerDateModel.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read data in this given JUPanelBinding instance.
attrName - The name of the attribute of this ViewObject to update
sdm - instance of SpinnerDateModel which provides the range of value for the spinner as well as the step size.
Returns:
Object that can be used as model for JSpinner and can display/update attribute in BC4J ViewOject.

createEnumerationBinding

public static javax.swing.SpinnerModel createEnumerationBinding(JUFormBinding formBinding,
                                                                javax.swing.JSpinner control,
                                                                java.lang.String voInstanceName,
                                                                java.lang.String voIterName,
                                                                java.lang.String voIterBindingName,
                                                                java.lang.String attrName,
                                                                javax.swing.SpinnerNumberModel snm)
Use this method to bind a JSpinner control to a ViewObject/RowSet, identified by voInstanceName. The model object returned extends SpinnerNumberModel. This method also sets an instance of JSpinner.NumberEditor as the editor for the control. The format string UI hint defined in the middle tier is used as default format for the editor. The range of values for the JSpinner and the step size is specified through an instance of SpinnerNumberModel.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - The control instance which should be bound to a ViewObject's attribute.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule.
voIterName - Runtime instance name of the iterator in the ViewObject (optional).
voIterBindingName - Instance name of the iterator binding that uniquely identifies an iterator binding object used to read data in this given JUPanelBinding instance.
attrName - The name of the attribute of this ViewObject to update
Returns:
Object that can be used as model for JSpinner and can display/update attribute in BC4J ViewOject.

getModelImpl

protected javax.swing.SpinnerModel getModelImpl()

addControlToPanel

public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
*** For internal framework use only ***
Specified by:
addControlToPanel in class JUControlBinding

getValueAt

public java.lang.Object getValueAt(int attrIndex)
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.
Overrides:
getValueAt in class JUCtrlListBinding

setValueAt

public void setValueAt(java.lang.Object value,
                       int attrIndex)
Updates the control/control-binding with the latest value of the attribute at the given index with the given value. This method is used by the framework to update the control with attribute values from a BC4J row.
Specified by:
setValueAt in class JUCtrlAttrsBinding

findMatchingListValue

public java.lang.Object findMatchingListValue(java.lang.Object value)
Overrides:
findMatchingListValue in class JUCtrlListBinding

setDataValueAt

public void setDataValueAt(java.lang.Object value,
                           int attrIndex)
Specified by:
setDataValueAt in class JUCtrlAttrsBinding

navigated

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

setupListItems

protected void setupListItems(boolean clean,
                              boolean keepSelectedIndex)
Description copied from class: JUCtrlListBinding
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.

Overrides:
setupListItems in class JUCtrlListBinding

updateAttributeValue

protected void updateAttributeValue(java.lang.Object value)

updateTargetFromSelectedValue

protected void updateTargetFromSelectedValue(java.lang.Object val)
Overrides:
updateTargetFromSelectedValue in class JUCtrlListBinding

navigateTo

protected void navigateTo(javax.swing.event.ChangeEvent e)

navigateTo

protected void navigateTo(int rangeIndex)

getDateFormatString

protected java.lang.String getDateFormatString(java.lang.String attrName,
                                               boolean useDefaultIfNull)

getNumericFormatString

protected java.lang.String getNumericFormatString(java.lang.String attrName,
                                                  boolean useDefaultIfNull)

getDefaultDateFormatString

protected java.lang.String getDefaultDateFormatString()

getDefaultNumericFormatString

protected java.lang.String getDefaultNumericFormatString()

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


 

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