import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiAnalysisFactoryException;
import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiAnalysisFactoryFromConfigFile;
import org.eclipse.tracecompass.tmf.core.analysis.ondemand.OnDemandAnalysisManager;
+import org.eclipse.tracecompass.tmf.ui.project.handlers.HandlerUtils;
import org.eclipse.tracecompass.tmf.ui.project.model.TmfOnDemandAnalysesElement;
import org.eclipse.ui.PlatformUI;
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir, Philippe Proulx
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.handler;
-
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Utilities for UI handlers
- *
- * @author Philippe Proulx
- */
-public final class HandlerUtils {
-
- private HandlerUtils() {
- }
-
- /**
- * Get the current selected UI element. Can be used instead of
- * {@link org.eclipse.ui.handlers.HandlerUtil#getCurrentSelection} when an
- * ExecutionEvent is not available.
- *
- * @return The element consisting of the selection
- */
- public static @Nullable Object getSelectedModelElement() {
- // Check if we are closing down
- final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- return null;
- }
-
- // Get the selection
- final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- final IWorkbenchPart part = page.getActivePart();
- if (part == null) {
- return null;
- }
- final ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
- if (selectionProvider == null) {
- return null;
- }
- final ISelection selection = selectionProvider.getSelection();
-
- if (selection instanceof TreeSelection) {
- final TreeSelection sel = (TreeSelection) selection;
- // There should be only one item selected as per the plugin.xml
- return sel.getFirstElement();
- }
-
- return null;
- }
-
-}
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.ui.project.handlers.HandlerUtils;
import org.eclipse.tracecompass.tmf.ui.project.model.TmfCommonProjectElement;
import org.eclipse.tracecompass.tmf.ui.project.model.TmfOnDemandAnalysisElement;
import org.eclipse.tracecompass.tmf.ui.project.model.TmfReportsElement;
org.eclipse.tracecompass.tmf.ui.dialog,
org.eclipse.tracecompass.tmf.ui.editors,
org.eclipse.tracecompass.tmf.ui.markers,
+ org.eclipse.tracecompass.tmf.ui.project.handlers,
org.eclipse.tracecompass.tmf.ui.project.model,
org.eclipse.tracecompass.tmf.ui.project.wizards,
org.eclipse.tracecompass.tmf.ui.properties,
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir, Philippe Proulx
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.ui.project.handlers;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Utilities for UI handlers
+ *
+ * @author Philippe Proulx
+ * @since 2.3
+ */
+@NonNullByDefault
+public final class HandlerUtils {
+
+ private HandlerUtils() {
+ }
+
+ /**
+ * Get the current selected UI element. Can be used instead of
+ * {@link org.eclipse.ui.handlers.HandlerUtil#getCurrentSelection} when an
+ * ExecutionEvent is not available.
+ *
+ * @return The element consisting of the selection
+ */
+ public static @Nullable Object getSelectedModelElement() {
+ // Check if we are closing down
+ final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ return null;
+ }
+
+ // Get the selection
+ final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ final IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return null;
+ }
+ final ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
+ if (selectionProvider == null) {
+ return null;
+ }
+ final ISelection selection = selectionProvider.getSelection();
+
+ if (selection instanceof TreeSelection) {
+ final TreeSelection sel = (TreeSelection) selection;
+ // There should be only one item selected as per the plugin.xml
+ return sel.getFirstElement();
+ }
+
+ return null;
+ }
+
+}