Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem with connection on editor reload
Problem with connection on editor reload [message #213250] Thu, 11 December 2008 15:07
Eclipse UserFriend
Originally posted by: uwe.suedbeck.koeln.de

Hello, me again.

I have problems to refresh my connections when i try to reload my
editor. As i mentioned in an earlier post i have some objects that
reside within a compartment. This compartment is collapsable and for
this i finally managed to manipulate the connections to point on the
collapsed Parent-Component instead of the position where the (now
invisible) component is.

But when i now try to reload the editor i get some strange behavior. If
there had not been any collapse action the result is ok, but as soon as
i try to manipulate the connections in the mentioned way the result is
crap.
It seems that the manipulated connections are kept in the drawing and
the all connections from the Model that have been manipulated are added
again.

So for this i tried to decollapse all Compartments programatically to
get back to the state the drawing was created. If i do this within the
Editor everything works as expected, but if i try to do this in my
overridden reload method it wont work. How can i do this ?

An other aaproach i would accept is to completely delete all existing
Connections and rebuild them from scratch by the reload function. How
could i achieve this?

public void reload() {

if(this.getDiagramEditPart() instanceof SCERootEditPart){
SCERootEditPart sceRoot =
(SCERootEditPart) this.getDiagramEditPart();
//this decollapses the Compartments
sceRoot.collapseRecurse(false);
}
//this is a reset i need for Layout
((SCEDiagramUpdater)EditorContext.getDescriptor()
.getDiagramUpdater()).initialize();
reload(this.getRoot(), this.getRoot().getURI());
}
Previous Topic:get editpart of editorpart
Next Topic:Audit rule confusion
Goto Forum:
  


Current Time: Sat Apr 20 06:07:59 GMT 2024

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

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

Back to the top