Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael P. Masterson2017-02-16 14:23:08 -0500
committerMichael P. Masterson2017-02-16 14:24:11 -0500
commitc43e496cc070d2955d7b710adef1125007b371fd (patch)
tree9c1ff39fa2b08a1f2cba6ab3678cbdeb829685b8
parent68e19cb5ec76ede4538854d98e3aafdeebc77142 (diff)
downloadorg.eclipse.osee-c43e496cc070d2955d7b710adef1125007b371fd.tar.gz
org.eclipse.osee-c43e496cc070d2955d7b710adef1125007b371fd.tar.xz
org.eclipse.osee-c43e496cc070d2955d7b710adef1125007b371fd.zip
bug[ats_ATS349137]: Moving preference store out of start.
Having the call to preference store in the start method made the eclipse workspace selection prompt be skipped. Moved into the creation of the Console instead. Change-Id: Id53e1d501e45f39f701d910e5a2140c1bc873aa5
-rw-r--r--plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java2
-rw-r--r--plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/prefs/OteConsolePrefsUtil.java20
2 files changed, 17 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
index 66012953fb..ec11f7064f 100644
--- a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
@@ -55,8 +55,6 @@ public class TestCoreGuiPlugin extends AbstractUIPlugin {
if (System.getProperty("NO_OTE_ARTIFACT_BULK_LOAD") == null) {
startOTEArtifactBulkLoad();
}
- setDefaultPreferences();
-
super.start(context);
}
diff --git a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/prefs/OteConsolePrefsUtil.java b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/prefs/OteConsolePrefsUtil.java
index 0760b0e6bf..d4a6a2dadf 100644
--- a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/prefs/OteConsolePrefsUtil.java
+++ b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/prefs/OteConsolePrefsUtil.java
@@ -18,15 +18,21 @@ import org.eclipse.osee.ote.ui.internal.TestCoreGuiPlugin;
public class OteConsolePrefsUtil {
public static int getInt(OteConsolePreferences bufferLimit) {
- return TestCoreGuiPlugin.getDefault().getPreferenceStore().getInt(bufferLimit.getPropKey());
+ String propKey = bufferLimit.getPropKey();
+ lateLoadDefaults(propKey);
+ return TestCoreGuiPlugin.getDefault().getPreferenceStore().getInt(propKey);
}
public static String getString(OteConsolePreferences bufferLimit) {
- return TestCoreGuiPlugin.getDefault().getPreferenceStore().getString(bufferLimit.getPropKey());
+ String propKey = bufferLimit.getPropKey();
+ lateLoadDefaults(propKey);
+ return TestCoreGuiPlugin.getDefault().getPreferenceStore().getString(propKey);
}
public static boolean getBoolean(OteConsolePreferences bufferLimit) {
- return TestCoreGuiPlugin.getDefault().getPreferenceStore().getBoolean(bufferLimit.getPropKey());
+ String propKey = bufferLimit.getPropKey();
+ lateLoadDefaults(propKey);
+ return TestCoreGuiPlugin.getDefault().getPreferenceStore().getBoolean(propKey);
}
public static void setInt(OteConsolePreferences preference, int value) {
@@ -40,5 +46,13 @@ public class OteConsolePrefsUtil {
public static void setBoolean(OteConsolePreferences preference, boolean value) {
TestCoreGuiPlugin.getDefault().getPreferenceStore().setValue(preference.getPropKey(), value);
}
+
+ private static void lateLoadDefaults(String keyStr) {
+ TestCoreGuiPlugin plugin = TestCoreGuiPlugin.getDefault();
+ String defaultString = plugin.getPreferenceStore().getDefaultString(keyStr);
+ if(defaultString == null || defaultString.length() <= 0) {
+ TestCoreGuiPlugin.setDefaultPreferences();
+ }
+ }
}

Back to the top