|Syntax Coloring for a Non-File based Editor [message #336137]
||Tue, 26 May 2009 07:30
Originally posted by: pajai.extrabright.com|
I am trying to get the syntax coloring working when setting an editor's
content programmatically (for an existing editor, e.g. the Java one),
but I have not come to a solution until now. I am not able to set the
content type programmatically. The syntax coloring appears to work only
when opening a file which extension is defined in the
org.eclipse.ui.editors extension point.
What I am doing until now:
- define MyEditorInput extending IEditorInput
- define MyDocumentProvider extending AbstractDocumentProvider and
override createDocument, where I return a Document with the content I
want if getting a parameter of type MyEditorInput. (I tried to override
the method getContentType(Object), but it is never called.)
- Open the Java editor programmatically with my custom input.
Anyone has an idea what I should do for the syntax coloring to work or
how I can set the content type programmatically?
Thanks in advance.
Powered by FUDForum
. Page generated in 0.03646 seconds