Search in sources :

Example 6 with ICatalogElement

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;
}
Also used : ICatalogElement(org.eclipse.wst.json.core.schema.catalog.ICatalogElement)

Aggregations

ICatalogElement (org.eclipse.wst.json.core.schema.catalog.ICatalogElement)6 ICatalogEntry (org.eclipse.wst.json.core.schema.catalog.ICatalogEntry)3 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 JsonArray (org.eclipse.json.provisonnal.com.eclipsesource.json.JsonArray)1 JsonObject (org.eclipse.json.provisonnal.com.eclipsesource.json.JsonObject)1 JsonValue (org.eclipse.json.provisonnal.com.eclipsesource.json.JsonValue)1 ICatalog (org.eclipse.wst.json.core.schema.catalog.ICatalog)1 IDelegateCatalog (org.eclipse.wst.json.core.schema.catalog.IDelegateCatalog)1 INextCatalog (org.eclipse.wst.json.core.schema.catalog.INextCatalog)1