|
|
Re: Associating EMF objects to an IProject [message #548765 is a reply to message #407000] |
Thu, 22 July 2010 22:26 |
Edward MacKerrow Messages: 7 Registered: July 2010 Location: Santa Fe, New Mexico |
Junior Member |
|
|
I have what I think is a similar question to Greg's. I have an EMF model that has an EObject named "MyProject", users are expected to create instances of "MyProject". At the moment this class contains slots of MyTasks (not YET Mylyn Tasks). My dream would be to have MyProject actually be an instance of IProject and MyTask actually be instances / extensions of Mylyn Tasks.
I am not sure how, or if I should (?), use EMF to create EMF objects that are implementations of IProject (so that I can use the Mylyn functionality directly on those Projects).
To be clear:
1) I have the IDE as my current EMF runtime target.
2) My EMF generated app runs fine, but the user creates a MyProject instance from the EMF Editor tree.
3) What I would really like though is that the User can create a new Project that is an Eclipse Project from the EMF Editor. Maybe I should just make a new Project wizard for my app outside of EMF (why not?).
4) But, ..., then I need to link other EMF generated objects to the project they are contained in. (Maybe I should just also do this "outside of EMF", that is generate all my EMF code as I do now, then edit the generated code to integrate with IProject)
Any suggestions or guidance is appreciated.
Thanks
Ed
|
|
|
Re: Associating EMF objects to an IProject [message #548770 is a reply to message #548765] |
Thu, 22 July 2010 22:34 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Ed,
Comments below.
Edward MacKerrow wrote:
> I have what I think is a similar question to Greg's. I have an EMF
> model that has an EObject named "MyProject", users are expected to
> create instances of "MyProject". At the moment this class contains
> slots of MyTasks (not YET Mylyn Tasks). My dream would be to have
> MyProject actually be an instance of IProject
That's not possible. IProject can't be implemented directly nor can its
implementation class be extended.
> and MyTask actually be instances / extensions of Mylyn Tasks.
> I am not sure how, or if I should (?), use EMF to create EMF objects
> that are implementations of IProject (so that I can use the Mylyn
> functionality directly on those Projects).
No you shouldn't try.
>
> To be clear:
> 1) I have the IDE as my current EMF runtime target.
>
> 2) My EMF generated app runs fine, but the user creates a MyProject
> instance from the EMF Editor tree.
>
> 3) What I would really like though is that the User can create a new
> Project that is an Eclipse Project from the EMF Editor. Maybe I
> should just make a new Project wizard for my app outside of EMF (why
> not?).
>
> 4) But, ..., then I need to link other EMF generated objects to the
> project they are contained in. (Maybe I should just also do this
> "outside of EMF", that is generate all my EMF code as I do now, then
> edit the generated code to integrate with IProject)
Generally you can look at any EObject's eResource().getURI(). From that
you can determine whether it is contained in the workspace
(platform:/resource) and you can determine the name of the project
containing it (the first segment after platform:/resource). You can then
look that name up in the IWorkspaceRoot.
>
> Any suggestions or guidance is appreciated.
>
> Thanks
> Ed
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03558 seconds