oracle.jbo.uicli.jui
Class JUButtonBinding
java.lang.Object
   java.util.AbstractMap
java.util.AbstractMap
       oracle.jbo.common.JboAbstractMap
oracle.jbo.common.JboAbstractMap
           oracle.adf.model.binding.DCControlBinding
oracle.adf.model.binding.DCControlBinding
               oracle.jbo.uicli.binding.JUControlBinding
oracle.jbo.uicli.binding.JUControlBinding
                   oracle.jbo.uicli.binding.JUCtrlValueBinding
oracle.jbo.uicli.binding.JUCtrlValueBinding
                       oracle.jbo.uicli.binding.JUCtrlAttrsBinding
oracle.jbo.uicli.binding.JUCtrlAttrsBinding
                           oracle.jbo.uicli.binding.JUCtrlListBinding
oracle.jbo.uicli.binding.JUCtrlListBinding
                               oracle.jbo.uicli.binding.JUCtrlBoolBinding
oracle.jbo.uicli.binding.JUCtrlBoolBinding
                                   oracle.jbo.uicli.jui.JUButtonBinding
oracle.jbo.uicli.jui.JUButtonBinding
- All Implemented Interfaces:
- java.awt.event.ActionListener, javax.swing.ButtonModel, java.util.EventListener, java.awt.event.ItemListener, java.awt.ItemSelectable, JUCtrlInputValueHandler, java.util.Map, RowNavigationListener, RowSetListener, RowSetManagementListener, StructureDef
- public class JUButtonBinding
- extends JUCtrlBoolBinding
- implements javax.swing.ButtonModel, java.awt.event.ActionListener, java.awt.event.ItemListener
Implements binding a Swing AbstractButton object with a BC4J attribute.
Swing Classes like JCheckBox, JRadioButton, JButton can be bound using this class to display/update boolean values for an attribute. Applications can customize the boolean values to any two desired values that a particular attribute can accept like Y/N for checkbox states of True/False or Checked/Unchecked.
By default the binding sends a java.lang.Boolean.TRUE for checked or selected state of a button to the BC4J attribute.
 
| Nested classes inherited from class java.util.Map | 
| java.util.Map.Entry | 
 
| 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 | 
 
 
| Method Summary | 
| void | actionPerformed(java.awt.event.ActionEvent e)Binding subclasses can override this method to implement custom action for actionPerformed event without having to add this binding as an ActionListener in the Application.
 | 
| void | addActionListener(java.awt.event.ActionListener l)
 | 
| void | addChangeListener(javax.swing.event.ChangeListener l)
 | 
| void | addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)*** For internal framework use only ***
 | 
| void | addItemListener(java.awt.event.ItemListener l)
 | 
| static javax.swing.ButtonModel | createActionBinding(JUPanelBinding formBinding, java.awt.Component control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, int action)Use this method to bind an AbstractButton to a BC4J ViewObject and assign one of the enumerated set of actions to this Button, so that when this button is pressed (on actionPerformed) the desired action(method) is invoked on the associated RowSet.
 | 
| static javax.swing.ButtonModel | createBooleanBinding(JUFormBinding formBinding, javax.swing.AbstractButton control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] valueList, boolean boolVal)Use this method to bind an AbstractButton to a BC4J Attribute when the Application usage determines the attribute values for true and false states to be used to set the attribute values.
 | 
| java.lang.String | getActionCommand()
 | 
| static javax.swing.ButtonModel | getAttributeBinding(JUFormBinding formBinding, javax.swing.AbstractButton control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName)Use this method to bind an AbstractButton to a BC4J Attribute when the default settings for true and false states are to be used to set the attribute values.
 | 
| java.lang.Object | getControlModel(java.lang.Object control)Gets the associated View's model object.
 | 
| static javax.swing.ButtonModel | getInstance(JUFormBinding formBinding, javax.swing.AbstractButton control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName)Deprecated. since 9.0.2 use createAttributeBinding or createBooleanBinding methods instead.
 | 
| static javax.swing.ButtonModel | getInstance(JUFormBinding formBinding, javax.swing.AbstractButton control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, java.lang.Object[] valueList, boolean boolVal)Deprecated. since 9.0.2 use createAttributeBinding or createBooleanBinding methods instead.
 | 
| static javax.swing.ButtonModel | getInstance(JUPanelBinding formBinding, java.awt.Component control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, int action)Deprecated. since 9.0.2 use createActionBinding method instead.
 | 
| int | getMnemonic()
 | 
