fixed threading bug when picking locations from local stem project
diff --git a/org.eclipse.stem/core/org.eclipse.stem.ui/src/org/eclipse/stem/ui/widgets/LocationPickerDialog.java b/org.eclipse.stem/core/org.eclipse.stem.ui/src/org/eclipse/stem/ui/widgets/LocationPickerDialog.java
index 82d3bf9..28adc18 100644
--- a/org.eclipse.stem/core/org.eclipse.stem.ui/src/org/eclipse/stem/ui/widgets/LocationPickerDialog.java
+++ b/org.eclipse.stem/core/org.eclipse.stem.ui/src/org/eclipse/stem/ui/widgets/LocationPickerDialog.java
@@ -405,34 +405,41 @@
isoKeyPicker0.setISOKeys(GeographicNames.getSubISOKeys(
GeographicMapper.EARTH_ALPHA3_ISO_KEY, -1));
else {
- IRunnableWithProgress getKeys = new IRunnableWithProgress() {
- public void run(IProgressMonitor progress) {
- progress.beginTask(Messages.getString("NLocPickerWiz.gettingLocations"), 100);
-
- // in case the user failed to use containment
- // and only has level ONE, TWO, or THREE keys in the graph
- Object[] entries = LocationUtility.getKeys(project, 0, null).toArray();
- int nextLevel = 0;
- while(((entries==null)||(entries.length==0))&&(nextLevel <= 2)) {
- nextLevel ++;
- entries = LocationUtility.getKeys(project, nextLevel, null).toArray();
- }
- // add whatever is possible to add
- isoKeyPicker0.setISOKeys(entries);
-
-
- progress.worked(100);
- progress.done();
- }
- };
- IRunnableContext context = new ProgressMonitorDialog(shell);
- try {
- context.run(true, true, getKeys);
- } catch(Exception e) {
- Activator.logError(e.getMessage(), e);
- }
-
+ // in case the user failed to use containment
+ // and only has level ONE, TWO, or THREE keys in the graph
+ Object[] entries = LocationUtility.getKeys(project, 0, null).toArray();
+ int nextLevel = 0;
+ while(((entries==null)||(entries.length==0))&&(nextLevel <= 2)) {
+ nextLevel ++;
+ entries = LocationUtility.getKeys(project, nextLevel, null).toArray();
+ }
+ // add whatever is possible to add
+ isoKeyPicker0.setISOKeys(entries);
+
+ // The following is not longer thread safe in E4 to we are reiniting the LOCAL locations
+ // in the main thread (above).
+
+ /*
+ * IRunnableWithProgress getKeys = new IRunnableWithProgress() { public void
+ * run(IProgressMonitor progress) {
+ * progress.beginTask(Messages.getString("NLocPickerWiz.gettingLocations"),
+ * 100);
+ *
+ * // in case the user failed to use containment // and only has level ONE, TWO,
+ * or THREE keys in the graph Object[] entries =
+ * LocationUtility.getKeys(project, 0, null).toArray(); int nextLevel = 0;
+ * while(((entries==null)||(entries.length==0))&&(nextLevel <= 2)) { nextLevel
+ * ++; entries = LocationUtility.getKeys(project, nextLevel, null).toArray(); }
+ * // add whatever is possible to add isoKeyPicker0.setISOKeys(entries);
+ *
+ *
+ * progress.worked(100); progress.done(); } };
+ ****
+ * IRunnableContext context = new ProgressMonitorDialog(shell); try {
+ * context.run(true, true, getKeys); } catch(Exception e) {
+ * Activator.logError(e.getMessage(), e); }
+ */
}
isoKeyPicker1.setISOKeys(new Object[] {});
isoKeyPicker2.setISOKeys(new Object[] {});