1 /*******************************************************************************
2 * Copyright (c) 2000, 2017 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.events;
18 * This adapter class provides default implementations for the
19 * methods described by the <code>MouseTrackListener</code> interface.
21 * Classes that wish to deal with <code>MouseEvent</code>s which
22 * occur as the mouse pointer passes (or hovers) over controls can
23 * extend this class and override only the methods which they are
27 * An alternative to this class are the static helper methods
28 * {@link MouseTrackListener#mouseEnterAdapter(java.util.function.Consumer)},
29 * {@link MouseTrackListener#mouseExitAdapter(java.util.function.Consumer)}
31 * {@link MouseTrackListener#mouseHoverAdapter(java.util.function.Consumer)},
32 * which accept a lambda expression or a method reference that implements the event consumer.
35 * @see MouseTrackListener
37 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
39 public abstract class MouseTrackAdapter implements MouseTrackListener {
42 * Sent when the mouse pointer passes into the area of
43 * the screen covered by a control.
44 * The default behavior is to do nothing.
46 * @param e an event containing information about the mouse enter
49 public void mouseEnter(MouseEvent e) {
53 * Sent when the mouse pointer passes out of the area of
54 * the screen covered by a control.
55 * The default behavior is to do nothing.
57 * @param e an event containing information about the mouse exit
60 public void mouseExit(MouseEvent e) {
64 * Sent when the mouse pointer hovers (that is, stops moving
65 * for an (operating system specified) period of time) over
67 * The default behavior is to do nothing.
69 * @param e an event containing information about the hover
72 public void mouseHover(MouseEvent e) {