문제

I have a basic GEF editor where I want to use the model from the currently open/selected java source editor to display extra 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top