[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Problem with connection on editor reload

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());
}