/**
* Removes and then re-inserts all children of the given widget's parent
*/
public static void doReInsert(WidgetUserObject object) throws GUIException {
ArrayList temp = new ArrayList(), tempAnchors = new ArrayList();
Widget parentWidget = object.widget.getParentWidget();
TreeItem parentNode = (TreeItem) object.treeNode.getParentWidget();
for (int i=0, count=parentNode.getChildCount(); i<count; i++) {
TreeItem node = (TreeItem) parentNode.getChild(i);
WidgetUserObject nodeObj = (WidgetUserObject) node.getUserObject();
temp.add(nodeObj.widget);
tempAnchors.add(XMLUtils.getChild(nodeObj.element, "anchor"));
parentWidget.removeChildWidget(nodeObj.widget);
}
for (int i=0; i<temp.size(); i++) {
Object anchor = createAnchor((Widget) temp.get(i), (Element) tempAnchors.get(i));
parentWidget.addChild((Widget) temp.get(i), anchor);
}
revalidate(parentWidget);
}