Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.uicli.controls
Class JUArrayComboBox

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

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 inherited from class javax.swing.JComboBox
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, 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
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, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

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 ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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