swingwtx.swing
Class JComboBox
java.lang.Object
swingwt.awt.Component
swingwt.awt.Container
swingwtx.swing.JComponent
swingwtx.swing.JComboBox
- All Implemented Interfaces:
- java.util.EventListener, ImageObserver, ListDataListener, MenuContainer
- public class JComboBox
- extends JComponent
- implements ListDataListener
Fields inherited from class swingwtx.swing.JComponent |
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, opaque, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap |
Fields inherited from class swingwt.awt.Component |
actionCommand, actionListeners, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListeners, componentName, consumeAvailableHeight, consumeAvailableWidth, focusable, focusListeners, graphicsConfig, inputMethodListeners, isUserSetFont, keyListeners, layoutModifier, LEFT_ALIGNMENT, LOCK, mouseListeners, mouseMotionListeners, mouseWheelListeners, parent, pBackground, pCursor, pDoubleBuffered, peer, pEnabled, pFont, pForeground, pLayoutData, pLocation, pMaxSize, pMinSize, pPrefSize, pSize, pToolTipText, pVisible, RIGHT_ALIGNMENT, swingWTDefaultActionEventAdapter, swingWTEventAdapter, TOP_ALIGNMENT |
Methods inherited from class swingwtx.swing.JComponent |
add, add, add, add, add, addPropertyChangeListener, addPropertyChangeListener, checkInternalFrameChild, dispose, getAccessibleContext, getActionMap, getAutoscrolls, getBorder, getClientProperty, getInputMap, getInsets, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isValidateRoot, paint, paintBackground, paintChildren, paintComponent, paintImmediately, paintImmediately, putClientProperty, remove, remove, removePropertyChangeListener, removePropertyChangeListener, repaint, revalidate, scrollRectToVisible, setActionMap, setAutoscrolls, setBorder, setDoubleBuffered, setInputMap, setMargin, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled |
Methods inherited from class swingwt.awt.Container |
addComponentToLayout, addContainerListener, debug_showContainmentTree, doAdd, doLayout, getComponentCount, getComponentOrientation, getComponents, getComposite, getLayout, getMaximumSize, getMinimumSize, getParent, getPreferredSize, invalidate, minimumSize, preferredSize, processContainerEvent, processEvent, queuedValidate, removeAll, removeComponentFromCache, removeContainerListener, setLayout, setLayoutImpl, validate |
Methods inherited from class swingwt.awt.Component |
add, addActionListener, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, calculatePreferredSize, componentOnlyDispose, computePreferredSize, contains, contains, createImage, createListenerArrayFromVector, createVolatileImage, dispatchEvent, getActionCommand, getAlignmentX, getAlignmentY, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getListeners, getLocation, getLocationOnScreen, getName, getPeer, getPeerSize, getSize, getSize, getSWTPeer, getToolkit, getToolTipText, getTreeLock, getWidth, getX, getY, grabFocus, hasFocus, hasSetFont, hide, imageUpdate, inside, isEnabled, isFocusable, isMinimumSizeSet, isShowing, isVisible, processActionEvent, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processTraverseEvent, registerActionEvents, registerComponentEvents, registerEvents, registerExtendedModifyEvents, registerFocusEvents, registerKeyEvents, registerModifyEvents, registerMouseEvents, registerPaintEvents, registerTraversalEvents, remove, removeActionListener, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, repaint, repaint, repaint, requestFocus, setActionCommand, setAlignmentX, setAlignmentY, setBackground, setBounds, setBounds, setCachedProperties, setComponentOrientation, setComponentRemoved, setCursor, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setHeight, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setSize, setSize, setToolTipText, setVisible, setWidth, show, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ppeer
protected org.eclipse.swt.widgets.Combo ppeer
pText
protected java.lang.String pText
litems
protected java.util.Vector litems
pSelectedIndex
protected int pSelectedIndex
pMaxRows
protected int pMaxRows
popupListeners
protected java.util.Vector popupListeners
itemListeners
protected java.util.Vector itemListeners
changeListeners
protected java.util.Vector changeListeners
model
protected ComboBoxModel model
isEditable
protected boolean isEditable
- Used to determine if the combo can be entered into
CANCELED
protected static final int CANCELED
- See Also:
- Constant Field Values
INVISIBLE
protected static final int INVISIBLE
- See Also:
- Constant Field Values
VISIBLE
protected static final int VISIBLE
- See Also:
- Constant Field Values
JComboBox
public JComboBox()
JComboBox
public JComboBox(java.lang.Object[] items)
JComboBox
public JComboBox(java.util.Vector items)
JComboBox
public JComboBox(ComboBoxModel model)
addChangeListener
public void addChangeListener(ChangeListener l)
removeChangeListener
public void removeChangeListener(ChangeListener l)
getChangeListeners
public ChangeListener[] getChangeListeners()
addPopupMenuListener
public void addPopupMenuListener(PopupMenuListener l)
removePopupMenuListener
public void removePopupMenuListener(PopupMenuListener l)
getPopupMenuListener
public PopupMenuListener[] getPopupMenuListener()
addItemListener
public void addItemListener(ItemListener l)
removeItemListener
public void removeItemListener(ItemListener l)
getItemListeners
public ItemListener[] getItemListeners()
processPopupMenuEvent
public void processPopupMenuEvent(int id)
processItemEvent
public void processItemEvent(ItemEvent e)
processChangeEvent
public void processChangeEvent(ChangeEvent e)
copyModel
protected void copyModel()
- Handles copying of Combo box models so they can be
handled by SWT
getSelectedItem
public java.lang.Object getSelectedItem()
getSelectedObjects
public java.lang.Object[] getSelectedObjects()
setSelectedItem
public void setSelectedItem(java.lang.Object text)
getModel
public ComboBoxModel getModel()
setModel
public void setModel(ComboBoxModel model)
addItem
public void addItem(java.lang.Object item)
insertItemAt
public void insertItemAt(java.lang.Object item,
int index)
getSelectedIndex
public int getSelectedIndex()
getItemAt
public java.lang.Object getItemAt(int index)
getComponent
public Component getComponent(int n)
- Overrides:
getComponent
in class Container
getItemCount
public int getItemCount()
setSelectedIndex
public void setSelectedIndex(int index)
removeAllItems
public void removeAllItems()
removeItem
public void removeItem(java.lang.Object item)
removeItemAt
public void removeItemAt(int index)
setEditable
public void setEditable(boolean b)
getEditable
public boolean getEditable()
getMaximumRowCount
public int getMaximumRowCount()
setMaximumRowCount
public void setMaximumRowCount(int max)
setSwingWTParent
public void setSwingWTParent(Container parent)
throws java.lang.Exception
- Once a parent component receives an "add" call for a child, this being
the child, this should be called to tell us to instantiate the peer
and load in any cached properties.
- Overrides:
setSwingWTParent
in class JComponent
- Throws:
java.lang.Exception
registerComboEvents
protected void registerComboEvents()
handleComboKeyStrokes
protected void handleComboKeyStrokes()
- This routine will add the key handlers necessary for searching
through combos by the key pressed (as Windows does, and as Swing does).
This code really isn't too pretty, as SWT deactivates the key events if
SWT.READ_ONLY is specified, so I have to handle that too, also you
can't consume KeyEvents under a Combo (must be a bug), so I use a timer
over the event pump to reset values. As I say, it's dirty but it works.
intervalAdded
public void intervalAdded(ListDataEvent e)
- Specified by:
intervalAdded
in interface ListDataListener
intervalRemoved
public void intervalRemoved(ListDataEvent e)
- Specified by:
intervalRemoved
in interface ListDataListener
contentsChanged
public void contentsChanged(ListDataEvent e)
- Specified by:
contentsChanged
in interface ListDataListener