aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2017-10-12 10:51:48 -0400
committerShuai Li2017-10-17 09:21:41 -0400
commitd2b13fa76fb7eb6404aefc3ce7994566da910b76 (patch)
treec085670354ec95f6d082c82240751fc61461f2f0
parent2f14e1028d8448bd654024a256256b154a53d6e5 (diff)
downloadorg.eclipse.papyrus-d2b13fa76fb7eb6404aefc3ce7994566da910b76.zip
org.eclipse.papyrus-d2b13fa76fb7eb6404aefc3ce7994566da910b76.tar.gz
org.eclipse.papyrus-d2b13fa76fb7eb6404aefc3ce7994566da910b76.tar.xz
Bug 516459 - [Diagram] Navigation mechanism with Alt+hover does not work on Linux
- Change key from ALT to CTRL+SHIFT to avoid key-binding conflict on Linux machine. - Restore original behavior that the menu is only visible while the key is pressed - Delay menu appeareance until mouse is mouved in both graphical viewer and model explorer. This avoids key-binding conflichts with CTRL+SHIFT-C/X/V for graphical copy/paste - The menu goes away on the first click outside its area (and does not come back again while CTRL is pressed). - Simplify programming, since activation in graphical editor and model explorer is much more similar. Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr> Change-Id: I23667f92ea258c77c2f4cfe0e8902bae44ee5f83
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/editpolicy/NavigationEditPolicy.java24
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/DefaultNavigationMenu.java99
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/listener/NavigationMenuKeyListener.java6
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationMenu.java71
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java82
5 files changed, 165 insertions, 117 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/editpolicy/NavigationEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/editpolicy/NavigationEditPolicy.java
index 97fd218..129a5eb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/editpolicy/NavigationEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/editpolicy/NavigationEditPolicy.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2017 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,8 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Shuai Li (CEA LIST) shuai.li@cea.fr - Selection menu modifications
+ * Ansgar Radermacher (CEA LIST) - Bug 516459: Navigation mechanism with Alt+hover does not work on Linux
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.navigation.editpolicy;
@@ -26,6 +28,8 @@ import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
import org.eclipse.papyrus.infra.gmfdiag.navigation.Activator;
import org.eclipse.papyrus.infra.services.navigation.service.NavigationMenu;
import org.eclipse.papyrus.infra.services.navigation.service.NavigationService;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Shell;
/**
@@ -60,6 +64,13 @@ public class NavigationEditPolicy extends GraphicalEditPolicy {
if (navigationMenu != null) {
navigationMenu.setServicesRegistry(registry);
navigationMenu.setParentShell(parentShell);
+ // quit menu, if click outside
+ viewer.getControl().addMouseListener(new MouseAdapter() {
+
+ public void mouseDown(MouseEvent e) {
+ navigationMenu.exitItem();
+ }
+ });
}
} catch (ServiceException e) {
Activator.log.error(e);
@@ -87,14 +98,15 @@ public class NavigationEditPolicy extends GraphicalEditPolicy {
if (request instanceof SelectionRequest) {
SelectionRequest selectionRequest = (SelectionRequest) request;
- EditPart targetEditPart = getHost().getViewer().findObjectAt(selectionRequest.getLocation());
-
- if (navigationMenu.willEnter(selectionRequest, targetEditPart)) {
+ if (navigationMenu.willEnter(selectionRequest, null)) {
+ EditPart targetEditPart = getHost().getViewer().findObjectAt(selectionRequest.getLocation());
prependNavigationMenuItem();
appendNavigationMenuItem();
+ navigationMenu.handleRequest(selectionRequest, targetEditPart);
+ }
+ else {
+ navigationMenu.exitItem();
}
-
- navigationMenu.handleRequest(selectionRequest, targetEditPart);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/DefaultNavigationMenu.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/DefaultNavigationMenu.java
index 8b6c568..ee2407e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/DefaultNavigationMenu.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/DefaultNavigationMenu.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
+* Copyright (c) 2015, 2017 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Ansgar Radermacher (CEA LIST) - Bug 516459: Navigation mechanism with Alt+hover does not work on Linux
*
*****************************************************************************/
@@ -30,7 +31,7 @@ import org.eclipse.papyrus.infra.core.services.ServiceNotFoundException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.navigation.Activator;
-import org.eclipse.papyrus.infra.gmfdiag.navigation.menu.listener.SelectionMenuMouseTrackListener;
+import org.eclipse.papyrus.infra.gmfdiag.navigation.menu.listener.NavigationMenuKeyListener;
import org.eclipse.papyrus.infra.gmfdiag.navigation.menu.listener.SelectionMenuSelectionChangedListener;
import org.eclipse.papyrus.infra.gmfdiag.navigation.menu.provider.SelectionMenuLabelProvider;
import org.eclipse.papyrus.infra.services.navigation.service.ExtendedNavigableElement;
@@ -43,10 +44,7 @@ import org.eclipse.papyrus.infra.services.viewersearch.impl.ViewerSearchService;
import org.eclipse.papyrus.infra.widgets.editors.SelectionMenu;
import org.eclipse.papyrus.infra.widgets.providers.CollectionContentProvider;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TreeItem;
@@ -108,12 +106,14 @@ public class DefaultNavigationMenu implements NavigationMenu {
/**
* handle requests from graphical editor
+ * @Deprecated since 2.1.0, since handling is now uniform for graphical editor and model explorer
*
* @param request
* a selection request
* @param targetEditPart
* the selected edit part
*/
+ @Deprecated
public void handleRequest(SelectionRequest request, EditPart targetEditPart) {
if (targetEditPart != null) {
EObject model = EMFHelper.getEObject(targetEditPart);
@@ -130,12 +130,15 @@ public class DefaultNavigationMenu implements NavigationMenu {
/**
* handle request from model explorer
+ * @Deprecated since 2.1.0, since handling is now uniform for graphical editor and model explorer
*
* @param e
* a mouse event
* @param treeItem
* the tree item within the model explorer
+ *
*/
+ @Deprecated
public void handleRequest(MouseEvent e, TreeItem treeItem) {
if (treeItem != null) {
EObject model = EMFHelper.getEObject(treeItem.getData());
@@ -150,27 +153,22 @@ public class DefaultNavigationMenu implements NavigationMenu {
}
}
+ /**
+ * @deprecated since 2.1.0, since exit state only depends on model
+ */
@Deprecated
protected boolean isExitState(SelectionRequest request, EObject model) {
return isExitState(model);
}
protected boolean isExitState(EObject model) {
- if (currentModel == null) {
- return false;
- }
-
- if (model == null) {
- return true;
- }
-
- if (model != currentModel) {
- return true;
- }
-
- return false;
+ return currentModel != model || model == null;
}
+ /**
+ * @deprecated since 2.1.0, since enter state only depends on model
+ */
+ @Deprecated
protected boolean isEnterState(SelectionRequest request, EObject model) {
if (!request.isAltKeyPressed()) {
return false;
@@ -179,6 +177,10 @@ public class DefaultNavigationMenu implements NavigationMenu {
return isEnterState(model);
}
+ /**
+ * @deprecated since 2.1.0, since enter state only depends on model
+ */
+ @Deprecated
protected boolean isEnterState(MouseEvent e, EObject model) {
if ((e.stateMask & SWT.ALT) == 0) {
return false;
@@ -188,7 +190,7 @@ public class DefaultNavigationMenu implements NavigationMenu {
}
protected boolean isEnterState(EObject model) {
- if (model == currentModel) {
+ if (currentModel != null) {
return false;
}
@@ -201,6 +203,7 @@ public class DefaultNavigationMenu implements NavigationMenu {
return true;
}
+ @Deprecated
public boolean willEnter(SelectionRequest request, EditPart targetEditPart) {
EObject model = null;
if (targetEditPart != null) {
@@ -212,14 +215,6 @@ public class DefaultNavigationMenu implements NavigationMenu {
}
public boolean willEnter(EObject model) {
- if (model == currentModel) {
- return false;
- }
-
- if (model == null) {
- return false;
- }
-
return true;
}
@@ -313,33 +308,7 @@ public class DefaultNavigationMenu implements NavigationMenu {
}
selectionMenu.addSelectionChangedListener(new SelectionMenuSelectionChangedListener(DefaultNavigationMenu.this, selectionMenu, navigationMenuElements, umlElement, subMenus));
- selectionMenu.getTableViewer().getTable().addFocusListener(new FocusListener() {
-
- int focusGainedAt = 0;
-
- public void focusLost(FocusEvent e) {
- // The columnViewer of the model explorer has a tooltip that can be shown during the first 100ms
- // after a selection. It will cause a focus lost on the menu. In this case, make sure to set
- // focus to the menu again.
- if (e.time - focusGainedAt < 100) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- // set focus again to get a new focus lost event
- selectionMenu.getTableViewer().getTable().setFocus();
- }
- });
- }
- else {
- exitItem();
- }
- }
-
- public void focusGained(FocusEvent e) {
- focusGainedAt = e.time;
- }
- });
-
+ selectionMenu.addKeyListener(new NavigationMenuKeyListener(this));
// selectionMenu.addMouseTrackListener(new SelectionMenuMouseTrackListener(DefaultNavigationMenu.this, selectionMenu, subMenus, umlElement));
}
@@ -517,12 +486,14 @@ public class DefaultNavigationMenu implements NavigationMenu {
* @param target
*/
public void handleRequest(Object request, Object target) {
- if (request instanceof SelectionRequest && target instanceof EditPart) {
- handleRequest((SelectionRequest) request, (EditPart) target);
+ EObject model = EMFHelper.getEObject(target);
+
+ if (isExitState(model)) {
+ exitItem();
}
- if (request instanceof MouseEvent && target instanceof TreeItem) {
- handleRequest((MouseEvent) request, (TreeItem) target);
+ if (isEnterState(model)) {
+ enterItem(target);
}
}
@@ -534,11 +505,14 @@ public class DefaultNavigationMenu implements NavigationMenu {
* @return
*/
public boolean willEnter(Object request, Object target) {
- if (request instanceof SelectionRequest && target instanceof EditPart) {
- return willEnter((SelectionRequest) request, (EditPart) target);
+ int modifierKeys = SWT.NONE;
+ if (request instanceof SelectionRequest) {
+ modifierKeys = ((SelectionRequest) request).getModifiers();
}
-
- return false;
+ else if (request instanceof MouseEvent) {
+ modifierKeys = ((MouseEvent) request).stateMask;
+ }
+ return (modifierKeys == SWT.CONTROL + SWT.SHIFT);
}
/**
@@ -599,6 +573,7 @@ public class DefaultNavigationMenu implements NavigationMenu {
*/
public void setParentShell(Shell parentShell) {
this.parentShell = parentShell;
+
}
@Deprecated
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/listener/NavigationMenuKeyListener.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/listener/NavigationMenuKeyListener.java
index 7162cc6..0c9acec 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/listener/NavigationMenuKeyListener.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/menu/listener/NavigationMenuKeyListener.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
+ * Copyright (c) 2015, 2017 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Ansgar Radermacher (CEA LIST) - Bug 516459: Navigation mechanism with Alt+hover does not work on Linux
*
*****************************************************************************/
@@ -39,8 +40,7 @@ public class NavigationMenuKeyListener implements KeyListener {
}
public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.ALT) {
- navigationMenu.altReleased();
+ if (e.keyCode == SWT.CONTROL || e.keyCode == SWT.SHIFT) {
navigationMenu.exitItem();
}
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationMenu.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationMenu.java
index 6a6c87d..55c51d6 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationMenu.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationMenu.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
+ * Copyright (c) 2015, 2017 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Shuai Li (CEA LIST) <shuai.li@cea.fr> - Initial API and implementation
+ * Ansgar Radermacher (CEA LSIT) - comments, deprecating altReleased()
*
*****************************************************************************/
@@ -18,14 +19,82 @@ import java.util.List;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.swt.widgets.Shell;
+/**
+ * super class for all navigation menu implementations
+ */
public interface NavigationMenu {
+ /**
+ * handle requests
+ *
+ * @param request
+ * a request (currently SelectionRequest or MouseEvent)
+ * @param target
+ * the target object
+ */
public void handleRequest(Object request, Object target);
+
+ /**
+ * @param request
+ * the request
+ * @param target
+ * the target object - can currently be null, i.e. test is mainly
+ * done with respect to the request. This avoids that time is spend to
+ * calculate the target object even if the entry condition with respect to the request is false
+ * @return true, if request object would imply opening a menu
+ */
public boolean willEnter(Object request, Object target);
+
+ /**
+ * Close the navigation menu, if it was open (can be called, if menu
+ * is already closed)
+ */
public void exitItem();
+
+ /**
+ * Execute a navigation request. It will typically return a command
+ *
+ * @param request
+ * a request that identifies the current selection
+ * @param host
+ * A host element, such as a tree item or an edit part
+ * @return the navigation command
+ */
public Object navigate(Object request, Object host);
+
+ /**
+ * Get menu items that should be appended to the menu
+ *
+ * @return a list of menu items
+ */
+
public List<Object> getAppendObjects();
+
+ /**
+ * Get menu items that should be prepended to the menu
+ *
+ * @return a list of menu items
+ */
+
public List<Object> getPrependObjects();
+
+ /**
+ * Pass a reference to the service registry
+ *
+ * @param registry
+ * the service registry
+ */
public void setServicesRegistry(ServicesRegistry registry);
+
+ /**
+ * pass a reference to the parent shell of the navigation menu
+ *
+ * @param parentShell
+ */
public void setParentShell(Shell parentShell);
+
+ /**
+ * @deprecated No longer required since release 2.1.0
+ */
+ @Deprecated
public void altReleased();
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
index a164356..42cf048 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2010, 2016, 2017 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -13,6 +13,7 @@
* Christian W. Damus - bugs 450235, 451683, 485220
* Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Bug 497289, 455241
* Mickaƫl ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500290: implement new filter and ignore case Check button
+ * Ansgar Radermacher (CEA LIST) - Bug 516459: Navigation mechanism with Alt+hover does not work on Linux
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer;
@@ -104,7 +105,7 @@ import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -116,7 +117,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
@@ -550,6 +550,36 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
viewer.setLabelProvider(labelProvider); // add for decorator and tooltip support
}
+ /**
+ * Listener handling the activation of the navigation menu as well as exit if user clicks outside
+ */
+ public class MenuListener extends MouseAdapter implements MouseMoveListener {
+
+ // @Override
+ public void mouseMove(MouseEvent mouseEvent) {
+ if (navigationMenu != null) {
+ if (navigationMenu.willEnter(mouseEvent, null)) {
+ TreeItem treeItem = getTreeItem(mouseEvent);
+ if (treeItem != null) {
+ navigationMenu.handleRequest(mouseEvent, treeItem.getData());
+ }
+ }
+ else {
+ navigationMenu.exitItem();
+ }
+ }
+ }
+
+ /**
+ * exit navigation menu on click (avoids that menu remains open, if user clicks outside
+ */
+ public void mouseDown(MouseEvent mouseEvent) {
+ if (navigationMenu != null) {
+ navigationMenu.exitItem();
+ }
+ }
+ }
+
@Override
public void createPartControl(Composite aParent) {
super.createPartControl(aParent);
@@ -577,47 +607,9 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
Tree tree = getCommonViewer().getTree();
- tree.addKeyListener(new KeyListener() {
-
- @Override
- public void keyReleased(KeyEvent e) {
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- if (e.keyCode != SWT.ALT) {
- return;
- }
-
- if (navigationMenu != null) {
- Tree tree = getCommonViewer().getTree();
-
- // Generate a basic mouse event
- Event event = new Event();
- event.widget = tree;
- event.stateMask = SWT.ALT;
-
- Point absoluteTreeLocation = tree.toDisplay(new Point(0, 0));
-
- event.x = tree.getDisplay().getCursorLocation().x - absoluteTreeLocation.x;
- event.y = tree.getDisplay().getCursorLocation().y - absoluteTreeLocation.y;
-
- MouseEvent mouseEvent = new MouseEvent(event);
- navigationMenu.handleRequest(mouseEvent, getTreeItem(mouseEvent));
- }
- }
- });
-
- tree.addMouseMoveListener(new MouseMoveListener() {
-
- @Override
- public void mouseMove(MouseEvent e) {
- if (navigationMenu != null) {
- navigationMenu.handleRequest(e, getTreeItem(e));
- }
- }
-
- });
+ MenuListener menuListener = new MenuListener();
+ tree.addMouseMoveListener(menuListener);
+ tree.addMouseListener(menuListener);
installEMFFacetTreePainter(tree);
try {
@@ -682,7 +674,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
filterText.setValidateOnDelay(getValidationDelay());
filterText.setValidateOnDelay(isFilterValidateOnDelay());
- // Key listener to focus in the treeviewer when presser arrow up key
+ // Key listener to focus the tree viewer when arrow-up key is pressed
filterText.getText().addKeyListener(new KeyAdapter() {
/**