| protected javax.swing.ButtonModel | getModelImpl(javax.swing.AbstractButton control)Returns the button model that to which the binding is bound.
 | 
| java.lang.Object[] | getSelectedObjects()
 | 
| java.lang.Object | getValueAt(int attrIndex)Returns the current boolean value that the associated button represents.
 | 
| boolean | isArmed()
 | 
| protected boolean | isControlQueriable()Returns true, so that JTextComponents can participate in a query in the Find Mode of the containing panel.
 | 
| boolean | isEnabled()
 | 
| boolean | isPressed()
 | 
| boolean | isRollover()
 | 
| boolean | isSelected()
 | 
| void | itemStateChanged(java.awt.event.ItemEvent e)Updates the BC4J attribute based on the current setting of the button.
 | 
| void | removeActionListener(java.awt.event.ActionListener l)
 | 
| void | removeChangeListener(javax.swing.event.ChangeListener l)
 | 
| void | removeItemListener(java.awt.event.ItemListener l)
 | 
| void | setActionCommand(java.lang.String s)
 | 
| void | setArmed(boolean b)
 | 
| void | setDataValueAt(java.lang.Object value, int attrIndex)This method is overridden to be a no-op for Button Binding.
 | 
| void | setEnabled(boolean b)
 | 
| void | setGroup(javax.swing.ButtonGroup group)
 | 
| void | setMnemonic(int key)
 | 
| void | setPressed(boolean b)
 | 
| void | setRollover(boolean b)
 | 
| void | setSelected(boolean b)
 | 
| void | setValueAt(java.lang.Object value, int attrIndex)Matches the given value with one of the values given in the constructor or to Boolean.TRUE or Boolean.FALSE and then sets the associated button to matching boolean state.
 | 
| Methods inherited from class oracle.jbo.uicli.binding.JUCtrlListBinding | 
| convertValueList, findListIndex, findMatchingListValue, getDisplayAttributeDefs, getDisplayData, getDisplayHints, getDisplayListIterator, getInputValue, getListDisplayAttrNames, getListIterBinding, getListOperMode, getSelectedIndex, getSelectedIndexValue, getSelectedValue, getValueFromList, getValueList, internalGet, isSingleAttrList, isViewInitialized, iteratorClosed, iteratorReset, matchTargetWithLov, navigated, processNewInputValue, put, rangeRefreshed, rangeScrolled, release, rowDeleted, rowInserted, rowUpdated, setAttributeFromValueList, setInputValue, setListOperMode, setListValueAsSelected, setSelectedIndex, setSelectedIndexValue, setSingleAttrList, setStaticList, setTargetAttrsFromLovRow, setupListItems, setValueList, toString, updateTargetFromSelectedValue, updateValuesFromRow | 
| 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.adf.model.binding.DCControlBinding | 
| addToDCExceptions, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getBindingContainer, getControl, getCurrentRow, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getLayoutObject, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, hashCode, internalSetName, needsEstimatedRowCount, removeFromDCExceptions, reportException, resetAttributeExceptionInRow, setBindingContainer, setControl, setName | 
| 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 | 
 
 
JUButtonBinding
public JUButtonBinding(javax.swing.AbstractButton control,
                       JUIteratorBinding iterBinding,
                       java.lang.String attrName)
JUButtonBinding
public JUButtonBinding(javax.swing.AbstractButton control,
                       JUIteratorBinding iterBinding,
                       java.lang.String attrName,
                       java.lang.Object[] valueList,
                       boolean boolVal)
getControlModel
public java.lang.Object getControlModel(java.lang.Object control)
- Gets the associated View's model object.
- 
- Overrides:
- getControlModelin class- DCControlBinding
 
getAttributeBinding
public static javax.swing.ButtonModel getAttributeBinding(JUFormBinding formBinding,
                                                          javax.swing.AbstractButton control,
                                                          java.lang.String voInstanceName,
                                                          java.lang.String voIterName,
                                                          java.lang.String voIterBindingName,
                                                          java.lang.String attrName)
- Use this method to bind an AbstractButton to a BC4J Attribute when the default settings for true and false states are to be used to set the attribute values.
- 
- Parameters:
- formBinding- The containing JUPanelBinding in which the given iterator binding would be found/created.
- control- The control instance to bind 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.
- attrName- The name of the attribute of this ViewObject rows that contains data to display/edit in the associated button.
- Returns:
- Model Object bound to the given button. This method simply returns the existing model object in the button and does not create a new one. This method simply wires up the Button's model object with a new JClient button binding object and then returns the button's model object.
 
