sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/PIConfigXMLLoader.java
changeset 12 ae255c9aa552
parent 2 b9ab3b238396
equal deleted inserted replaced
11:5b9d4d8641ce 12:ae255c9aa552
    38 		if (url == null)
    38 		if (url == null)
    39 			return null;
    39 			return null;
    40 
    40 
    41 		// blank file could cause IOException, which is unnecessary. Just return blank model
    41 		// blank file could cause IOException, which is unnecessary. Just return blank model
    42 		if (url.openStream().available() == 0) {
    42 		if (url.openStream().available() == 0) {
    43 			return PIConfigFactory.eINSTANCE.createButtonEventProfileListType();
    43 			return PIConfigFactory.E_INSTANCE.createButtonEventProfileListType();
    44 		}
    44 		}
    45 
    45 
    46 		URI xmlURI = URI.createURI(url.toString());
    46 		URI xmlURI = URI.createURI(url.toString());
    47 
    47 
    48 		PIConfigResourceFactoryImpl resFactory = new PIConfigResourceFactoryImpl();
    48 		PIConfigResourceFactoryImpl resFactory = new PIConfigResourceFactoryImpl();
    65 	
    65 	
    66 		PIConfigResourceFactoryImpl resFactory = new PIConfigResourceFactoryImpl();
    66 		PIConfigResourceFactoryImpl resFactory = new PIConfigResourceFactoryImpl();
    67 		Resource r = resFactory.createResource(xmlURI);
    67 		Resource r = resFactory.createResource(xmlURI);
    68 		EList<EObject> contents = r.getContents();
    68 		EList<EObject> contents = r.getContents();
    69 	
    69 	
    70 		PIConfigFactory factory = PIConfigPackage.eINSTANCE.getPIConfigFactory();
    70 		PIConfigFactory factory = PIConfigPackage.E_INSTANCE.getPIConfigFactory();
    71 		DocumentRoot root = factory.createDocumentRoot();
    71 		DocumentRoot root = factory.createDocumentRoot();
    72 		root.setButtonEventProfileList(list);
    72 		root.setButtonEventProfileList(list);
    73 		contents.add(root);
    73 		contents.add(root);
    74 						
    74 						
    75 		// write to disk
    75 		// write to disk