0
我正在使用EMF將一個eCore模型轉換爲另一個eCore模型。一旦我構建第二個eCore模型並使用下面的代碼將其保存到項目中,我必須手動刷新項目才能顯示生成的模型。 EMF Development有什麼方法可以刷新工作區/項目,因此不需要手動步驟?保存資源後的EMF刷新工作區[xText]
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();
}