getInstance
public static javax.swing.ButtonModel getInstance(JUFormBinding formBinding,
                                                  javax.swing.AbstractButton control,
                                                  java.lang.String voInstanceName,
                                                  java.lang.String voIterName,
                                                  java.lang.String voIterBindingName,
                                                  java.lang.String attrName)
- Deprecated. since 9.0.2 use createAttributeBinding or createBooleanBinding methods instead.
createBooleanBinding
public static javax.swing.ButtonModel createBooleanBinding(JUFormBinding formBinding,
                                                           javax.swing.AbstractButton control,
                                                           java.lang.String voInstanceName,
                                                           java.lang.String voIterName,
                                                           java.lang.String voIterBindingName,
                                                           java.lang.String attrName,
                                                           java.lang.Object[] valueList,
                                                           boolean boolVal)
- Use this method to bind an AbstractButton to a BC4J Attribute when the Application usage determines the attribute values for true and false states to be used to set the attribute values. The two values for true and false states are passed in valueList object array and the next argument 'boolVal' detmerines whether the first value in the list means true or false.
- 
- Parameters:
- formBinding- The containing JUPanelBinding in which the given iterator binding would be found/created.
- control- The control instance to bind 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.
- attrName- The name of the attribute of this ViewObject rows that contains data to display/edit in the associated button.
- valueList- A list of two values that are used by this binding to set into the BC4J attribute when this button updates an attribute.
- boolVal- When true, the first value in the above list valueList means 'true'.
- Returns:
- Model Object bound to the given button. This method simply returns the existing model object in the button and does not create a new one. This method simply wires up the Button's model object with a new JClient button binding object and then returns the button's model object.
 
getInstance
public static javax.swing.ButtonModel getInstance(JUFormBinding formBinding,
                                                  javax.swing.AbstractButton control,
                                                  java.lang.String voInstanceName,
                                                  java.lang.String voIterName,
                                                  java.lang.String voIterBindingName,
                                                  java.lang.String attrName,
                                                  java.lang.Object[] valueList,
                                                  boolean boolVal)
- Deprecated. since 9.0.2 use createAttributeBinding or createBooleanBinding methods instead.
createActionBinding
public static javax.swing.ButtonModel createActionBinding(JUPanelBinding formBinding,
                                                          java.awt.Component control,
                                                          java.lang.String voInstanceName,
                                                          java.lang.String voIterName,
                                                          java.lang.String voIterBindingName,
                                                          int action)
- Use this method to bind an AbstractButton to a BC4J ViewObject and assign one of the enumerated set of actions to this Button, so that when this button is pressed (on actionPerformed) the desired action(method) is invoked on the associated RowSet. See JUCtrlActionBinding for details on the list of valid actions.
- 
- Parameters:
- formBinding- The containing JUPanelBinding in which the given iterator binding would be found/created.
- control- The control instance to bind 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.
- action- An enumerated action-id which determines which method to invoke on the associated RowSet when this button is pressed.
- Returns:
- Model Object bound to the given button. This method simply returns the existing model object in the button and does not create a new one. This method simply wires up the Button's model object with a new JClient button binding object and then returns the button's model object.
 
getInstance
public static javax.swing.ButtonModel getInstance(JUPanelBinding formBinding,
                                                  java.awt.Component control,
                                                  java.lang.String voInstanceName,
                                                  java.lang.String voIterName,
                                                  java.lang.String voIterBindingName,
                                                  int action)
- Deprecated. since 9.0.2 use createActionBinding method instead.
getModelImpl
protected javax.swing.ButtonModel getModelImpl(javax.swing.AbstractButton control)
- Returns the button model that to which the binding is bound. The first time this method gets called (from the constructor), this method gets the ButtonModel from the given control, and if it is null, then creates a DefaultButtonModel and returns that. Also this method adds this binding object as ActionListener and ItemListener on the button so that it can react to change in button states and set the BC4J attribute value appropriately.
addControlToPanel
public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
- *** For internal framework use only ***
- 
- Overrides:
- addControlToPanelin class- JUCtrlListBinding
 
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:
- isControlQueriablein class- JUCtrlListBinding
 
getValueAt
public java.lang.Object getValueAt(int attrIndex)
- Returns the current boolean value that the associated button represents. This value is used by the framework to get the appropriate attribute value to set into a BC4J attribute.
- 
- Overrides:
- getValueAtin class- JUCtrlListBinding
 
- 
- Parameters:
- attrIndex- This argument is ignored for this binding.
 
