Skip to content

Commit

Permalink
fix wrong declaration of startup model preference, mentioned in #3332
Browse files Browse the repository at this point in the history
  • Loading branch information
hqnghi88 committed Apr 5, 2022
1 parent 4b2d5af commit bd4f9aa
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.emf.common.util.URI;
import org.geotools.referencing.CRS;

import msi.gama.common.interfaces.IKeyword;
Expand Down Expand Up @@ -111,10 +112,13 @@ public static class Interface {
create("pref_default_experiment", "Choose the experiment to run at startup", "", IType.STRING, false)
.in(NAME, STARTUP).among(() -> {
List result = new ArrayList();
IGamaFile file = CORE_DEFAULT_MODEL.getValue();
if (file == null || "".equals(file.getOriginalPath())) return result;
result.addAll(
GAML.getInfo(FileUtils.getURI(file.getOriginalPath(), null)).getExperiments());
if (CORE_STARTUP_MODEL.getValue()) {
IGamaFile file = CORE_DEFAULT_MODEL.getValue();
final URI uriModel = FileUtils.getURI(file.getOriginalPath(), null);
if (uriModel == null)
return result;
result.addAll(GAML.getInfo(uriModel).getExperiments());
}
return result;
});
/**
Expand Down

0 comments on commit bd4f9aa

Please sign in to comment.