com.sibvisions.rad.ui.swing.ext
Class JVxComboBase

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 com.sibvisions.rad.ui.swing.ext.JVxComboBase
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ITranslatable, javax.swing.event.ListDataListener, javax.swing.event.PopupMenuListener
Direct Known Subclasses:
JVxDateCombo

public class JVxComboBase
extends javax.swing.JComboBox
implements javax.swing.event.PopupMenuListener, java.awt.event.MouseListener, java.awt.event.KeyListener, java.awt.event.WindowListener, ITranslatable

JVxComboBase is a generic component for displaying any editor component combined with any popup component. The combo base has always an editor component, to copy the text out of it.

See Also:
Serialized Form

Nested Class Summary
static class JVxComboBase.GenericComboBoxEditor
          Generic Editor that allows the changing the EditorComponent.
 
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
JVxComboBase()
          Creates a new instance of JVxComboBase with a default editor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent pActionEvent)
          
 void contentsChanged(javax.swing.event.ListDataEvent pListDataEvent)
          
 javax.swing.text.JTextComponent getEditorComponent()
          Returns the editor component.
 java.lang.Object getItemAt(int index)
          
 int getItemCount()
          
 javax.swing.JComponent getPopupComponent()
          Returns the popup component.
 java.awt.Dimension getPopupSize()
          Gets the size of the Popup window using a Dimension object.
 int getSelectedIndex()
          
 java.lang.Object getSelectedItem()
          
 TranslationMap getTranslation()
          Gets the possible translation mapping.
 void intervalAdded(javax.swing.event.ListDataEvent pListDataEvent)
          
 void intervalRemoved(javax.swing.event.ListDataEvent pListDataEvent)
          
 boolean isEditorEditable()
          Gets true, if the editor is editable.
 boolean isForceFocusOnPopup()
          Gets if the focus is forced to be given on the popup.
 boolean isPopupCanceled()
          True, if popup is canceled, or popup is set as canceled.
 boolean isPopupFocusEvent(java.awt.event.FocusEvent pFocusEvent)
          True, if FocusEvent is caused from the Popup.
 boolean isPopupVisible()
          Returns the visibility of the choice component.
 boolean isTranslationEnabled()
          Gets whether the translation is en- or disabled.
 void keyPressed(java.awt.event.KeyEvent pKeyEvent)
          
 void keyReleased(java.awt.event.KeyEvent pKeyEvent)
          
 void keyTyped(java.awt.event.KeyEvent pKeyEvent)
          
 void mouseClicked(java.awt.event.MouseEvent pMouseEvent)
          
 void mouseEntered(java.awt.event.MouseEvent pMouseEvent)
          
 void mouseExited(java.awt.event.MouseEvent pMouseEvent)
          
 void mousePressed(java.awt.event.MouseEvent pMouseEvent)
          
 void mouseReleased(java.awt.event.MouseEvent pMouseEvent)
          
 void popupMenuCanceled(javax.swing.event.PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent pPopupMenuEvent)
          
 void removeNotify()
          
