public class JUArrayComboBox extends javax.swing.JComboBox implements java.awt.event.ActionListener, java.awt.event.FocusListener, JUDefaultControlInterface
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
javax.swing.JComponent.AccessibleJComponent
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JUArrayComboBox()
Creates a
JComboBox with a default data model. |
Modifier and Type | Method and Description |
---|---|
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.
|
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, processKeyBinding, 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
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public JUArrayComboBox()
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.DefaultComboBoxModel
public void setArrayElementEditor(JUArrayElementEditorInterface 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).
public JUArrayElementEditorInterface getArrayElementEditor()
public void setArrayBinding(JUDefaultControlBinding binding)
public JUDefaultControlBinding getArrayBinding()
public void dataChanged(java.lang.Object dataItem)
dataChanged
in interface JUDefaultControlInterface
dataItem
- Use this data to update the control's displaypublic void addFocusListener(java.awt.event.FocusAdapter f)
addFocusListener
in interface JUDefaultControlInterface
public void focusLost(java.awt.event.FocusEvent event)
focusLost
in interface java.awt.event.FocusListener
public void focusGained(java.awt.event.FocusEvent event)
focusGained
in interface java.awt.event.FocusListener
public void actionPerformed(java.awt.event.ActionEvent e)
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.
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class javax.swing.JComboBox
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)
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.