| Problems with deleting [message #80461] |
Thu, 22 May 2003 15:10 |
Eclipse User |
|
|
|
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();
}
|
|
|
Powered by
FUDForum. Page generated in 0.03413 seconds