public void setId(String id) throws DuplicateIdException { if (this.id.equals(id)) return; if (ownerDocument == null) { this.id = id; return; } if (ownerDocument.getComponentById(id) != null) throw new DuplicateIdException(id); ((ModelBase) ownerDocument).renameComponent(this, id); WorkCraftServer server = ownerDocument.getServer(); if (server != null) { if (server.python.get(id) != null) throw new DuplicateIdException(id); if (server.getObjectById(this.id) == this) server.unregisterObject(this.id); this.id = id; server.registerObject(this, this.id); } else this.id = id; }
public void register(WorkCraftServer server) throws DuplicateIdException { server.registerObject(this, id); for (BasicEditable n : children) n.register(server); }