protected  void selectedItemChanged()
          
 void setButtonEnabled(boolean pButtonEnabled)
          Sets the Button enabled or not.
 void setEditable(boolean pEditable)
          
 void setEditor(javax.swing.ComboBoxEditor pEditor)
          
 void setEditorComponent(javax.swing.text.JTextComponent pEditorComponent)
          Sets the editor component.
 void setEditorEditable(boolean pEditable)
          Sets true, if the editor is editable.
 void setForceFocusOnPopup(boolean pForceFocusOnPopup)
          Gets if the focus is forced to be given on the popup.
 void setPopupCanceled(boolean pPopupCanceled)
          True, if popup should close in canceled mode.
 void setPopupComponent(javax.swing.JComponent pPopupComponent)
          Sets the popup component.
 void setPopupSize(java.awt.Dimension pPopupSize)
          Sets the size of the Popup window using a Dimension object.
 void setPopupVisible(boolean pPopupVisible)
          Sets the visibility of the choice component.
 void setSelectedIndex(int pIndex)
          
 void setSelectedItem(java.lang.Object pSelectedItem)
          
 void setTranslation(TranslationMap pTranslation)
          Sets the possible translations.
 void setTranslationEnabled(boolean pEnabled)
          Sets the translation en- or disabled.
 void setUI(javax.swing.plaf.ComboBoxUI pComboBoxUI)
          
 void setVisible(boolean pVisible)
          
 void windowActivated(java.awt.event.WindowEvent pWindowEvent)
          
 void windowClosed(java.awt.event.WindowEvent pWindowEvent)
          
 void windowClosing(java.awt.event.WindowEvent pWindowEvent)
          
 void windowDeactivated(java.awt.event.WindowEvent pWindowEvent)
          
 void windowDeiconified(java.awt.event.WindowEvent pWindowEvent)
          
 void windowIconified(java.awt.event.WindowEvent pWindowEvent)
          
 void windowOpened(java.awt.event.WindowEvent pWindowEvent)
          
 
Methods inherited from class javax.swing.JComboBox
actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, isEditable, isLightWeightPopupEnabled, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectWithKeyChar, setAction, setActionCommand, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPrototypeDisplayValue, setRenderer, 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, 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, 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

JVxComboBase

public JVxComboBase()
Creates a new instance of JVxComboBase with a default editor.

Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent pMouseEvent)

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent pMouseEvent)

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent pMouseEvent)

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent pMouseEvent)

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent pMouseEvent)

Specified by:
mouseReleased in interface java.awt.event.MouseListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent pKeyEvent)

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent pKeyEvent)

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent pKeyEvent)

Specified by:
keyReleased in interface java.awt.event.KeyListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent pWindowEvent)

Specified by:
windowOpened in interface java.awt.event.WindowListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent pActionEvent)

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

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener

isPopupCanceled

public boolean isPopupCanceled()
True, if popup is canceled, or popup is set as canceled.

Returns:
true, if popup is canceled, or popup is set as canceled.

setPopupCanceled

public void setPopupCanceled(boolean pPopupCanceled)
True, if popup should close in canceled mode.

Parameters:
pPopupCanceled - True, if popup should close in canceled mode.

popupMenuCanceled

