Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Draw connection on attribute change
Draw connection on attribute change [message #1016207] Tue, 05 March 2013 13:40 Go to next message
Matthias N is currently offline Matthias N
Messages: 65
Registered: June 2012
Member
Hi,

I have two elements A and B.

+---+     target +---+
| A |------------| B |
+---+            +---+


I can draw a connection from A to B via an entry in to palette, that's fine

Now I programmatically do:

A.setTarget(B)

of course I use the command framework
new SetCommand(editingDomain, A, Package.eINSTANCE.getA_target(), B);



but then, the connection is not drawn instantly. When I close the diagram and open it again the connection is visible. However I want to see it as soon as I change the property. Is this possible?
Re: Draw connection on attribute change [message #1016210 is a reply to message #1016207] Tue, 05 March 2013 13:57 Go to previous message
Matthias N is currently offline Matthias N
Messages: 65
Registered: June 2012
Member
Solved it:

EditPart mainEditPart = (EditPart)(this.getRoot().getChildren().get(0));
CanonicalEditPolicy cep =(CanonicalEditPolicy)mainEditPart.getEditPolicy(EditPolicyRoles.CANONICAL_ROLE);
if (cep!=null)
 cep.refresh();
Previous Topic:How to create a new EditingDomain?
Next Topic:Dsl.provider cannot be resolved to a type
Goto Forum:
  


Current Time: Tue Oct 21 08:49:16 GMT 2014

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

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