Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-09-25 13:13:17 -0400
committerNathan Ridge2018-09-30 20:25:57 -0400
commit0593f0b3afe8b07b034356a4cd72891783e9f4c6 (patch)
tree79d96e00f886e89abd6ba77f415c33ee0fb4752a
parent467aab5559d4858e9e293c652f1860b77e362729 (diff)
downloadorg.eclipse.cdt-0593f0b3afe8b07b034356a4cd72891783e9f4c6.tar.gz
org.eclipse.cdt-0593f0b3afe8b07b034356a4cd72891783e9f4c6.tar.xz
org.eclipse.cdt-0593f0b3afe8b07b034356a4cd72891783e9f4c6.zip
Bug 539307 - Have Codan test suites open files in C editor, not Generic Editor
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanEditorUtility.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanEditorUtility.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanEditorUtility.java
index ee126c8a4b..b0dc6bf895 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanEditorUtility.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanEditorUtility.java
@@ -19,7 +19,6 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -34,6 +33,9 @@ import org.eclipse.ui.texteditor.ITextEditor;
* Utility tools to open editor and highlight the line
*/
public class CodanEditorUtility {
+
+ private static final String C_EDITOR_ID= "org.eclipse.cdt.ui.editor.CEditor"; //$NON-NLS-1$
+
/**
* @param fileUrl - file "url", like file:/tmp/a.c#22
* @throws PartInitException
@@ -87,8 +89,7 @@ public class CodanEditorUtility {
efile = (IFile) markerResource;
if (efile != null) {
IWorkbenchPage page = getActivePage();
- IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file);
- IEditorPart part = page.openEditor(new FileEditorInput(efile), desc.getId());
+ IEditorPart part = page.openEditor(new FileEditorInput(efile), C_EDITOR_ID);
return part;
}
File fileToOpen = new File(file);

Back to the top