diff options
author | Roberto Oliveira | 2015-10-08 13:50:42 +0000 |
---|---|---|
committer | Wainer dos Santos Moschetta | 2015-10-15 15:11:15 +0000 |
commit | 762156ab9605074aef3d84454fd27012fad767a2 (patch) | |
tree | 7081d771397cbf0dfdd000d94e54eb6f5c20a83b /perf | |
parent | bed47fb6705fcd89712b51c3ceb0c58f67d1c911 (diff) | |
download | org.eclipse.linuxtools-762156ab9605074aef3d84454fd27012fad767a2.tar.gz org.eclipse.linuxtools-762156ab9605074aef3d84454fd27012fad767a2.tar.xz org.eclipse.linuxtools-762156ab9605074aef3d84454fd27012fad767a2.zip |
Bug 479344: Fix double click in line does not open source code in sync projects.
Change-Id: I7900322e20e96cc6f7db66ac59d22af32b32edcf
Signed-off-by: Roberto Oliveira <rdutra@linux.vnet.ibm.com>
Reviewed-on: https://git.eclipse.org/r/57716
Reviewed-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
Tested-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
Diffstat (limited to 'perf')
3 files changed, 28 insertions, 3 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java index 89062ceb75..425474143a 100644 --- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java +++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java @@ -18,6 +18,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.util.List; +import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -107,7 +108,6 @@ public class PerfPlugin extends AbstractUIPlugin { public static final String PERF_DEAFULT_OLD_STAT = "perf.old.stat"; //$NON-NLS-1$ public static final boolean DEBUG_ON = false; //Spew debug messages or not. - // The shared instance private static PerfPlugin plugin; @@ -126,6 +126,10 @@ public class PerfPlugin extends AbstractUIPlugin { // Current working directory private IPath curWorkingDir; + // The last profiled project + private IProject profiledProject; + + public TreeParent getModelRoot() { return _modelRoot; } @@ -256,4 +260,21 @@ public class PerfPlugin extends AbstractUIPlugin { }); } -} + /** + * Get the project to be profiled + * + * @return project + */ + public IProject getProfiledProject() { + return profiledProject; + } + + /** + * Set the project to be profiled + * + * @param project + */ + public void setProfiledProject(IProject project) { + profiledProject = project; + } +}
\ No newline at end of file diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java index d635c96c84..446f86f8c8 100644 --- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java +++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java @@ -88,6 +88,10 @@ public class PerfLaunchConfigDelegate extends AbstractCLaunchDelegate { try { ConfigUtils configUtils = new ConfigUtils(config); project = configUtils.getProject(); + + // Set the current project that will be profiled + PerfPlugin.getDefault().setProfiledProject(project); + // check if Perf exists in $PATH if (! PerfCore.checkPerfInPath(project)) { diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java index afd77bea74..f712fc8838 100644 --- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java +++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java @@ -47,7 +47,7 @@ public class PerfDoubleClickAction extends Action { // Open in editor PMLineRef line = (PMLineRef) obj; PMFile file = (PMFile) ((PMSymbol) line.getParent()).getParent(); - ProfileUIUtils.openEditorAndSelect(file.getPath(),Integer.parseInt(line.getName())); + ProfileUIUtils.openEditorAndSelect(file.getPath(),Integer.parseInt(line.getName()), PerfPlugin.getDefault().getProfiledProject()); } else if (obj instanceof PMFile) { PMFile file = (PMFile) obj; ProfileUIUtils.openEditorAndSelect(file.getName(), 1); |