tmf.ui: Convert EventsTable Listener into Lambda
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 29 Jun 2016 15:24:51 +0000 (11:24 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 8 Jul 2016 20:29:03 +0000 (16:29 -0400)
This converts the listener from a generic one to a
menudetectlistener with a lambda.

Change-Id: Id26dce3dfa6031919a4d2cfdfe16fe3da7305af2
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/76341
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java

index dd863abdba364703022a8532a7ea43e93330c62b..62ee7b0b5c294521936904fdc44afa23aa03d046 100644 (file)
@@ -903,15 +903,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         // Handle the table item requests
         fTable.addListener(SWT.SetData, new SetDataListener());
 
-        fTable.addListener(SWT.MenuDetect, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                fLastMenuCursorLocation = new Point(event.x, event.y);
-                Point pt = fTable.getDisplay().map(null, fTable, fLastMenuCursorLocation);
-                Rectangle clientArea = fTable.getClientArea();
-                boolean header = clientArea.y <= pt.y && pt.y < (clientArea.y + fTable.getHeaderHeight());
-                fTable.setMenu(header ? fHeaderMenu : fTablePopup);
-            }
+        fTable.addMenuDetectListener( event -> {
+            fLastMenuCursorLocation = new Point(event.x, event.y);
+            Point pt = fTable.getDisplay().map(null, fTable, fLastMenuCursorLocation);
+            Rectangle clientArea = fTable.getClientArea();
+            boolean header = clientArea.y <= pt.y && pt.y < (clientArea.y + fTable.getHeaderHeight());
+            fTable.setMenu(header ? fHeaderMenu : fTablePopup);
         });
 
         fTable.addMouseListener(new MouseDoubleClickListener());
This page took 0.026848 seconds and 5 git commands to generate.