/** Returns the UI object that will serve as a space owner. * Unlike {@link #spaceOwner}, it will return the top component if * it is a virtual IdSpace. Furthermore, clearVirtualIdSpace will be called * before returned. It is used only by {@link #setParent}. */ private static Object spaceController(Component p) { Component top; do { if (p instanceof IdSpace) return p; top = p; } while ((p = p.getParent()) != null); final AbstractComponent ac = (AbstractComponent) top; if (ac._page != null) return ac._page; ac.clearVirtualIdSpace(); return ac; //yes, return the top (virtual ID space) }
if (page != null) { if (_page == null) clearVirtualIdSpace(); //clear if being attached else if (_page.getDesktop() != page.getDesktop()) throw new UiException("The new page must be in the same desktop: " + page);
? spaceController(_parent) : _page); clearVirtualIdSpace(); //clear since it is being added to another if (idSpaceChanged) removeFromIdSpacesDown(this);