Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Shorcuts disappear when close diagram
Shorcuts disappear when close diagram [message #143014] Tue, 17 July 2007 13:01 Go to next message
Richy is currently offline RichyFriend
Messages: 33
Registered: July 2009
Member
Hello,

When I create shortcut close diagram file and reopen the shortcut is not
present on the view. I have checked the .diagram file with an xml editor
and I have seen the following lines:

<children xmi:type="notation:Node" xmi:id="_0QRb0DRkEdyj4LE93KJIHg"
type="1001">
<eAnnotations xmi:type="ecore:EAnnotation"
xmi:id="_0QRb0zRkEdyj4LE93KJIHg" source="Shortcut">
<details xmi:type="ecore:EStringToStringMapEntry"
xmi:id="_0QRb1DRkEdyj4LE93KJIHg" key="modelID" value="SchemaS"/>
</eAnnotations>
<styles xmi:type="notation:ShapeStyle"
xmi:id="_0QRb0TRkEdyj4LE93KJIHg" lineColor="255"/>
<element xmi:type="s21:Representacion"
href="composicion.sx#//@composicion/@representacion.0"/>
<layoutConstraint xmi:type="notation:Bounds"
xmi:id="_0QRb0jRkEdyj4LE93KJIHg" x="140" y="280" width="321" height="171"/>
</children>

there is a children entry for each shortcut but in the view there is no
one.
Any help would be appreciated.
Ricky.
Re: Shorcuts disappear when close diagram [message #143024 is a reply to message #143014] Tue, 17 July 2007 13:09 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Ricky,

I suppose, this is a diagram file before openning - sortcuts should be removed
from diagram file on saving openned editor. An i right?

Check generated ???CanonicalEditoPolicy.isOrphaned() for your diagram object
- this code should be called on diagram openning to refresh diagram contents
and can potentially remove shortcuts to the elements..

-----------------
Alex Shatalin
Re: Shorcuts disappear when close diagram [message #143120 is a reply to message #143024] Wed, 18 July 2007 06:37 Go to previous messageGo to next message
Richy is currently offline RichyFriend
Messages: 33
Registered: July 2009
Member
Hi Alex,

Sorry for the delay. Maybe my explanation isn't good enough.

We have a generated diagram in which we have configured shortcuts
functionality. We have created a new diagram file, then we have created a
shortcut (via Create shortcut.. action), saving the diagram and everything
went fine. After that we closed the diagram file and then we opened the
same file again and the shortcut wasn't there. We opened the diagram file
through an xml editor to check the xsi file and we saw that there was some
lines with something that seemed to be the shortcut.
We think there is a problem with this because the shortcut must be there
when when we reopened the diagram file.

Regards
Ricky.
Re: Shorcuts disappear when close diagram [message #143168 is a reply to message #143120] Wed, 18 July 2007 08:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Ricky,

I suppose shortcut will be removed from your diagram on next editor openning
while synchronizing diagram contents with model (BTW, editor should be marked
as dirty in this case). To prove this you can re-open iagram and save it
to see if shortcut is still in the diagram file or not.
BTW, which GMF version do you use? Are there any exceptions/mesages in the
..log file?

-----------------
Alex Shatalin
Re: Shorcuts disappear when close diagram [message #143218 is a reply to message #143168] Wed, 18 July 2007 10:45 Go to previous messageGo to next message
Richy is currently offline RichyFriend
Messages: 33
Registered: July 2009
Member
Hi Alex,
I have tried saving diagram after reopen and the .diagram file still
contents the children entry. I have also tried to reopen it again and
there is no shortcut view.
I am using gmf 2.0 (final versión) and there is no error log messages.
Regards.
Ricky.
Re: Shorcuts disappear when close diagram [message #143355 is a reply to message #143218] Thu, 19 July 2007 06:14 Go to previous messageGo to next message
Richy is currently offline RichyFriend
Messages: 33
Registered: July 2009
Member
I think this isn't the default behavior whit shortcuts, isn't it? I mean
the shortcut should remain in the view after close/reopen diagram.
Any ideas?
Ricky
Re: Shorcuts disappear when close diagram [message #143376 is a reply to message #143355] Thu, 19 July 2007 07:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rgtejedor07.gmail.com

I've seen when reopening the diagram is marked as changed (with *). And if
I save the changes the model reference to the shortcut dissapears.
Re: Shorcuts disappear when close diagram [message #144164 is a reply to message #143355] Wed, 25 July 2007 15:46 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Ricky,

Sure they should.. Can suggest you to debug diagram openning process to see
who is removing these shortcuts..

-----------------
Alex Shatalin
Re: Shorcuts disappear when close diagram [message #690248 is a reply to message #144164] Wed, 29 June 2011 09:20 Go to previous message
ray  is currently offline ray Friend
Messages: 2
Registered: March 2011
Junior Member
I have the same problem too.
luckily,it was resolved by "debugging diagram opening process".

The shortcuts are removed in generated XXXX.diagram.edit.policies.YYYYCanonicalEditPolicy.refreshSemantic().

Make sure shortcuts are not removed, or simply comment "deleteViews(orphaned.iterator())".
...
knownViewChildren.remove(perfectMatch.getFirst()); 
...
orphaned.addAll(knownViewChildren); 
...
boolean changed = deleteViews(orphaned.iterator());





Previous Topic:How Can I Get the Value of An Attribute by Code
Next Topic:Parent-Children representation
Goto Forum:
  


Current Time: Wed Mar 03 05:32:27 GMT 2021

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

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

Back to the top