Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2008-03-10 05:28:35 -0400
committerAnton Leherbauer2008-03-10 05:28:35 -0400
commit1b48fddea143e4ecfe06daf4178be9a762de465a (patch)
tree2190988fd0b42e5e5c967a8fbcef45c35baa3025
parent3af3d6e3d97ee5625e9f62e1a33a10a3e35d223d (diff)
downloadorg.eclipse.cdt-1b48fddea143e4ecfe06daf4178be9a762de465a.tar.gz
org.eclipse.cdt-1b48fddea143e4ecfe06daf4178be9a762de465a.tar.xz
org.eclipse.cdt-1b48fddea143e4ecfe06daf4178be9a762de465a.zip
Fix 221858: [Project Explorer] Link with editor does not work
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorLinkHelper.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorLinkHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorLinkHelper.java
index 912a2d5979b..9438c524169 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorLinkHelper.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorLinkHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
* 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
@@ -22,6 +22,7 @@ import org.eclipse.ui.navigator.ILinkHelper;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
@@ -62,6 +63,8 @@ public class CNavigatorLinkHelper implements ILinkHelper {
if (file != null && CoreModel.hasCNature(file.getProject())) {
element= CoreModel.getDefault().create(file);
}
+ } else {
+ element= ((IWorkingCopy) element).getOriginalElement();
}
return (element != null) ? new StructuredSelection(element) : StructuredSelection.EMPTY;
}

Back to the top