Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Workspace Resource with EMF Objects
Workspace Resource with EMF Objects [message #841709] Wed, 11 April 2012 16:47 Go to next message
arthurembo Simo is currently offline arthurembo SimoFriend
Messages: 16
Registered: May 2011
Location: Germany
Junior Member
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 16:48]

Report message to a moderator

Re: Workspace Resource with EMF Objects [message #845610 is a reply to message #841709] Sun, 15 April 2012 08:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Workspace Resource with EMF Objects [message #845953 is a reply to message #841709] Sun, 15 April 2012 15:42 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

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 14:44 Go to previous message
arthurembo Simo is currently offline arthurembo SimoFriend
Messages: 16
Registered: May 2011
Location: Germany
Junior Member
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: Thu Apr 25 19:50:02 GMT 2024

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

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

Back to the top