summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBernd Hufmann2013-03-13 14:30:41 (EDT)
committer Bernd Hufmann2013-03-13 15:34:34 (EDT)
commit637f7bfbf526ba5fa86715900a0020e800b2258c (patch)
tree3fab21e23afbf0645152eb514a506aa3080e26c0
parent939021dfc60137afedc7f3a388deb24be47cba9c (diff)
downloadorg.eclipse.linuxtools-637f7bfbf526ba5fa86715900a0020e800b2258c.zip
org.eclipse.linuxtools-637f7bfbf526ba5fa86715900a0020e800b2258c.tar.gz
org.eclipse.linuxtools-637f7bfbf526ba5fa86715900a0020e800b2258c.tar.bz2
gdb trace: Improve executable selectionrefs/changes/11/11111/3
Change-Id: Id7f05a0611b81ffa7802a77c70e2ea8b5bbe6db2 Signed-off-by: Bernd Hufmann <bhufmann@gmail.com> Reviewed-on: https://git.eclipse.org/r/11111 Tested-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/project/handlers/SelectTraceExecutableHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/project/handlers/SelectTraceExecutableHandler.java b/lttng/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/project/handlers/SelectTraceExecutableHandler.java
index 3f85857..ce45bb8 100644
--- a/lttng/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/project/handlers/SelectTraceExecutableHandler.java
+++ b/lttng/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/project/handlers/SelectTraceExecutableHandler.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Patrick Tasse - Initial API and implementation
+ * Bernd Hufmann - Improved trace selection
*******************************************************************************/
package org.eclipse.linuxtools.internal.gdbtrace.ui.views.project.handlers;
@@ -30,7 +31,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
/**
- * Handler for the Select Trace Excecutable command
+ * Handler for the Select Trace Executable command
* @author Patrick Tasse
*/
public class SelectTraceExecutableHandler extends AbstractHandler {
@@ -38,6 +39,11 @@ public class SelectTraceExecutableHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShell(event);
+
+ // Get the selection before opening the dialog because otherwise the
+ // getCurrentSelection() call will always return null
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
SelectTraceExecutableDialog dialog = new SelectTraceExecutableDialog(shell);
dialog.open();
if (dialog.getReturnCode() != Window.OK) {
@@ -45,7 +51,6 @@ public class SelectTraceExecutableHandler extends AbstractHandler {
}
IPath tracedExecutable = dialog.getExecutablePath();
- ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
for (Object o : ((IStructuredSelection) selection).toList()) {
TmfTraceElement traceElement = (TmfTraceElement) o;