Get updated resource set from Java service [message #1799942] |
Mon, 17 December 2018 12:36  |
Eclipse User |
|
|
|
Hello,
I'm using a Sirius service to get possible models for an import, the code looks more or less like this:
public EObject addImport(MappingInstance instance) {
EList<Resource> resources = instance.eResource().getResourceSet().getResources();
List<String> validExtensions = new ArrayList<>();
validExtensions.add("common");
validExtensions.add("model");
validExtensions.add("map");
List<Resource> models = resources.stream().filter(p -> validExtensions.contains(p.getURI().fileExtension()))
.collect(Collectors.toList());
// do my stuff to find the models I wan to import...
The problem I find is that if I add or remove a file, the resource set is not updated and I'm not able to find the resources (or on deletion, the resources are shown but are actually not there).
How can I make sure that the resource sets are updated?
Thanks in advance,
Best regards,
Edmundo López
PS: If I close and reopen the diagram, the resource set updates automagically.
[Updated on: Mon, 17 December 2018 14:17] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03267 seconds