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:
ActionListener, KeyListener, MouseListener, WindowListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ITranslatable, ListDataListener, PopupMenuListener
Direct Known Subclasses:
JVxDateCombo

public class JVxComboBase
extends JComboBox
implements PopupMenuListener, MouseListener, KeyListener, 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
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, 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(ActionEvent pActionEvent)
          
 void contentsChanged(ListDataEvent pListDataEvent)
          
 JTextComponent getEditorComponent()
          Returns the editor component.
 Object getItemAt(int index)
          
 int getItemCount()
          
 JComponent getPopupComponent()
          Returns the popup component.
 Dimension getPopupSize()
          Gets the size of the Popup window using a Dimension object.
 int getSelectedIndex()
          
 Object getSelectedItem()
          
 TranslationMap getTranslation()
          Gets the possible translation mapping for this UIComponent.
 void intervalAdded(ListDataEvent pListDataEvent)
          
 void intervalRemoved(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(FocusEvent pFocusEvent)
          True, if FocusEvent is caused from the Popup.
 boolean isPopupVisible()
          Returns the visibility of the choice component.
 void keyPressed(KeyEvent pKeyEvent)
          
 void keyReleased(KeyEvent pKeyEvent)
          
 void keyTyped(KeyEvent pKeyEvent)
          
 void mouseClicked(MouseEvent pMouseEvent)
          
 void mouseEntered(MouseEvent pMouseEvent)
          
 void mouseExited(MouseEvent pMouseEvent)
          
 void mousePressed(MouseEvent pMouseEvent)
          
 void mouseReleased(MouseEvent pMouseEvent)
          
 void popupMenuCanceled(PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeInvisible(PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeVisible(PopupMenuEvent pPopupMenuEvent)
          
 void removeNotify()
          
protected  void selectedItemChanged()
          
 void setButtonEnabled(boolean pButtonEnabled)
          Sets the Button enabled or not.
 void setEditable(boolean pEditable)
          
 void setEditor(ComboBoxEditor pEditor)
          
 void setEditorComponent(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(JComponent pPopupComponent)
          Sets the popup component.
 void setPopupSize(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(Object pSelectedItem)
          
 void setTranslation(TranslationMap pTranslation)
          Sets the possible translations for this UIComponent.
 void setUI(ComboBoxUI pComboBoxUI)
          
 void setVisible(boolean pVisible)
          
 void windowActivated(WindowEvent pWindowEvent)
          
 void windowClosed(WindowEvent pWindowEvent)
          
 void windowClosing(WindowEvent pWindowEvent)
          
 void windowDeactivated(WindowEvent pWindowEvent)
          
 void windowDeiconified(WindowEvent pWindowEvent)
          
 void windowIconified(WindowEvent pWindowEvent)
          
 void windowOpened(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(MouseEvent pMouseEvent)

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent pMouseEvent)

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent pMouseEvent)

Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent pMouseEvent)

Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent pMouseEvent)

Specified by:
mouseReleased in interface MouseListener

keyPressed

public void keyPressed(KeyEvent pKeyEvent)

Specified by:
keyPressed in interface KeyListener

keyTyped

public void keyTyped(KeyEvent pKeyEvent)

Specified by:
keyTyped in interface KeyListener

keyReleased

public void keyReleased(KeyEvent pKeyEvent)

Specified by:
keyReleased in interface KeyListener

windowActivated

public void windowActivated(WindowEvent pWindowEvent)

Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent pWindowEvent)

Specified by:
windowClosed in interface WindowListener

windowClosing

public void windowClosing(WindowEvent pWindowEvent)

Specified by:
windowClosing in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent pWindowEvent)

Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent pWindowEvent)

Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent pWindowEvent)

Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent pWindowEvent)

Specified by:
windowOpened in interface WindowListener

actionPerformed

public void actionPerformed(ActionEvent pActionEvent)

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class JComboBox

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeVisible in interface PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeInvisible in interface 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(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuCanceled in interface PopupMenuListener

setTranslation

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

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

getTranslation

public TranslationMap getTranslation()
Gets the possible translation mapping for this UIComponent.

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

getSelectedItem

public Object getSelectedItem()

Overrides:
getSelectedItem in class JComboBox

setSelectedItem

public void setSelectedItem(Object pSelectedItem)

Overrides:
setSelectedItem in class JComboBox

selectedItemChanged

protected void selectedItemChanged()

Overrides:
selectedItemChanged in class JComboBox

contentsChanged

public void contentsChanged(ListDataEvent pListDataEvent)

Specified by:
contentsChanged in interface ListDataListener
Overrides:
contentsChanged in class JComboBox

intervalAdded

public void intervalAdded(ListDataEvent pListDataEvent)

Specified by:
intervalAdded in interface ListDataListener
Overrides:
intervalAdded in class JComboBox

intervalRemoved

public void intervalRemoved(ListDataEvent pListDataEvent)

Specified by:
intervalRemoved in interface ListDataListener
Overrides:
intervalRemoved in class JComboBox

getSelectedIndex

public int getSelectedIndex()

Overrides:
getSelectedIndex in class JComboBox

setSelectedIndex

public void setSelectedIndex(int pIndex)

Overrides:
setSelectedIndex in class JComboBox

getItemCount

public int getItemCount()

Overrides:
getItemCount in class JComboBox

getItemAt

public Object getItemAt(int index)

Overrides:
getItemAt in class JComboBox

setUI

public void setUI(ComboBoxUI pComboBoxUI)

Overrides:
setUI in class JComboBox

setEditable

public void setEditable(boolean pEditable)

Overrides:
setEditable in class 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 JComboBox
Parameters:
pPopupVisible - the visibility of the choice component

setEditor

public void setEditor(ComboBoxEditor pEditor)

Overrides:
setEditor in class JComboBox

setVisible

public void setVisible(boolean pVisible)

Overrides:
setVisible in class JComponent

removeNotify

public void removeNotify()

Overrides:
removeNotify in class JComponent

getPopupSize

public 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(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 JComboBox
Returns:
the visibility of the choice component

isPopupFocusEvent

public boolean isPopupFocusEvent(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 JTextComponent getEditorComponent()
Returns the editor component.

Returns:
the editor component.

setEditorComponent

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

Parameters:
pEditorComponent - the editor component

getPopupComponent

public JComponent getPopupComponent()
Returns the popup component.

Returns:
the popup component.

setPopupComponent

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

Parameters:
pPopupComponent - the popup component


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.