setValueAt
public void setValueAt(java.lang.Object value,
                       int attrIndex)
- Matches the given value with one of the values given in the constructor or to Boolean.TRUE or Boolean.FALSE and then sets the associated button to matching boolean state. This method is used by the framework to set the button state based on attribute value.
- 
- Overrides:
- setValueAtin class- JUCtrlListBinding
 
- 
- Parameters:
- value- Should either be Boolean.TRUE or Boolean.FALSE or one of the two values provided in the constructor or create binding method. If the values do not match, then this method sets the button state to false.
- attrIndex- This argument is ignored for this binding.
 
setDataValueAt
public void setDataValueAt(java.lang.Object value,
                           int attrIndex)
- This method is overridden to be a no-op for Button Binding.
- 
- Overrides:
- setDataValueAtin class- JUCtrlListBinding
 
isArmed
public boolean isArmed()
- 
- Specified by:
- isArmedin interface- javax.swing.ButtonModel
 
isSelected
public boolean isSelected()
- 
- Specified by:
- isSelectedin interface- javax.swing.ButtonModel
 
isEnabled
public boolean isEnabled()
- 
- Specified by:
- isEnabledin interface- javax.swing.ButtonModel
 
isPressed
public boolean isPressed()
- 
- Specified by:
- isPressedin interface- javax.swing.ButtonModel
 
isRollover
public boolean isRollover()
- 
- Specified by:
- isRolloverin interface- javax.swing.ButtonModel
 
setArmed
public void setArmed(boolean b)
- 
- Specified by:
- setArmedin interface- javax.swing.ButtonModel
 
setSelected
public void setSelected(boolean b)
- 
- Specified by:
- setSelectedin interface- javax.swing.ButtonModel
 
setEnabled
public void setEnabled(boolean b)
- 
- Specified by:
- setEnabledin interface- javax.swing.ButtonModel
 
setPressed
public void setPressed(boolean b)
- 
- Specified by:
- setPressedin interface- javax.swing.ButtonModel
 
setRollover
public void setRollover(boolean b)
- 
- Specified by:
- setRolloverin interface- javax.swing.ButtonModel
 
setMnemonic
public void setMnemonic(int key)
- 
- Specified by:
- setMnemonicin interface- javax.swing.ButtonModel
 
getMnemonic
public int getMnemonic()
- 
- Specified by:
- getMnemonicin interface- javax.swing.ButtonModel
 
setActionCommand
public void setActionCommand(java.lang.String s)
- 
- Specified by:
- setActionCommandin interface- javax.swing.ButtonModel
 
getActionCommand
public java.lang.String getActionCommand()
- 
- Specified by:
- getActionCommandin interface- javax.swing.ButtonModel
 
setGroup
public void setGroup(javax.swing.ButtonGroup group)
- 
- Specified by:
- setGroupin interface- javax.swing.ButtonModel
 
addActionListener
public void addActionListener(java.awt.event.ActionListener l)
- 
- Specified by:
- addActionListenerin interface- javax.swing.ButtonModel
 
removeActionListener
public void removeActionListener(java.awt.event.ActionListener l)
- 
- Specified by:
- removeActionListenerin interface- javax.swing.ButtonModel
 
addItemListener
public void addItemListener(java.awt.event.ItemListener l)
- 
- Specified by:
- addItemListenerin interface- javax.swing.ButtonModel
 
removeItemListener
public void removeItemListener(java.awt.event.ItemListener l)
- 
- Specified by:
- removeItemListenerin interface- javax.swing.ButtonModel
 
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
- 
- Specified by:
- addChangeListenerin interface- javax.swing.ButtonModel
 
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
- 
- Specified by:
- removeChangeListenerin interface- javax.swing.ButtonModel
 
getSelectedObjects
public java.lang.Object[] getSelectedObjects()
- 
- Specified by:
- getSelectedObjectsin interface- java.awt.ItemSelectable
 
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Binding subclasses can override this method to implement custom action for actionPerformed event without having to add this binding as an ActionListener in the Application. Framework adds this object as an ActionListener by default.
- 
- Specified by:
- actionPerformedin interface- java.awt.event.ActionListener
 
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent e)
- Updates the BC4J attribute based on the current setting of the button. If the button state is checked/selected/true, this method sets the equivalent TRUE value into the attribute (as derived from the valueList and boolVal combination).
- 
- Specified by:
- itemStateChangedin interface- java.awt.event.ItemListener
 
 
 
Copyright © 1997, 2005, Oracle. All rights reserved.