void (int index, NavBarItem component) { //suppress it for a while //installDnD(index, component); installPopupHandler(component, index); ListenerUtil.addMouseListener(component, new MouseAdapter() { @Override public void mouseReleased(final MouseEvent e) { if (SystemInfo.isWindows) { click(e); } } @Override public void mousePressed(final MouseEvent e) { if (!SystemInfo.isWindows) { click(e); } } @Override public void mouseEntered(MouseEvent e) { if (e.isConsumed() || !ExperimentalUI.isNewUI()) return; NavBarItem item = getItem(index); if (item != null) { item.setMouseHover(true); repaint(); } e.consume(); } @Override public void mouseExited(MouseEvent e) { if (e.isConsumed() || !ExperimentalUI.isNewUI()) return; NavBarItem item = getItem(index); if (item != null) { item.setMouseHover(false); repaint(); } e.consume(); } private void click(final MouseEvent e) { if (e.isConsumed()) return; if (e.isPopupTrigger()) return; if (e.getClickCount() == 1) { ctrlClick(index); e.consume(); } else if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { requestSelectedItemFocus(); doubleClick(index); e.consume(); } } }); ListenerUtil.addKeyListener(component, new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getModifiers() == 0 && e.getKeyCode() == KeyEvent.VK_SPACE) { ctrlClick(index); myModel.setSelectedIndex(index); e.consume(); } } }); }