Menu

#26 DockableWidget.removeAll leaves widget non-empty

open
nobody
None
5
2009-03-31
2009-03-31
No

the following code:

DockableWidget dockable = ...
dockable.setContent(...);
dockable.removeAll();
System.out.println("kids=" + dockable.getChildCount() + "; check=" + dockable.getChildren().size());

will print "kids=1; check=1"

The problem is that DockableWidget.getChildCount() and .getChildren() test if 'content' is non-null, but neither remove() nor removeAll() set contents to null.

The fix is to add the following line at the end of DockableWidget.remove(Widget widget):

content = null;

Cheers!
Nik

Discussion