Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Copy element from one to another diagram problems ...
Copy element from one to another diagram problems ... [message #131801] Fri, 01 June 2007 11:11 Go to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Hi there,

we want to create something like a repository for our often used
components in our diagram file. If we now copy something from this
repository to our working diagram it will be deleted in the repository
and replaced by a href link to the working diagram.

Is there a way to really copy (or clone) the object and paste it as
independent object into the new diagram?

Do i have to extend the default copy & paste functionality from GMF?

regards
Jens
Re: Copy element from one to another diagram problems ... [message #131803 is a reply to message #131801] Fri, 01 June 2007 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

Hi Jens,

the only thing I did, was adding a parser type for the model file
extension ("org.eclipse.emf.ecore.extension_parser" extension point).

(I'm using non-synch diagrams. Dont't know if that makes any difference...)

regards
Jan

Jens Krause schrieb:
> Hi there,
>
> we want to create something like a repository for our often used
> components in our diagram file. If we now copy something from this
> repository to our working diagram it will be deleted in the repository
> and replaced by a href link to the working diagram.
>
> Is there a way to really copy (or clone) the object and paste it as
> independent object into the new diagram?
>
> Do i have to extend the default copy & paste functionality from GMF?
>
> regards
> Jens
Re: Copy element from one to another diagram problems ... [message #131804 is a reply to message #131803] Fri, 01 June 2007 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Jan Herriger wrote:
> Hi Jens,
>
> the only thing I did, was adding a parser type for the model file
> extension ("org.eclipse.emf.ecore.extension_parser" extension point).

Could you give my some more informations please?
Which parser type for which plugin did you used?

regards
jens
Re: Copy element from one to another diagram problems ... [message #131928 is a reply to message #131804] Sat, 02 June 2007 07:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

I'm talking about registering resource factories against specific
resources. GMFResourceFactory uses UUIDs. The default EMF resource
factory doesn't.

In your diagram plugin's plugin.xml file you'll find something like this:

<extension point="org.eclipse.emf.ecore.extension_parser">
<?gmfgen generated="false"?>
<parser
type="myModel_diagram"
class="org.eclipse.gmf...GMFResourceFactory">
</parser>
</extension>

This registeres GMFResourceFactory against resources with
"myModel_diagram" extensions. What I did, is registering
GMFResourceFactory against the model file. So UUIDs are used for diagram
resources _and_ model resources:

<extension point="org.eclipse.emf.ecore.extension_parser">
<?gmfgen generated="false"?>
<parser
type="myModel_diagram"
class="org.eclipse.gmf...GMFResourceFactory">
</parser>
<parser
type="myModel"
class="org.eclipse.gmf...GMFResourceFactory">
</parser>
</extension>



Jens Krause schrieb:
> Jan Herriger wrote:
>> Hi Jens,
>>
>> the only thing I did, was adding a parser type for the model file
>> extension ("org.eclipse.emf.ecore.extension_parser" extension point).
>
> Could you give my some more informations please?
> Which parser type for which plugin did you used?
>
> regards
> jens
Re: Copy element from one to another diagram problems ... [message #131959 is a reply to message #131928] Mon, 04 June 2007 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiiii

I hv made a gmf editor & on one diagramelement i am opening a another
editor on double click.

Now what i want is that i want to copy the diagramelement of one editor
into another editor.

is it possible?? if yes then how??

Thanks
varun Bhatia
Re: Copy element from one to another diagram problems ... [message #132278 is a reply to message #131928] Mon, 04 June 2007 07:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Jan,

Yes, it is important (when using GMF's copy/paste API) to have the model
also use UUIDs because copying diagram content often implies copying model
content, also (esp. in canonical diagrams).

Christian

Jan Herriger wrote:

> I'm talking about registering resource factories against specific
> resources. GMFResourceFactory uses UUIDs. The default EMF resource
> factory doesn't.
>
> In your diagram plugin's plugin.xml file you'll find something like this:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <?gmfgen generated="false"?>
> <parser
> type="myModel_diagram"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> </extension>
>
> This registeres GMFResourceFactory against resources with
> "myModel_diagram" extensions. What I did, is registering
> GMFResourceFactory against the model file. So UUIDs are used for diagram
> resources _and_ model resources:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <?gmfgen generated="false"?>
> <parser
> type="myModel_diagram"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> <parser
> type="myModel"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> </extension>
>
>
>
> Jens Krause schrieb:
>> Jan Herriger wrote:
>>> Hi Jens,
>>>
>>> the only thing I did, was adding a parser type for the model file
>>> extension ("org.eclipse.emf.ecore.extension_parser" extension point).
>>
>> Could you give my some more informations please?
>> Which parser type for which plugin did you used?
>>
>> regards
>> jens
Re: Copy element from one to another diagram problems ... [message #132291 is a reply to message #131959] Mon, 04 June 2007 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Varun,

You should be able to use the "Copy" action (Ctrl+C) on the context menu of
the diagram element to copy it, then "Paste" (Ctrl+V) to paste it in the
other diagram.

Is that not working for you? Are your resources using UUIDs as indicated by
Jan?

Christian


varun bhatia wrote:

> hiiiii
>
> I hv made a gmf editor & on one diagramelement i am opening a another
> editor on double click.
>
> Now what i want is that i want to copy the diagramelement of one editor
> into another editor.
>
> is it possible?? if yes then how??
>
> Thanks
> varun Bhatia
Re: Copy element from one to another diagram problems ... [message #132570 is a reply to message #131928] Tue, 05 June 2007 04:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Jan Herriger wrote:
> This registeres GMFResourceFactory against resources with
> "myModel_diagram" extensions. What I did, is registering
> GMFResourceFactory against the model file. So UUIDs are used for diagram
> resources _and_ model resources:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <?gmfgen generated="false"?>
> <parser
> type="myModel_diagram"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> <parser
> type="myModel"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> </extension>

Thanks for your explanation, but i only have one file, so in my
plugin.xml it looks like this:

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="glp"
class="org.eclipse.gmf...GMFResourceFactory">
</parser>
</extension>

So is there a way to register the parser for the model resources?


Is <?gmfgen generated="false"?> also in GMF Version 1.0.3 available? Or
is that the plugin.xml-merge-feature from GMF 2.0?

Regards
Jens
Re: Copy element from one to another diagram problems ... [message #132748 is a reply to message #132570] Tue, 05 June 2007 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

> Thanks for your explanation, but i only have one file, so in my
> plugin.xml it looks like this:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <parser
> type="glp"
> class="org.eclipse.gmf...GMFResourceFactory">
> </parser>
> </extension>
>

In this case, I would expect that UUIDs are already in use.

Unfortunately I have no Idea what the problem could be. The only thing I
can say, is that c&p works fine with GMF 2.0 and separate files.

> So is there a way to register the parser for the model resources?
>
>
> Is <?gmfgen generated="false"?> also in GMF Version 1.0.3 available? Or
> is that the plugin.xml-merge-feature from GMF 2.0?
>
> Regards
> Jens

This merging feature was introduced in 2.0.
Re: Copy element from one to another diagram problems ... [message #133505 is a reply to message #132748] Thu, 07 June 2007 01:23 Go to previous message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiiiiii

I am also using one file (for model as well as diagram) bt in my case when
i copy diagram elements form one editor to another editor the state of
that editor on which i am pasting the element becomes unsaved bt nthng
gets display on the editor.


Thanks
Varun Bhatia
Previous Topic:hide a link when collpase a compartment of child border
Next Topic:connections disappear on reopen
Goto Forum:
  


Current Time: Sun May 11 16:13:31 EDT 2025

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

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

Back to the top