private void cloneSpaceInfoFrom(SpaceInfo from) { //rebuild ID space by binding itself and all children if (!isAutoId(_id)) this.bindToIdSpace(this); for (AbstractComponent p = (AbstractComponent) getFirstChild(); p != null; p = p._next) addToIdSpacesDown(p, (IdSpace) this); }
private static void init(Map<String, Component> fellows, Component comp) { if (!(comp instanceof NonFellow)) { final String compId = comp.getId(); if (!AbstractComponent.isAutoId(compId)) fellows.put(compId, comp); } if (!(comp instanceof IdSpace)) for (Component child = comp.getFirstChild(); child != null; child = child.getNextSibling()) init(fellows, child); //recursive }
private static void checkIdSpacesDown(Component comp, IdSpace owner) { final String compId = comp.getId(); if (!(comp instanceof NonFellow) && !isAutoId(compId) && (owner instanceof Component ? ((AbstractComponent) owner)._auxinf.spaceInfo.fellows.containsKey(compId) : owner.hasFellow(compId))) throw new UiException("Not unique in the ID space of " + owner + ": " + compId); if (!(comp instanceof IdSpace)) for (AbstractComponent ac = (AbstractComponent) comp.getFirstChild(); ac != null; ac = ac._next) checkIdSpacesDown(ac, owner); //recursive }
/** Adds to the ID spaces, if any, when ID is changed. * Caller has to make sure the uniqueness (and not auto id). */ private static void addToIdSpaces(final Component comp) { final String compId = comp.getId(); if (comp instanceof NonFellow || isAutoId(compId)) return; //nothing to do if (comp instanceof IdSpace) ((AbstractComponent) comp).bindToIdSpace(comp); addFellow(comp, getSpaceOwnerOfParent(comp)); }
/** Removes from the ID spaces, if any, when ID is changed. */ private static void removeFromIdSpaces(final Component comp) { final String compId = comp.getId(); if (comp instanceof NonFellow || isAutoId(compId)) return; //nothing to do if (comp instanceof IdSpace) ((AbstractComponent) comp).unbindFromIdSpace(compId); removeFellow(comp, getSpaceOwnerOfParent(comp)); }
private static void addToIdSpacesDown(Component comp, IdSpace owner) { if (!(comp instanceof NonFellow) && !isAutoId(comp.getId())) addFellow(comp, owner); if (!(comp instanceof IdSpace)) for (AbstractComponent ac = (AbstractComponent) comp.getFirstChild(); ac != null; ac = ac._next) addToIdSpacesDown(ac, owner); //recursive ((AbstractComponent) comp).notifyIdSpaceChanged(owner); }
private static void removeFromIdSpacesDown(Component comp, IdSpace owner) { if (!(comp instanceof NonFellow) && !isAutoId(comp.getId())) removeFellow(comp, owner); if (!(comp instanceof IdSpace)) for (AbstractComponent ac = (AbstractComponent) comp.getFirstChild(); ac != null; ac = ac._next) removeFromIdSpacesDown(ac, owner); //recursive ((AbstractComponent) comp).notifyIdSpaceChanged(null); }
if (!isAutoId(_id)) bindToIdSpace(this); for (AbstractComponent ac = (AbstractComponent) getFirstChild(); ac != null; ac = ac._next)