Home » Modeling » GMF (Graphical Modeling Framework) » copy and paste bug?
|
Re: copy and paste bug? [message #171482 is a reply to message #171371] |
Tue, 05 February 2008 12:15 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Lorenzo,
Are you using UUIDs in your diagram and model resources? This is a
pre-requisite of the copy/paste infrastructure in GMF Run-time.
HTH,
Christian
Lorenzo Bettini wrote:
> Hi
>
> following the tutorial (first part) and running the generated diagram
> editor I noticed that copy & paste has some problems: a node can be
> copied and pasted, but the pasted copy does not allow you to modify the
> label (and the label is not actually copied); but most of all, you
> cannot add new objects to the diagram, and the underlying model is
> irreversibly ruined: it is basically emptied...
>
> anyone else noticed this?
>
> Lorenzo
>
|
|
|
Re: copy and paste bug? [message #171605 is a reply to message #171482] |
Tue, 05 February 2008 20:00 |
|
Hi Christian
apologies for my ignorance: what are UUIDs? I've actually used the
diagram generated following the GMF tutorial (part I)...
thanks in advance
Lorenzo
Christian W. Damus wrote:
> Hi, Lorenzo,
>
> Are you using UUIDs in your diagram and model resources? This is a
> pre-requisite of the copy/paste infrastructure in GMF Run-time.
>
> HTH,
>
> Christian
>
> Lorenzo Bettini wrote:
>
>> Hi
>>
>> following the tutorial (first part) and running the generated diagram
>> editor I noticed that copy & paste has some problems: a node can be
>> copied and pasted, but the pasted copy does not allow you to modify the
>> label (and the label is not actually copied); but most of all, you
>> cannot add new objects to the diagram, and the underlying model is
>> irreversibly ruined: it is basically emptied...
>>
>> anyone else noticed this?
>>
>> Lorenzo
>>
>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: copy and paste bug? [message #172143 is a reply to message #171605] |
Mon, 11 February 2008 14:55 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Lorenzo,
UUIDs are the (pseudo-)universally unique identifiers generated by EMF when
an XMLResourceImpl implements useUUIDs() to return true. See
EcoreUtil::generateUUID() for details.
Cheers,
Christian
Lorenzo Bettini wrote:
> Hi Christian
>
> apologies for my ignorance: what are UUIDs? I've actually used the
> diagram generated following the GMF tutorial (part I)...
>
> thanks in advance
> Lorenzo
>
> Christian W. Damus wrote:
>> Hi, Lorenzo,
>>
>> Are you using UUIDs in your diagram and model resources? This is a
>> pre-requisite of the copy/paste infrastructure in GMF Run-time.
>>
>> HTH,
>>
>> Christian
>>
>> Lorenzo Bettini wrote:
>>
>>> Hi
>>>
>>> following the tutorial (first part) and running the generated diagram
>>> editor I noticed that copy & paste has some problems: a node can be
>>> copied and pasted, but the pasted copy does not allow you to modify the
>>> label (and the label is not actually copied); but most of all, you
>>> cannot add new objects to the diagram, and the underlying model is
>>> irreversibly ruined: it is basically emptied...
>>>
>>> anyone else noticed this?
>>>
>>> Lorenzo
>>>
>>
>
>
|
|
|
Re: copy and paste bug? [message #172220 is a reply to message #172143] |
Mon, 11 February 2008 18:36 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
Christian W. Damus wrote:
> Hi, Lorenzo,
>
> UUIDs are the (pseudo-)universally unique identifiers generated by EMF when
> an XMLResourceImpl implements useUUIDs() to return true. See
> EcoreUtil::generateUUID() for details.
>
> Cheers,
>
> Christian
>
>
> Lorenzo Bettini wrote:
>
>> Hi Christian
>>
>> apologies for my ignorance: what are UUIDs? I've actually used the
>> diagram generated following the GMF tutorial (part I)...
>>
>> thanks in advance
>> Lorenzo
>>
>> Christian W. Damus wrote:
>>> Hi, Lorenzo,
>>>
>>> Are you using UUIDs in your diagram and model resources? This is a
>>> pre-requisite of the copy/paste infrastructure in GMF Run-time.
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>> Lorenzo Bettini wrote:
>>>
>>>> Hi
>>>>
>>>> following the tutorial (first part) and running the generated diagram
>>>> editor I noticed that copy & paste has some problems: a node can be
>>>> copied and pasted, but the pasted copy does not allow you to modify the
>>>> label (and the label is not actually copied); but most of all, you
>>>> cannot add new objects to the diagram, and the underlying model is
>>>> irreversibly ruined: it is basically emptied...
>>>>
>>>> anyone else noticed this?
>>>>
>>>> Lorenzo
>>>>
>>
>
Christian,
I just overrode the useUUIDs() to return true, ran my EMF editor and
created a new root object. But when the editor tried to open the new
resource file it complains about the "id" feature with a
FeatureNotFoundException: Feature 'id' not found. The 'id' feature
looks like the UUID. What else do I need to do?
|
|
|
Re: copy and paste bug? [message #172227 is a reply to message #172220] |
Mon, 11 February 2008 21:54 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, john,
I think you also need useIDs() to return true, otherwise the resource will
look in each EClass for an EAttribute that has isID set.
HTH,
Christian
John Yotka wrote:
> Christian W. Damus wrote:
>> Hi, Lorenzo,
>>
>> UUIDs are the (pseudo-)universally unique identifiers generated by EMF
>> when
>> an XMLResourceImpl implements useUUIDs() to return true. See
>> EcoreUtil::generateUUID() for details.
>>
>> Cheers,
>>
>> Christian
>>
>>
-----8<-----
> I just overrode the useUUIDs() to return true, ran my EMF editor and
> created a new root object. But when the editor tried to open the new
> resource file it complains about the "id" feature with a
> FeatureNotFoundException: Feature 'id' not found. The 'id' feature
> looks like the UUID. What else do I need to do?
|
|
|
Re: copy and paste bug? [message #172233 is a reply to message #172227] |
Mon, 11 February 2008 22:17 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
Christian W. Damus wrote:
> Hi, john,
>
> I think you also need useIDs() to return true, otherwise the resource will
> look in each EClass for an EAttribute that has isID set.
>
> HTH,
>
> Christian
>
> John Yotka wrote:
>
>> Christian W. Damus wrote:
>>> Hi, Lorenzo,
>>>
>>> UUIDs are the (pseudo-)universally unique identifiers generated by EMF
>>> when
>>> an XMLResourceImpl implements useUUIDs() to return true. See
>>> EcoreUtil::generateUUID() for details.
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>>
>
> -----8<-----
>
>> I just overrode the useUUIDs() to return true, ran my EMF editor and
>> created a new root object. But when the editor tried to open the new
>> resource file it complains about the "id" feature with a
>> FeatureNotFoundException: Feature 'id' not found. The 'id' feature
>> looks like the UUID. What else do I need to do?
>
Christian,
I have now overridden both useUUIDs() and useIDs() to return true, and
got the same behavior. All of the objects in the resource file have an
'id' attribute that is set to a (psuedo-)UUID.
When the EMF editor tries to load the resource, I get the exception:
FeatureNotFoundException: Feature 'id' not found.
for every object in the resource.
|
|
|
Re: copy and paste bug? [message #172249 is a reply to message #172233] |
Tue, 12 February 2008 02:25 |
David Steinberg Messages: 489 Registered: July 2009 |
Senior Member |
|
|
Hi John,
Actually, you don't need to override useIDs(), since the XMLResourceImpl
implementation already returns true if useUUIDs() does.
There is, however, one additional step required to make the loader
recognize the extrinsic id attribute. This happens by default in
XMIResourceImpl, which is where such IDs are normally used. But, with
the XMLResourceImpl, you need to specify it via the XMLMap option.
This createResource() implementation, which you could put in a custom
Resource.Factory, should be sufficient to create an UUID-enabled
XMLResourceImpl:
public Resource createResource(URI uri)
{
XMLResource result = new XMLResourceImpl(uri)
{
protected boolean useUUIDs()
{
return true;
}
};
XMLResource.XMLMap map = new XMLMapImpl();
map.setIDAttributeName("id");
result.getDefaultLoadOptions().put(XMLResource.OPTION_XML_MA P, map);
return result;
}
Cheers,
Dave
John Yotka wrote:
> Christian W. Damus wrote:
>> Hi, john,
>>
>> I think you also need useIDs() to return true, otherwise the resource
>> will
>> look in each EClass for an EAttribute that has isID set.
>>
>> HTH,
>>
>> Christian
>>
>> John Yotka wrote:
>>
>>> Christian W. Damus wrote:
>>>> Hi, Lorenzo,
>>>>
>>>> UUIDs are the (pseudo-)universally unique identifiers generated by EMF
>>>> when
>>>> an XMLResourceImpl implements useUUIDs() to return true. See
>>>> EcoreUtil::generateUUID() for details.
>>>>
>>>> Cheers,
>>>>
>>>> Christian
>>>>
>>>>
>>
>> -----8<-----
>>
>>> I just overrode the useUUIDs() to return true, ran my EMF editor and
>>> created a new root object. But when the editor tried to open the new
>>> resource file it complains about the "id" feature with a
>>> FeatureNotFoundException: Feature 'id' not found. The 'id' feature
>>> looks like the UUID. What else do I need to do?
>>
> Christian,
>
> I have now overridden both useUUIDs() and useIDs() to return true, and
> got the same behavior. All of the objects in the resource file have an
> 'id' attribute that is set to a (psuedo-)UUID.
>
> When the EMF editor tries to load the resource, I get the exception:
>
> FeatureNotFoundException: Feature 'id' not found.
>
> for every object in the resource.
|
|
|
Re: copy and paste bug? [message #172707 is a reply to message #172249] |
Sat, 16 February 2008 17:40 |
|
Dave Steinberg wrote:
> Hi John,
>
> Actually, you don't need to override useIDs(), since the XMLResourceImpl
> implementation already returns true if useUUIDs() does.
>
> There is, however, one additional step required to make the loader
> recognize the extrinsic id attribute. This happens by default in
> XMIResourceImpl, which is where such IDs are normally used. But, with
> the XMLResourceImpl, you need to specify it via the XMLMap option.
>
> This createResource() implementation, which you could put in a custom
> Resource.Factory, should be sufficient to create an UUID-enabled
> XMLResourceImpl:
>
> public Resource createResource(URI uri)
> {
> XMLResource result = new XMLResourceImpl(uri)
> {
> protected boolean useUUIDs()
> {
> return true;
> }
> };
> XMLResource.XMLMap map = new XMLMapImpl();
> map.setIDAttributeName("id");
> result.getDefaultLoadOptions().put(XMLResource.OPTION_XML_MA P, map);
> return result;
> }
>
I still haven't tried this solution, but shouldn't this be the default
at least when using GMF generated editors? I mean it's quite natural to
expect copy and paste to work, isn't it?
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: copy and paste bug? [message #173213 is a reply to message #173009] |
Wed, 20 February 2008 18:33 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Dave,
I believe that GMF does define a resource impl that does this. But of
course you have to be sure you're using that too...
Dave Steinberg wrote:
> Lorenzo Bettini wrote:
>>
>> I still haven't tried this solution, but shouldn't this be the
>> default at least when using GMF generated editors? I mean it's quite
>> natural to expect copy and paste to work, isn't it?
>
> Ho Lorenzo,
>
> I agree. If IDs are required, then GMF should be defaulting to an XMI
> resource implementation with UUIDs enabled. I suppose that if they're
> relying on EMF's default code generation, this isn't the case?
>
> Cheers,
> Dave
|
|
| |
Re: copy and paste bug? [message #185195 is a reply to message #185187] |
Sun, 04 May 2008 13:27 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Lorenzo,
It's not surprising considering that the GMF resource has UUIDs enabled.
Lorenzo Bettini wrote:
> Sorry for the long silence about this issue...
>
> I've just noticed that setting the same file for the model and the
> diagram does not show this problem...
|
|
|
Goto Forum:
Current Time: Fri Apr 26 06:52:26 GMT 2024
Powered by FUDForum. Page generated in 0.03991 seconds
|