513 protected ItemListener createItemListener() {
514 return getHandler();
515 }
516
517 private Handler getHandler() {
518 if (handler == null) {
519 handler = new Handler();
520 }
521 return handler;
522 }
523
524 /**
525 * Creates the JList used in the popup to display
526 * the items in the combo box model. This method is called when the UI class
527 * is created.
528 *
529 * @return a <code>JList</code> used to display the combo box items
530 */
531 protected JList<Object> createList() {
532 return new JList<Object>( comboBox.getModel() ) {
533 @SuppressWarnings("deprecation")
534 public void processMouseEvent(MouseEvent e) {
535 if (BasicGraphicsUtils.isMenuShortcutKeyDown(e)) {
536 // Fix for 4234053. Filter out the Control Key from the list.
537 // ie., don't allow CTRL key deselection.
538 Toolkit toolkit = Toolkit.getDefaultToolkit();
539 MouseEvent newEvent = new MouseEvent(
540 (Component)e.getSource(), e.getID(), e.getWhen(),
541 e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
542 e.getX(), e.getY(),
543 e.getXOnScreen(), e.getYOnScreen(),
544 e.getClickCount(),
545 e.isPopupTrigger(),
546 MouseEvent.NOBUTTON);
547 MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
548 meAccessor.setCausedByTouchEvent(newEvent,
549 meAccessor.isCausedByTouchEvent(e));
550 e = newEvent;
551 }
552 super.processMouseEvent(e);
553 }
554 };
555 }
556
557 /**
558 * Configures the list which is used to hold the combo box items in the
559 * popup. This method is called when the UI class
560 * is created.
561 *
|
513 protected ItemListener createItemListener() {
514 return getHandler();
515 }
516
517 private Handler getHandler() {
518 if (handler == null) {
519 handler = new Handler();
520 }
521 return handler;
522 }
523
524 /**
525 * Creates the JList used in the popup to display
526 * the items in the combo box model. This method is called when the UI class
527 * is created.
528 *
529 * @return a <code>JList</code> used to display the combo box items
530 */
531 protected JList<Object> createList() {
532 return new JList<Object>( comboBox.getModel() ) {
533 public void processMouseEvent(MouseEvent e) {
534 if (BasicGraphicsUtils.isMenuShortcutKeyDown(e)) {
535 // Fix for 4234053. Filter out the Control Key from the list.
536 // ie., don't allow CTRL key deselection.
537 Toolkit toolkit = Toolkit.getDefaultToolkit();
538 MouseEvent newEvent = new MouseEvent(
539 (Component)e.getSource(), e.getID(), e.getWhen(),
540 e.getModifiersEx() ^ toolkit.getMenuShortcutKeyMaskEx(),
541 e.getX(), e.getY(),
542 e.getXOnScreen(), e.getYOnScreen(),
543 e.getClickCount(),
544 e.isPopupTrigger(),
545 MouseEvent.NOBUTTON);
546 MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
547 meAccessor.setCausedByTouchEvent(newEvent,
548 meAccessor.isCausedByTouchEvent(e));
549 e = newEvent;
550 }
551 super.processMouseEvent(e);
552 }
553 };
554 }
555
556 /**
557 * Configures the list which is used to hold the combo box items in the
558 * popup. This method is called when the UI class
559 * is created.
560 *
|