private void removeIndexComponent(Component parent, Component compToIndex) { parent.allChildren.remove(compToIndex.id.toLowerCase()); for (Component child : compToIndex.allChildren.values()) parent.allChildren.remove(child.id.toLowerCase()); if (parent.parent != null) removeIndexComponent(parent.parent, compToIndex); }
public void delete() { if (parent != null) { removeIndexComponent(this.parent, this); this.parent.directChildren.remove(this); this.parent = null; } }
public void addChild(Component component) { if (component.parent != null) { component.parent.directChildren.remove(component); removeIndexComponent(component.parent, component); } component.parent = this; this.directChildren.add(component); indexComponent(this, component); }
public void setId(String id) { id = id.isEmpty() == true ? generateCustomId() : id; if (this.parent != null) removeIndexComponent(this.parent, this); this.id = id; if (this.parent != null) indexComponent(this.parent, this); attributes.setId(this.id); initAttributesId(); }