void () { List<Object> elements = TreeUtil.collectExpandedUserObjects(myTree); // remove root Object for (Iterator<Object> I = elements.iterator(); I.hasNext(); ) { Object element = I.next(); if (!(element instanceof RadComponent)) { I.remove(); } } myDesigner.setExpandedComponents(elements); }