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

E10653-08

oracle.jbo.uicli.controls
Class JUArrayComboBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JComboBox
                  extended by oracle.jbo.uicli.controls.JUArrayComboBox
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListDataListener, JUDefaultControlInterface

public class JUArrayComboBox
extends javax.swing.JComboBox
implements java.awt.event.ActionListener, java.awt.event.FocusListener, JUDefaultControlInterface

Extends a JComboBox to display data from a BC4J Array domain. This class implements all editing needs for Array objects that contain scalar values. This class also has allows extensions to allow editing of element that are non-scalar Oracle Object types and Arrays.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JUArrayComboBox()
          Creates a JComboBox with a default data model.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Updates the array with the edits done in the combobox editor.
 void addFocusListener(java.awt.event.FocusAdapter f)
          Sets up the FocusAdapter that this combobox works with to update status bar information.
static javax.swing.ComboBoxModel createAttributeBinding(JUFormBinding formBinding, JUArrayComboBox control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, JUArrayElementEditorInterface editor)
          This method is used by the JDeveloper designtime wizards for binding a JComboBox component with an attribute of type Array in rows of a ViewObject/RowIterator.
 void dataChanged(java.lang.Object dataItem)
          Updates the display of elements with the new Array object that is passed in into this method.
 void focusGained(java.awt.event.FocusEvent event)
          Sends this event to the installed FocusAdapter which in JClient case is used to update the statusbar of a containing frame/JUPanelBinding.
 void focusLost(java.awt.event.FocusEvent event)
           
 JUDefaultControlBinding getArrayBinding()
          Returns the attribute-binding model that this control is bound to.
 JUArrayElementEditorInterface getArrayElementEditor()
          Returns the custom element editor (if any) that this combobox works with.
 void setArrayBinding(JUDefaultControlBinding binding)
          Binds this combobox control with an attribute of Array type in a ViewObject.
 void setArrayElementEditor(JUArrayElementEditorInterface editor)
          Sets the editor whose edit() method will be invoked when the selected item in this combobox is to be edited.
 
Methods inherited from class javax.swing.JComboBox
actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JUArrayComboBox

public JUArrayComboBox()
Creates a JComboBox with a default data model. The default data model is an empty list of objects. Use addItem to add items. By default the first item in the data model becomes selected.

See Also:
DefaultComboBoxModel
Method Detail

setArrayElementEditor

public void setArrayElementEditor(JUArrayElementEditorInterface editor)
Sets the editor whose edit() method will be invoked when the selected item in this combobox is to be edited. The key strokes that invokes this editor is configurable by the editor itself. If no custom key strokes are provided, the default Ctrl+Enter key is used to invoke this editor.

For Oracle Objects, Arrays and other types that cannot be edited as string in the default ComboBoxEditor, this method should be used to set a custom editor that is invoked when the user types Ctrl+Enter (or any custom Key combination as per the editor).


getArrayElementEditor

public JUArrayElementEditorInterface getArrayElementEditor()
Returns the custom element editor (if any) that this combobox works with.


setArrayBinding

public void setArrayBinding(JUDefaultControlBinding binding)
Binds this combobox control with an attribute of Array type in a ViewObject. When the ViewObject/RowSet behind the iterator to which the given binding belongs is executed, the binding object updates this combobox's display with data from the ViewObject.


getArrayBinding

public JUDefaultControlBinding getArrayBinding()
Returns the attribute-binding model that this control is bound to.


dataChanged

public void dataChanged(java.lang.Object dataItem)
Updates the display of elements with the new Array object that is passed in into this method. The first time this method is called for this Combobox instance this method also sets up the element-type that this Array's elements are of.

Specified by:
dataChanged in interface JUDefaultControlInterface
Parameters:
dataItem - Use this data to update the control's display

addFocusListener

public void addFocusListener(java.awt.event.FocusAdapter f)
Sets up the FocusAdapter that this combobox works with to update status bar information.

Specified by:
addFocusListener in interface JUDefaultControlInterface

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Specified by:
focusLost in interface java.awt.event.FocusListener

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Sends this event to the installed FocusAdapter which in JClient case is used to update the statusbar of a containing frame/JUPanelBinding.

Specified by:
focusGained in interface java.awt.event.FocusListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Updates the array with the edits done in the combobox editor.

If the combobox-editor entry is completely removed (deleted), and this method gets called, this method "removes" nulls out the element at the selected index (if any).

If there's no selected item in the combobox and the editor is used to type in a new value, then that value is accepted as a "new element" for the array and appeneded to the array elements.

If there is a selected item and combobox editor provides another value then this method replaces the current entry in the array with the new value.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class javax.swing.JComboBox

createAttributeBinding

public static javax.swing.ComboBoxModel createAttributeBinding(JUFormBinding formBinding,
                                                               JUArrayComboBox control,
                                                               java.lang.String voInstanceName,
                                                               java.lang.String voIterName,
                                                               java.lang.String voIterBindingName,
                                                               java.lang.String attrName,
                                                               JUArrayElementEditorInterface editor)
This method is used by the JDeveloper designtime wizards for binding a JComboBox component with an attribute of type Array in rows of a ViewObject/RowIterator. This method calls JUFormBinding.getRowIterBinding to get the iterator binding using the given parameters and then registers a new JUTextFieldBinding with the iterator binding object so as to display/edit the current row's attribute of the given name.

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 text control.
editor - A custom editor that performs editing of elements in this array /combobox. This editor needs to implement the interface: JUArrayElementEditorInterface and is invoked when a user types the editor-specified key (or Ctrl+Enter by default) on the combobox editor to edit an element in the array.
Returns:
JUControlBinding object bound to the given JUArrayComboBox.

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

E10653-08

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