开发者

How do I get access to my java source model (from JDT) from a GEF editor?

I have a basic GEF editor where I want to use the model from the currently open/selected java source editor to display extra开发者_Go百科 information, but I can't figure out how to get access to java model from inside my editor.

Any ideas? I'm finding the Eclipse docs hard to navigate.


It is a hard job, as using the GEF editor the current editor is the GEF editor, not the Java one.

If you have the IResource representing the Java file to display, you can use the static methods of the JavaCore class to get the Java Model.

How to get the IResource: maybe you can iterate over the open editors, and select their input, and check whether its an IFileInput, etc., or listen to selection changes in the Package Explorer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