List<Project> projects = ProjectPlugin.getPlugin().getProjectRegistry().getProjects();
List<Resource> resources=new ArrayList<Resource>();
for( Project project : projects ) {
// make sure there are no commands executing on the project stack
project.eSetDeliver(false);
project.sendSync(new NullCommand());
project.eSetDeliver(true);
List<IProjectElement> elements = project.getElements();
for (IProjectElement element : elements) {
if( element instanceof Map){
Map map=(Map) element;
map.eSetDeliver(false);
map.sendCommandSync(new NullCommand());
map.eSetDeliver(true);
}
}
project.getElementsInternal().clear();
// Map commands could have put another command on the project stack so
// make sure there are no commands executing on the project stack
project.eSetDeliver(false);
project.sendSync(new NullCommand());
project.eSetDeliver(true);
Resource resource = project.eResource();
resources.add(resource);
if( resource!=null)