public void popupMenuCanceled(javax.swing.event.PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuCanceled in interface javax.swing.event.PopupMenuListener

setTranslation

public void setTranslation(TranslationMap pTranslation)
Sets the possible translations.

Specified by:
setTranslation in interface ITranslatable
Parameters:
pTranslation - the translation mapping

getTranslation

public TranslationMap getTranslation()
Gets the possible translation mapping.

Specified by:
getTranslation in interface ITranslatable
Returns:
the translation mapping

setTranslationEnabled

public void setTranslationEnabled(boolean pEnabled)
Sets the translation en- or disabled.

Specified by:
setTranslationEnabled in interface ITranslatable
Parameters:
pEnabled - true to enable the translation, false to disable

isTranslationEnabled

public boolean isTranslationEnabled()
Gets whether the translation is en- or disabled.

Specified by:
isTranslationEnabled in interface ITranslatable
Returns:
true if translation is performed, false otherwise

getSelectedItem

public java.lang.Object getSelectedItem()

Overrides:
getSelectedItem in class javax.swing.JComboBox

setSelectedItem

public void setSelectedItem(java.lang.Object pSelectedItem)

Overrides:
setSelectedItem in class javax.swing.JComboBox

selectedItemChanged

protected void selectedItemChanged()

Overrides:
selectedItemChanged in class javax.swing.JComboBox

contentsChanged

public void contentsChanged(javax.swing.event.ListDataEvent pListDataEvent)

Specified by:
contentsChanged in interface javax.swing.event.ListDataListener
Overrides:
contentsChanged in class javax.swing.JComboBox

intervalAdded

public void intervalAdded(javax.swing.event.ListDataEvent pListDataEvent)

Specified by:
intervalAdded in interface javax.swing.event.ListDataListener
Overrides:
intervalAdded in class javax.swing.JComboBox

intervalRemoved

public void intervalRemoved(javax.swing.event.ListDataEvent pListDataEvent)

Specified by:
intervalRemoved in interface javax.swing.event.ListDataListener
Overrides:
intervalRemoved in class javax.swing.JComboBox

getSelectedIndex

public int getSelectedIndex()

Overrides:
getSelectedIndex in class javax.swing.JComboBox

setSelectedIndex

public void setSelectedIndex(int pIndex)

Overrides:
setSelectedIndex in class javax.swing.JComboBox

getItemCount

public int getItemCount()

Overrides:
getItemCount in class javax.swing.JComboBox

getItemAt

public java.lang.Object getItemAt(int index)

Overrides:
getItemAt in class javax.swing.JComboBox

setUI

public void setUI(javax.swing.plaf.ComboBoxUI pComboBoxUI)

Overrides:
setUI in class javax.swing.JComboBox

setEditable

public void setEditable(boolean pEditable)

Overrides:
setEditable in class javax.swing.JComboBox

isEditorEditable

public boolean isEditorEditable()
Gets true, if the editor is editable.

Returns:
true, if the editor is editable.

setEditorEditable

public void setEditorEditable(boolean pEditable)
Sets true, if the editor is editable.

Parameters:
pEditable - true, if the editor is editable.

setButtonEnabled

public void setButtonEnabled(boolean pButtonEnabled)
Sets the Button enabled or not.

Parameters:
pButtonEnabled - the Button enabled or not.

setPopupVisible

public void setPopupVisible(boolean pPopupVisible)
Sets the visibility of the choice component.

Overrides:
setPopupVisible in class javax.swing.JComboBox
Parameters:
pPopupVisible - the visibility of the choice component

setEditor

public void setEditor(javax.swing.ComboBoxEditor pEditor)

Overrides:
setEditor in class javax.swing.JComboBox

setVisible

public void setVisible(boolean pVisible)

Overrides:
setVisible in class javax.swing.JComponent

removeNotify

public void removeNotify()

Overrides:
removeNotify in class javax.swing.JComponent

getPopupSize

public java.awt.Dimension getPopupSize()
Gets the size of the Popup window using a Dimension object. Null means, that the Popup window opens with preferredSize.

Returns:
the Popup size of.

setPopupSize

public void setPopupSize(java.awt.Dimension pPopupSize)
Sets the size of the Popup window using a Dimension object. Null means, that the Popup window opens with preferredSize.

Parameters:
pPopupSize - the Popup size of.

isForceFocusOnPopup

public boolean isForceFocusOnPopup()
Gets if the focus is forced to be given on the popup.

Returns:
the focus is forced to be given on the popup.

setForceFocusOnPopup

public void setForceFocusOnPopup(boolean pForceFocusOnPopup)
Gets if the focus is forced to be given on the popup.

Parameters:
pForceFocusOnPopup - the focus is forced to be given on the popup.

isPopupVisible

public boolean isPopupVisible()
Returns the visibility of the choice component.

Overrides:
isPopupVisible in class javax.swing.JComboBox
Returns:
the visibility of the choice component

isPopupFocusEvent

public boolean isPopupFocusEvent(java.awt.event.FocusEvent pFocusEvent)
True, if FocusEvent is caused from the Popup.

Parameters:
pFocusEvent - the focus event.
Returns:
True, if FocusEvent is caused from the Popup.

getEditorComponent

public javax.swing.text.JTextComponent getEditorComponent()
Returns the editor component.

Returns:
the editor component.

setEditorComponent

public void setEditorComponent(javax.swing.text.JTextComponent pEditorComponent)
Sets the editor component.

Parameters:
pEditorComponent - the editor component

getPopupComponent

public javax.swing.JComponent getPopupComponent()
Returns the popup component.

Returns:
the popup component.

setPopupComponent

public void setPopupComponent(javax.swing.JComponent pPopupComponent)
Sets the popup component.

Parameters:
pPopupComponent - the popup component


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.