Domanda

I am using EMF to translate one eCore model into another eCore model. Once I build up the second eCore model and save it to the project using the below code, I have to manually refresh the project in order for the generated model to show. Is there any way in EMF Development to refresh the Workspace/Project so the manual step will not be needed?

Resource s5Resource = s5resourceSet.createResource(URI.createURI(s5ModelFileName));

// Convert to s5 model
s5Model = ConvertModelToS5Model.convert(model);

s5Resource.getContents().add(s5Model);

// Now save the content.
try {
    s5Resource.save(Collections.EMPTY_MAP);
} catch (IOException e) {
// TODO Auto-generated catch block
    e.printStackTrace();
}
È stato utile?

Soluzione

If anyone else has this issue, I found out the method is in the IResource interface. The method is called refreshLocal().

API --> http://help.eclipse.org/helios/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/resources/IResource.html

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top