[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Using CompilationUnitEditor without a .java file?

David Coppit wrote:

Daniel Megert wrote:

I'm implementing an editor for Java source code, where the source is unpacked from another file. As a result, there is no .java resource in the project. Can someone give me some guidance on how best to set up a CompilationUnitEditor to code from a buffer in memory?


It should be sufficient to write your own editor input and then use IDE.openEditor(page, editorInput, editorID). What stopped this from working?


My editor is being opened in a page of a MultiPageEditor. openEditor is for a top-level editor. I did try what you suggested anyway, and I did get syntax highlighting, but not the annotations ruler.

Which build did you use?

Dani


So I gave up on an in-memory editor input. Now I create temporary files in the workspace, and that seems to work well. I'll end up filtering them out of the workspace view so that the user doesn't notice.


David