Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Saving additional resources
Saving additional resources [message #220401] Mon, 02 March 2009 21:13 Go to next message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
Hello
I've got a standard diagram editor - generated from Ecore model. When I
load some resources into it, like other referencing diagrams they are
correctly saved, and loaded after document reopening.

However if I load anything other - let's say some custom xml file, it is
not saved with the file. How can I force that behavior, as I am using data
from that xml file in some fields, and there are NullPointerExceptions'
after opening diagram without those files loaded into ResourceSet.

Marcin
Re: Saving additional resources [message #220945 is a reply to message #220401] Tue, 10 March 2009 13:54 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Marcin,

This sournds really strange - all referenced resources should be automatically
loaded by EMF on first call of the corresponding getter method..
Are you sure the references was properly stored (can you load this model
file using standard EMF-generated tree editor without any exceptions)?

-----------------
Alex Shatalin
Re: Saving additional resources [message #221587 is a reply to message #220945] Mon, 16 March 2009 20:40 Go to previous messageGo to next message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
Alex Shatalin wrote:

Hello

> This sournds really strange - all referenced resources should be
automatically
> loaded by EMF on first call of the corresponding getter method..
> Are you sure the references was properly stored (can you load this model
> file using standard EMF-generated tree editor without any exceptions)?

It opens ok. The attributes for which values were selected from those XML
files are displayed as text. No reference is stored.

What I've done was implementing custom cell editor for one of object's
properties. I've followed
http://www.jevon.org/wiki/Using_EDataTypes_in_GMF, I scan through the
resourceSet and if find appropriate files I fetch data from them into
created in this way cell editors.

Am I handling this scenerio correctly? None of the objects have any link
to the external resource's. I only use text representation of some data
from that XML files.

Any help would be appreciated :)

Marcin
Re: Saving additional resources [message #221640 is a reply to message #221587] Tue, 17 March 2009 11:02 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Marcin,

> It opens ok. The attributes for which values were selected from those
> XML files are displayed as text. No reference is stored.
If you sture only textual representation of the attribute values then you
have to manually load "used" files on any GMF editor loading (in this case
I suppose EMF-generated editor will forget about such a resources as well).
If you'd like to automate this process then you can store reference instead
of just string representation and in this case "used" files will be loaded
automatically by EMF.

> Am I handling this scenerio correctly? None of the objects have any
I think it make sence to ask an author of this article about it.

-----------------
Alex Shatalin
Re: Saving additional resources [message #221648 is a reply to message #221640] Tue, 17 March 2009 11:32 Go to previous messageGo to next message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
Alex Shatalin wrote:

Hello

> If you sture only textual representation of the attribute values then you
> have to manually load "used" files on any GMF editor loading (in this case
> I suppose EMF-generated editor will forget about such a resources as well).
> If you'd like to automate this process then you can store reference instead
> of just string representation and in this case "used" files will be loaded
> automatically by EMF.

Well, it sound's like something I need to do. Could You point me to some
docs about storing xml references in emf model? Do I have to make that
field an EReference and how to define the connection correctly?

> I think it make sence to ask an author of this article about it.

Well, his intend was not to persist any files' references. He only needed
different cell editor - file system browser, namely.

Marcin
Re: Saving additional resources [message #221673 is a reply to message #221648] Tue, 17 March 2009 13:42 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Marcin,

> Well, it sound's like something I need to do. Could You point me to
> some docs about storing xml references in emf model? Do I have to make
> that field an EReference and how to define the connection correctly?
Right - just use EReference with appropriate type and set value of EReference
to point to the target model element.

-----------------
Alex Shatalin
Previous Topic:Restrict properties in diagram editor.
Next Topic:How to make one forced on a link?
Goto Forum:
  


Current Time: Mon Sep 23 02:19:01 GMT 2024

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

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

Back to the top