public PropertyEditor attach(RootedProperty model) { if (model == null) { detach(); return this; } if (!canEdit(model.getValueType(false)) && !canEdit(model.getValueType(true))) { throw new InvalidModelForEditorException(); } if (this.model != null) { throw new EditorNotDetachedException(); } model.getRoot().addParentPath(this, ""); this.model = model; updateView(); return this; }
public void detach() { if (model != null) { model.getRoot().removeParentPath(this, ""); model = null; } }