IDocument cannot be resolved for type
I am very new to eclipse devalopment plugin and I want to get content from editor using eclipse plugin so I found this answer .
But the problem is I am getting compilation error IDocument cannot be resolved to a type
. No quick import imports. My Eclipse version is 3.8.2.
How can I fix this problem?
The code I used (from the linked answer) is the following:
public String getCurrentEditorContent() {
final IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
if (activeEditor == null)
return null;
final IDocument doc = (IDocument) activeEditor.getAdapter(IDocument.class);
if (doc == null) return null;
return doc.get();
}
I cannot find it org.eclipse.jface.text
among my dependencies. Here's a snapshot:
+3
source to share