How to get a link to the current project in the Eclipse plugin?

I am creating an editor for Eclipse. Now the editor starts with the user, creating a new file with the corresponding extension. My question is, how can I get a link to the project where the file is located? For example, let's say I have a workspace with two projects, P1 and P2. I press P2 and create a new file, can I get a link to P2 from this somehow?

Ultimately, I need to reference the AST or Java model of the project, but even a line identifying the project will work.

+3
source share
1 answer

I think the answer will be just IFile.getProject () will work ...

FileEditorInput init(), :

FileEditorInput fileInput = (FileEditorInput); . FileInput.getFile() getProject();

+5

Source: https://habr.com/ru/post/1741176/


All Articles