/** Sets the name. */ public void setName(String name) { for (Attribute a : getModel().getRoot().getAttributes()) { if (a.getName().equals(name)) { setRef(a); return; } } getReferent().setName(name); }
/** Sets the type. */ public void setType(AXIType type) { if (type instanceof Attribute) { setRef((Attribute) type); return; } int index = this.getIndex(); AXIComponent parent = getParent(); Attribute a = getModel().getComponentFactory().createAttribute(); a.setName(getReferent().getName()); parent.removeChild(this); parent.insertAtIndex(Attribute.PROP_ATTRIBUTE, a, index); a.setType(type); }
/** Sets the new referent. */ public void setRef(Attribute referent) { AttributeImpl oldRef = (AttributeImpl) getReferent(); if (oldRef == referent) return; oldRef.removeListener(this); super.setSharedComponent(referent); firePropertyChangeEvent(PROP_ATTRIBUTE_REF, oldRef, referent); forceFireEvent(); }
/** Creates a new instance of AttributeRef */ public AttributeRef(AXIModel model, SchemaComponent component, Attribute referent) { super(model, component); super.setSharedComponent(referent); }