How do I get a reference to the current project in an Eclipse plugin?
- by Martin Doms
I'm creating an editor for Eclipse. Right now the editor fires up with the user creates a new file with the appropriate extension. My question is, how can I get a reference to the project in which the file resides? For example, say I have a workspace with 2 projects, P1 and P2. I right click P2 and create a new file, can I get a reference to P2 from this somehow?
Ultimately I need to reference the AST or Java Model of the project but even a String identifying the project would work.