Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Editing the same instance of a model in two editors.
Editing the same instance of a model in two editors. [message #175727] Tue, 05 April 2005 22:40 Go to next message
Eclipse UserFriend
Originally posted by: Angel.Roman.prismtech.com

Hi Everyone,

When the user double clicks on a figure I launch another editor who's
main model is the model that the double clicked figure represents. In
the second editor I add objects to an EList contained in the model.
However, when I close the 2nd editor and double click on the figure
again, the elements I added to the EList do not appear there. I am
generating the Model via an Omondo class that has a 1 to -1 containment
relationship to another object.

pseudo code:

openEditor( myModel );

editor opens up sets the contents to myModel.

myModel.getElements().add(element1);

System.out.print(myModel.getElements().size()); //size increased by one

Next time i open the editor i verify that myModel is the same instance
as the one i added the element previously. However, the size of
myModel.getElements().size() is the same as before i added an element.
If I edit a property element via the property View the change is
observed on the first editor as well as any other time I open a second one.

Any ideas?

Thanks,
Angel
Re: Editing the same instance of a model in two editors. [message #175809 is a reply to message #175727] Wed, 06 April 2005 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Angel.Roman.prismtech.com

Angel Roman wrote:
> Hi Everyone,
>
> When the user double clicks on a figure I launch another editor who's
> main model is the model that the double clicked figure represents. In
> the second editor I add objects to an EList contained in the model.
> However, when I close the 2nd editor and double click on the figure
> again, the elements I added to the EList do not appear there. I am
> generating the Model via an Omondo class that has a 1 to -1 containment
> relationship to another object.
>
> pseudo code:
>
> openEditor( myModel );
>
> editor opens up sets the contents to myModel.
>
> myModel.getElements().add(element1);
>
> System.out.print(myModel.getElements().size()); //size increased by one
>
> Next time i open the editor i verify that myModel is the same instance
> as the one i added the element previously. However, the size of
> myModel.getElements().size() is the same as before i added an element.
> If I edit a property element via the property View the change is
> observed on the first editor as well as any other time I open a second one.
>
> Any ideas?
>
> Thanks,
> Angel
I tracked it down to the emf generated code removing the element
whenever an element already in the list was inserted into another EList.
Re: Editing the same instance of a model in two editors. [message #175920 is a reply to message #175727] Wed, 06 April 2005 20:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Why are you using EMF, what good is it for you?
What is Omondo, why are you using that?

Just some general questions since I am seeing a lot of EMF users
starting to be GEF users as well.

Thanks,


CL


Angel Roman wrote:
> Hi Everyone,
>
> When the user double clicks on a figure I launch another editor who's
> main model is the model that the double clicked figure represents. In
> the second editor I add objects to an EList contained in the model.
> However, when I close the 2nd editor and double click on the figure
> again, the elements I added to the EList do not appear there. I am
> generating the Model via an Omondo class that has a 1 to -1 containment
> relationship to another object.
>
> pseudo code:
>
> openEditor( myModel );
>
> editor opens up sets the contents to myModel.
>
> myModel.getElements().add(element1);
>
> System.out.print(myModel.getElements().size()); //size increased by one
>
> Next time i open the editor i verify that myModel is the same instance
> as the one i added the element previously. However, the size of
> myModel.getElements().size() is the same as before i added an element.
> If I edit a property element via the property View the change is
> observed on the first editor as well as any other time I open a second one.
>
> Any ideas?
>
> Thanks,
> Angel
Re: Editing the same instance of a model in two editors. [message #176778 is a reply to message #175920] Mon, 11 April 2005 22:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Angel.Roman.prismtech.com

CL [dnoyeb] Gilbert wrote:
> Why are you using EMF, what good is it for you?
> What is Omondo, why are you using that?
>
> Just some general questions since I am seeing a lot of EMF users
> starting to be GEF users as well.
>
> Thanks,
>
>
> CL
>
>
> Angel Roman wrote:
>
>> Hi Everyone,
>>
>> When the user double clicks on a figure I launch another editor who's
>> main model is the model that the double clicked figure represents. In
>> the second editor I add objects to an EList contained in the model.
>> However, when I close the 2nd editor and double click on the figure
>> again, the elements I added to the EList do not appear there. I am
>> generating the Model via an Omondo class that has a 1 to -1
>> containment relationship to another object.
>>
>> pseudo code:
>>
>> openEditor( myModel );
>>
>> editor opens up sets the contents to myModel.
>>
>> myModel.getElements().add(element1);
>>
>> System.out.print(myModel.getElements().size()); //size increased by one
>>
>> Next time i open the editor i verify that myModel is the same instance
>> as the one i added the element previously. However, the size of
>> myModel.getElements().size() is the same as before i added an element.
>> If I edit a property element via the property View the change is
>> observed on the first editor as well as any other time I open a second
>> one.
>>
>> Any ideas?
>>
>> Thanks,
>> Angel

The use of EMF is due to the guidance of IBM's RedBook on GEF and EMF.
The use of omondo is due to me being able to design an EMF model
graphically and generate the source code for the emf model ( for free).

Regards,
Angel
Re: Editing the same instance of a model in two editors. [message #176802 is a reply to message #176778] Tue, 12 April 2005 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Angel Roman wrote:
> CL [dnoyeb] Gilbert wrote:
>
>> Why are you using EMF, what good is it for you?
>> What is Omondo, why are you using that?
>>
>> Just some general questions since I am seeing a lot of EMF users
>> starting to be GEF users as well.
>>
>> Thanks,
>>
>>
>> CL
>>
>>
>> Angel Roman wrote:
>>
>>> Hi Everyone,
>>>
>>> When the user double clicks on a figure I launch another editor who's
>>> main model is the model that the double clicked figure represents. In
>>> the second editor I add objects to an EList contained in the model.
>>> However, when I close the 2nd editor and double click on the figure
>>> again, the elements I added to the EList do not appear there. I am
>>> generating the Model via an Omondo class that has a 1 to -1
>>> containment relationship to another object.
>>>
>>> pseudo code:
>>>
>>> openEditor( myModel );
>>>
>>> editor opens up sets the contents to myModel.
>>>
>>> myModel.getElements().add(element1);
>>>
>>> System.out.print(myModel.getElements().size()); //size increased by one
>>>
>>> Next time i open the editor i verify that myModel is the same
>>> instance as the one i added the element previously. However, the size
>>> of myModel.getElements().size() is the same as before i added an
>>> element. If I edit a property element via the property View the
>>> change is observed on the first editor as well as any other time I
>>> open a second one.
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>> Angel
>
>
> The use of EMF is due to the guidance of IBM's RedBook on GEF and EMF.
> The use of omondo is due to me being able to design an EMF model
> graphically and generate the source code for the emf model ( for free).
>
> Regards,
> Angel


Nice!

Where is this IBM RedBook. I wonder if EMF would be any good for me?


CL
Re: Editing the same instance of a model in two editors. [message #177203 is a reply to message #176802] Tue, 12 April 2005 23:59 Go to previous message
Eclipse UserFriend
Originally posted by: Angel.Roman.prismtech.com

CL [dnoyeb] Gilbert wrote:
> Angel Roman wrote:
>
>> CL [dnoyeb] Gilbert wrote:
>>
>>> Why are you using EMF, what good is it for you?
>>> What is Omondo, why are you using that?
>>>
>>> Just some general questions since I am seeing a lot of EMF users
>>> starting to be GEF users as well.
>>>
>>> Thanks,
>>>
>>>
>>> CL
>>>
>>>
>>> Angel Roman wrote:
>>>
>>>> Hi Everyone,
>>>>
>>>> When the user double clicks on a figure I launch another editor
>>>> who's main model is the model that the double clicked figure
>>>> represents. In the second editor I add objects to an EList contained
>>>> in the model. However, when I close the 2nd editor and double click
>>>> on the figure again, the elements I added to the EList do not
>>>> appear there. I am generating the Model via an Omondo class that has
>>>> a 1 to -1 containment relationship to another object.
>>>>
>>>> pseudo code:
>>>>
>>>> openEditor( myModel );
>>>>
>>>> editor opens up sets the contents to myModel.
>>>>
>>>> myModel.getElements().add(element1);
>>>>
>>>> System.out.print(myModel.getElements().size()); //size increased by one
>>>>
>>>> Next time i open the editor i verify that myModel is the same
>>>> instance as the one i added the element previously. However, the
>>>> size of myModel.getElements().size() is the same as before i added
>>>> an element. If I edit a property element via the property View the
>>>> change is observed on the first editor as well as any other time I
>>>> open a second one.
>>>>
>>>> Any ideas?
>>>>
>>>> Thanks,
>>>> Angel
>>
>>
>>
>> The use of EMF is due to the guidance of IBM's RedBook on GEF and EMF.
>> The use of omondo is due to me being able to design an EMF model
>> graphically and generate the source code for the emf model ( for free).
>>
>> Regards,
>> Angel
>
>
>
> Nice!
>
> Where is this IBM RedBook. I wonder if EMF would be any good for me?
>
>
> CL
http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf
Previous Topic:How to properly handle drag / move targeting
Next Topic:Problem with some event notification...
Goto Forum:
  


Current Time: Sun Feb 05 13:32:10 GMT 2023

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

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

Back to the top