use of org.eclipse.wst.json.core.schema.catalog.ICatalogElement in project webtools.sourceediting by eclipse.
the class CatalogElement method clone.
/*
* Since we don't have events notifications for entry properties, clone()
* could allow to copy and edit entry and then replace it in catalog. Entry
* replacement will signal ICatalogEvent @return
*/
public Object clone() {
ICatalogElement element = ownerCatalog.createCatalogElement(type);
String[] attributes = getAttributes();
for (int i = 0; i < attributes.length; i++) {
String attrName = attributes[i];
String attrValue = getAttributeValue(attrName);
element.setAttributeValue(attrName, attrValue);
}
element.setOwnerCatalog(ownerCatalog);
element.setId(id);
element.setBase(base);
return element;
}
Aggregations