< prev index next >

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/JfrOutlinePage.java

Print this page

        

@@ -48,11 +48,10 @@
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerDropAdapter;
 import org.eclipse.swt.SWT;

@@ -323,10 +322,16 @@
                 ab.getMenuManager().add(createNewPageMenuManager());
                 ab.getToolBarManager().add(PAGE_STRUCTURE_LOCK_ACTION);
                 ab.getToolBarManager().add(RESET_ALL_PAGES_ACTION);
 
                 getTreeViewer().addDoubleClickListener(e -> expandSelected());
+                getTreeViewer().addPostSelectionChangedListener((event) -> {
+                        Object selected = (((IStructuredSelection) event.getSelection()).getFirstElement());
+                        if (selected != null) {
+                                editor.navigateTo((DataPageDescriptor) selected);
+                        }
+                });
 
                 ColumnViewerToolTipSupport.enableFor(getTreeViewer());
 
                 getTreeViewer().addDragSupport(DND_OPERATIONS, DND_TRANSFER, new OutlineDragListener());
                 getTreeViewer().addDropSupport(DND_OPERATIONS, DND_TRANSFER, new OutlineDropListener(getTreeViewer()));

@@ -441,18 +446,10 @@
                         getTreeViewer().setExpandedState(selected, !getTreeViewer().getExpandedState(selected));
                 }
         }
 
         @Override
-        public void selectionChanged(SelectionChangedEvent event) {
-                Object selected = (((IStructuredSelection) event.getSelection()).getFirstElement());
-                if (selected != null) {
-                        editor.navigateTo((DataPageDescriptor) selected);
-                }
-        }
-
-        @Override
         protected int getTreeStyle() {
                 return SWT.VIRTUAL | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER;
         }
 
         @Override
< prev index next >