| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.components; |
| | |
| | | * browser, index browser or the LDAP entries browser). It renders in a |
| | | * different manner than the default tree (selection takes the whole width |
| | | * of the tree, in a similar manner as happens with trees in Mac OS). |
| | | * |
| | | */ |
| | | public class CustomTree extends JTree |
| | | { |
| | |
| | | private JPopupMenu popupMenu; |
| | | private final int MAX_ICON_HEIGHT = 18; |
| | | |
| | | /** |
| | | * Internal enumeration used to translate mouse events. |
| | | * |
| | | */ |
| | | /** Internal enumeration used to translate mouse events. */ |
| | | private enum NewEventType |
| | | { |
| | | MOUSE_PRESSED, MOUSE_CLICKED, MOUSE_RELEASED |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void paintComponent(Graphics g) |
| | | { |
| | | int[] selectedRows = getSelectionRows(); |
| | |
| | | MouseListener mouseListener = new MouseAdapter() |
| | | { |
| | | private boolean ignoreEvents; |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void mousePressed(MouseEvent ev) |
| | | { |
| | | if (ignoreEvents) |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void mouseReleased(MouseEvent ev) |
| | | { |
| | | if (ignoreEvents) |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void mouseClicked(MouseEvent ev) |
| | | { |
| | | if (ignoreEvents) |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addMouseListener(MouseListener mouseListener) |
| | | { |
| | | super.addMouseListener(mouseListener); |
| | |
| | | mouseListeners.add(mouseListener); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void removeMouseListener(MouseListener mouseListener) |
| | | { |
| | | super.removeMouseListener(mouseListener); |