Skip to main content



      Home
Home » Eclipse Projects » GEF » Problems with deleting
Problems with deleting [message #80461] Thu, 22 May 2003 15:10
Eclipse UserFriend
Originally posted by: junost.gmx.de

I have a DeleteAction, who calls a removeChild() -method. This method
removes the child from the children-list and calls a
firePropertyChange-event. It is the same event like adding a child. My
edit-part listens to that event. The problem is: although it is the same
event the adding of a child works and removing works not. Both should call
the refreshChildren()-method.

Model:

public void removeChild(Shape shape) {
children.remove(shape);
firePropertyChange(PROP_CHILDREN, shape, null);
}

public void addChild(Shape shape) {
children.add(shape);
if (shape instanceof MyAnchor){
shape.setSize(10,10);
}
firePropertyChange(PROP_CHILDREN, null, shape);
}

EditPart:

public void propertyChange(PropertyChangeEvent event) {
String prop = event.getPropertyName();
if (SymbolModel.PROP_CHILDREN.equals(prop)){
refreshChildren();
}
else if (Shape.PROP_SIZE.equals(prop) ||
Shape.PROP_LOCATION.equals(prop))
refreshVisuals();
}

Previous Topic:export to gif or jpeg
Next Topic:Connections without models
Goto Forum:
  


Current Time: Fri Nov 07 16:19:48 EST 2025

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

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

Back to the top