Skip to main content



      Home
Home » Modeling » EMF » Workspace Resource with EMF Objects
Workspace Resource with EMF Objects [message #841709] Wed, 11 April 2012 12:47 Go to next message
Eclipse UserFriend
Hi,

I have the following problem. I want to add emf objects, that I created to my viewer. I use the common navigator framework. So I create my own project in the CNF in this form:

1 TProject
11 Folder 1
111 element1
112 element2
...
12 Folder 2

Project, folder and files are really resources on my file system. Now I need sometimes like that after the elements:

...
11 Folder 1
111 element1
1111 EMF Object Instance1
1112 EMF object Instance2
....
112 element2
....

I created the EMF Model and generated the model and edit plugins. I created navigator content with one trigger: the workspace root.

1) How can I tell to my contentprovider, that at element1, It must add EMF objects, that I created?, or I need to add a new navigator content for the same contentprovider?.

2) How can I tell to my navigator, that it must use the xyzItemProvider to display at element1 position EMF Objects?

Note that in my project 1 file corresponds to one EMF objects, that means I created the EMF Objects programmatically, when I get the file in the project.

Thanks
Boris S.

[Updated on: Wed, 11 April 2012 12:48] by Moderator

Re: Workspace Resource with EMF Objects [message #845610 is a reply to message #841709] Sun, 15 April 2012 04:10 Go to previous messageGo to next message
Eclipse UserFriend
I'm not familiar with how to integrate with CNF. Maybe someone else has
experience with that.


On 11/04/2012 6:47 PM, arthurembo Simo wrote:
> Hi,
>
> I have the following problem. I want to add emf objects, that I
> created to my viewer. I use the common navigator framework. So I
> create my own project in the CNF in this form:
>
> -> TProject
> -> Folder 1
> -> element1
> -> element2
> ...
> -> Folder 2
> Project, folder and files are really resources on my file system.
> Now I need sometimes like that after the elements:
>
> ...
> -> Folder 1
> -> element1
> -> EMF Object Instance1
> -> EMF object Instance2
> ....
> -> element2
> ....
>
> I created the EMF Model and generated the model and edit plugins. I
> created navigator content with one trigger: the workspace root.
>
> 1) How can I tell to my contentprovider, that at element1, It must add
> EMF objects, that I created?, or I need to add a new navigator content
> for the same contentprovider?.
>
> 2) How can I tell to my navigator, that it must use the
> xyzItemProvider to display at element1 position EMF Objects?
> Note that in my project 1 file corresponds to one EMF objects, that
> means I created the EMF Objects programmatically, when I get the file
> in the project.
>
> Thanks
> Boris S.
Re: Workspace Resource with EMF Objects [message #845953 is a reply to message #841709] Sun, 15 April 2012 11:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Boris,

I think that GMF-generated editors can integrate EMF resource contents
into the Common Navigator. You might check, there. At any rate, I'm
fairly certain that the MDT Papyrus project can serve an example.

HTH,

Christian


On 2012-04-11 16:47:38 +0000, arthurembo Simo said:

> Hi,
>
> I have the following problem. I want to add emf objects, that I created
> to my viewer. I use the common navigator framework. So I create my own
> project in the CNF in this form:
>
> -> TProject
> -> Folder 1
> -> element1
> -> element2
> ...
> -> Folder 2
> Project, folder and files are really resources on my file system.
> Now I need sometimes like that after the elements:
> ...
> -> Folder 1
> -> element1
> -> EMF Object Instance1
> -> EMF object Instance2
> ....
> -> element2
> ....
>
> I created the EMF Model and generated the model and edit plugins. I
> created navigator content with one trigger: the workspace root.
>
> 1) How can I tell to my contentprovider, that at element1, It must add
> EMF objects, that I created?, or I need to add a new navigator content
> for the same contentprovider?.
>
> 2) How can I tell to my navigator, that it must use the xyzItemProvider
> to display at element1 position EMF Objects?
> Note that in my project 1 file corresponds to one EMF objects, that
> means I created the EMF Objects programmatically, when I get the file
> in the project.
>
> Thanks
> Boris S.
Re: Workspace Resource with EMF Objects [message #851000 is a reply to message #845953] Fri, 20 April 2012 10:44 Go to previous message
Eclipse UserFriend
I found how to do it. The content provider of my Common navigator must extend the class AdapterFactoryContentProvider instead to implement the ItreeContentProvider, because the class AdapterFactoryContentProvider implements already the ItreeContentProvider Interface and it knows how to handle the generated EMF Itemproviders. So I can mix workspace resources files or folders with emf instances in my content providers with the getchildren() methods. Very Happy

Thanks!
Previous Topic:[SOLVED] CDO saving eDate as TIMESTAMP in MySQL
Next Topic:eFactory does not create the right boolean
Goto Forum:
  


Current Time: Mon Jul 14 09:01:58 EDT 2025

Powered by FUDForum. Page generated in 0.03952 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top