diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/Activator.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/Activator.java index 7b3ae8070c..98910de897 100644 --- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/Activator.java +++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/Activator.java @@ -22,24 +22,36 @@ package com.raytheon.uf.viz.alertviz; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { - private HierarchicalPreferenceStore prefs; - // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.alertviz"; // The shared instance private static Activator plugin; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); + /** * The constructor */ @@ -86,17 +98,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/Activator.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/Activator.java index e5e6039f46..bad07eb095 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/Activator.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/Activator.java @@ -25,10 +25,8 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.jivesoftware.smack.packet.Presence.Mode; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; @@ -109,36 +107,26 @@ public class Activator extends AbstractUIPlugin { @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - prefs.setDefault(CollabPrefConstants.P_SERVER, ""); - prefs.setDefault(CollabPrefConstants.AUTO_JOIN, true); + if (prefs == null) { + prefs = new HierarchicalPreferenceStore(this); + prefs.setDefault(CollabPrefConstants.P_SERVER, ""); + prefs.setDefault(CollabPrefConstants.AUTO_JOIN, true); - // TODO better default? - prefs.setDefault(CollabPrefConstants.P_USERNAME, - System.getProperty("user.name")); + // TODO better default? + prefs.setDefault(CollabPrefConstants.P_USERNAME, + System.getProperty("user.name")); - prefs.setDefault(CollabPrefConstants.P_STATUS, - Mode.available.toString()); - prefs.setDefault(CollabPrefConstants.P_MESSAGE, ""); - prefs.setDefault(CollabPrefConstants.AWAY_ON_IDLE, true); - prefs.setDefault(CollabPrefConstants.AWAY_TIMEOUT, - CollabPrefConstants.AWAY_TIMEOUT_DEFAULT); - prefs.setDefault(CollabPrefConstants.AUTO_ACCEPT_SUBSCRIBE, - false); - prefs.setDefault(CollabPrefConstants.DEFAULT_HANDLE, - CollabPrefConstants.HandleOption.USERNAME.name()); - prefs.setDefault(CollabPrefConstants.CUSTOM_HANDLE, ""); - } - - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); + prefs.setDefault(CollabPrefConstants.P_STATUS, + Mode.available.toString()); + prefs.setDefault(CollabPrefConstants.P_MESSAGE, ""); + prefs.setDefault(CollabPrefConstants.AWAY_ON_IDLE, true); + prefs.setDefault(CollabPrefConstants.AWAY_TIMEOUT, + CollabPrefConstants.AWAY_TIMEOUT_DEFAULT); + prefs.setDefault(CollabPrefConstants.AUTO_ACCEPT_SUBSCRIBE, false); + prefs.setDefault(CollabPrefConstants.DEFAULT_HANDLE, + CollabPrefConstants.HandleOption.USERNAME.name()); + prefs.setDefault(CollabPrefConstants.CUSTOM_HANDLE, ""); } - return prefs; } diff --git a/cave/com.raytheon.uf.viz.core/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.core/META-INF/MANIFEST.MF index d5ef0fca12..ad13b27526 100644 --- a/cave/com.raytheon.uf.viz.core/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Viz Core Plug-in Bundle-SymbolicName: com.raytheon.uf.viz.core;singleton:=true -Bundle-Version: 1.14.1.qualifier +Bundle-Version: 1.14.2.qualifier Bundle-Activator: com.raytheon.uf.viz.core.Activator Bundle-Vendor: Raytheon Require-Bundle: org.eclipse.ui, diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/Activator.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/Activator.java index 4660af7d0f..a9d471b54e 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/Activator.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/Activator.java @@ -26,9 +26,6 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.services.IDisposable; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -38,8 +35,9 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * chammack Initial Creation. - * Mar 5, 2013 1753 njensen Added printout to stop() + * chammack Initial Creation. + * Mar 5, 2013 1753 njensen Added printout to stop() + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -54,7 +52,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); private BundleContext ctx; @@ -116,17 +115,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/CAVELocalizationAdapter.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/CAVELocalizationAdapter.java index 16dbfe73ad..4739a98450 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/CAVELocalizationAdapter.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/CAVELocalizationAdapter.java @@ -141,7 +141,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter { if (file.exists()) { return file; } else { - File bundleFile = null; + File bundleFile = file; // Default to base location boolean containsKey = false; synchronized (caveStaticBaseFiles) { containsKey = caveStaticBaseFiles.containsKey(fileName); diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/HierarchicalPreferenceStore.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/HierarchicalPreferenceStore.java index f3d06b4e11..66eaef9509 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/HierarchicalPreferenceStore.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/HierarchicalPreferenceStore.java @@ -20,58 +20,51 @@ package com.raytheon.uf.viz.core.localization; -import java.io.File; import java.io.IOException; -import java.io.PrintWriter; +import java.io.InputStream; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; -import java.util.NoSuchElementException; +import java.util.Map; +import java.util.Set; -import org.apache.commons.configuration.CombinedConfiguration; -import org.apache.commons.configuration.ConversionException; +import javax.measure.converter.ConversionException; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.MapConfiguration; import org.apache.commons.configuration.XMLConfiguration; -import org.apache.commons.configuration.tree.OverrideCombiner; +import org.eclipse.core.runtime.Plugin; import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.util.SafeRunnable; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import com.raytheon.uf.common.localization.FileLocker; -import com.raytheon.uf.common.localization.FileLocker.Type; import com.raytheon.uf.common.localization.FileUpdatedMessage; import com.raytheon.uf.common.localization.ILocalizationFileObserver; import com.raytheon.uf.common.localization.IPathManager; -import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.LocalizationFileOutputStream; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.core.exception.VizException; /** * Defines a hierarchical preference store, backed by Apache Commons - * configurator. - * - *
- * Three scopes are defined, in order of increasing precedence: - *
* SOFTWARE HISTORY @@ -80,6 +73,8 @@ import com.raytheon.uf.viz.core.exception.VizException; * Apr 16, 2007 chammack Initial Creation. * Feb 5, 2008 chammack Add API to support set/remove at any tier * and support for listeners + * Feb 27, 2014 2861 mschenke Rewrote to add thread safety and handle + * all LocalizationLevels * ** @@ -90,25 +85,99 @@ public class HierarchicalPreferenceStore implements IPersistentPreferenceStore { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(HierarchicalPreferenceStore.class, "CAVE"); - public static enum Level { - USER, SITE, BASE, COMBINED - }; + private static class LocalizationConfiguration { - private CombinedConfiguration combinedConfiguration; + private final LocalizationFile file; - private CombinedConfiguration localConfiguration; + private XMLConfiguration config; - private LocalizationFile userFile; + private boolean loaded = false; - private XMLConfiguration userConfiguration; + private boolean dirty = false; - private XMLConfiguration baseConfiguration; + public LocalizationConfiguration(LocalizationFile file) { + this.file = file; + this.config = new XMLConfiguration(); + } - private XMLConfiguration siteConfiguration; + public XMLConfiguration accessConfiguration() { + if (loaded == false) { + // Loaded flag is used for first access + loaded = true; + try { + reload(); + } catch (LocalizationException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + return config; + } - private final List
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(Activator.class); // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.d2d.ui"; @@ -42,7 +50,8 @@ public class Activator extends AbstractUIPlugin { private static Activator plugin; // pref store - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -88,17 +97,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - statusHandler.handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.gisdatastore.directory/src/com/raytheon/uf/viz/gisdatastore/directory/Activator.java b/cave/com.raytheon.uf.viz.gisdatastore.directory/src/com/raytheon/uf/viz/gisdatastore/directory/Activator.java index 5deb1993a0..42a71a20d9 100644 --- a/cave/com.raytheon.uf.viz.gisdatastore.directory/src/com/raytheon/uf/viz/gisdatastore/directory/Activator.java +++ b/cave/com.raytheon.uf.viz.gisdatastore.directory/src/com/raytheon/uf/viz/gisdatastore/directory/Activator.java @@ -23,10 +23,8 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -38,7 +36,8 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 12, 2012 #1326 randerso Initial creation + * Nov 12, 2012 #1326 randerso Initial creation + * Mar 3, 2014 #2861 mschenke Create preference store immediately * * * @@ -49,15 +48,16 @@ public class Activator extends AbstractUIPlugin { public static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(Activator.class); - // pref store - private HierarchicalPreferenceStore prefs; - // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.gisdatastore.directory"; //$NON-NLS-1$ // The shared instance private static Activator plugin; + // pref store + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); + /** * The constructor */ @@ -106,17 +106,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - statusHandler.handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.gisdatastore/src/com/raytheon/uf/viz/gisdatastore/Activator.java b/cave/com.raytheon.uf.viz.gisdatastore/src/com/raytheon/uf/viz/gisdatastore/Activator.java index def8d10277..f634de55f9 100644 --- a/cave/com.raytheon.uf.viz.gisdatastore/src/com/raytheon/uf/viz/gisdatastore/Activator.java +++ b/cave/com.raytheon.uf.viz.gisdatastore/src/com/raytheon/uf/viz/gisdatastore/Activator.java @@ -23,10 +23,8 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -38,7 +36,8 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 12, 2012 #1326 randerso Initial creation + * Nov 12, 2012 #1326 randerso Initial creation + * Mar 3, 2014 #2861 mschenke Create preference store immediately * * * @@ -49,15 +48,16 @@ public class Activator extends AbstractUIPlugin { public static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(Activator.class); - // pref store - private HierarchicalPreferenceStore prefs; - // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.gisdatastore"; //$NON-NLS-1$ // The shared instance private static Activator plugin; + // pref store + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); + /** * The constructor */ @@ -106,17 +106,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - statusHandler.handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/Activator.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/Activator.java index 37d475d24f..9b951c6f9d 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/Activator.java +++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/Activator.java @@ -22,13 +22,24 @@ package com.raytheon.uf.viz.monitor.scan; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { @@ -38,7 +49,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -88,17 +100,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/Activator.java b/cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/Activator.java index d6e56f8d8d..de6f5052b7 100644 --- a/cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/Activator.java +++ b/cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/Activator.java @@ -23,24 +23,36 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { - private HierarchicalPreferenceStore prefs; - // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.monitor"; // The shared instance private static Activator plugin; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); + /** * The constructor */ @@ -101,17 +113,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/activator/Activator.java b/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/activator/Activator.java index 741724171d..02f019d311 100644 --- a/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/activator/Activator.java +++ b/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/activator/Activator.java @@ -23,9 +23,6 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -37,7 +34,8 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 21, 2009 mfegan Initial creation + * Apr 21, 2009 mfegan Initial creation + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -52,7 +50,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private IPersistentPreferenceStore prefs; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * Constructor. @@ -95,17 +94,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/Activator.java b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/Activator.java index 6e5e8fd46b..2be4438732 100644 --- a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/Activator.java +++ b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/Activator.java @@ -25,9 +25,6 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.preferences.ScopedPreferenceStore; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -39,7 +36,9 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 20, 2011 mschenke Initial creation + * Oct 20, 2011 mschenke Initial creation + * Mar 3, 2014 2861 mschenke Create preference store immediately + * * * * @@ -58,7 +57,8 @@ public class Activator extends AbstractUIPlugin { private BundleContext ctx; // General preference store - private IPersistentPreferenceStore prefs; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); // Preferences for UI private HierarchicalPreferenceStore uiPrefs; @@ -134,14 +134,6 @@ public class Activator extends AbstractUIPlugin { * @return */ public HierarchicalPreferenceStore getUiPreferenceStore() { - if (uiPrefs == null) { - try { - uiPrefs = new HierarchicalPreferenceStore(this); - } catch (LocalizationException e) { - UFStatus.getHandler(Activator.class).handle(Priority.PROBLEM, - "Error constructing hierarchical preferences", e); - } - } return uiPrefs; } diff --git a/cave/com.raytheon.uf.viz.xy/src/com/raytheon/uf/viz/xy/Activator.java b/cave/com.raytheon.uf.viz.xy/src/com/raytheon/uf/viz/xy/Activator.java index c8eee4c574..d3496e7453 100644 --- a/cave/com.raytheon.uf.viz.xy/src/com/raytheon/uf/viz/xy/Activator.java +++ b/cave/com.raytheon.uf.viz.xy/src/com/raytheon/uf/viz/xy/Activator.java @@ -23,27 +23,39 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { public static final String MAP_DISPLAY_DENSITY = "mapDisplayDensity"; - + public static final String MAP_DISPLAY_WIDTH = "mapDisplayWidth"; - + // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.uf.viz.xy"; // The shared instance private static Activator plugin; - private IPersistentPreferenceStore prefs = null; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -91,17 +103,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/activator/Activator.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/activator/Activator.java index 7fbe581a54..caa15f1536 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/activator/Activator.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/activator/Activator.java @@ -23,9 +23,6 @@ package com.raytheon.viz.aviation.activator; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -38,6 +35,7 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 1/21/2008 817 grichard Initial creation. + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -54,7 +52,8 @@ public class Activator extends AbstractUIPlugin { private static Activator plugin; /** preference store to read in the config XML */ - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -102,17 +101,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/Activator.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/Activator.java index aea20f3d81..322f588c5b 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/Activator.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/Activator.java @@ -22,24 +22,36 @@ package com.raytheon.viz.avnconfig; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { - private HierarchicalPreferenceStore prefs; - // The plug-in ID public static final String PLUGIN_ID = "com.raytheon.viz.avnconfig"; // The shared instance private static Activator plugin; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); + /** * The constructor */ @@ -88,17 +100,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/Activator.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/Activator.java index 42a74c7483..580bc64f3c 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/Activator.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/Activator.java @@ -23,14 +23,26 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { @@ -44,7 +56,8 @@ public class Activator extends AbstractUIPlugin { private static Activator plugin; // The preference store - private IPersistentPreferenceStore prefs; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -92,17 +105,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - statusHandler.handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/CorePlugin.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/CorePlugin.java index 5de652baeb..2111aefac1 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/CorePlugin.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/CorePlugin.java @@ -22,13 +22,9 @@ package com.raytheon.viz.core; import javax.media.jai.ParameterBlockJAI; -import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -41,6 +37,7 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 7/1/06 chammack Initial Creation. + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -54,7 +51,8 @@ public class CorePlugin extends AbstractUIPlugin { // The shared instance. private static CorePlugin plugin; - private IPersistentPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); private BundleContext ctx; @@ -109,18 +107,7 @@ public class CorePlugin extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - - return (HierarchicalPreferenceStore) prefs; + return prefs; } } diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/Activator.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/Activator.java index 8657f03726..72b05db8c6 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/Activator.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/Activator.java @@ -22,13 +22,24 @@ package com.raytheon.viz.radar; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { @@ -38,7 +49,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -86,17 +98,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/UiPlugin.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/UiPlugin.java index 7c7819213b..ebf3b70633 100644 --- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/UiPlugin.java +++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/UiPlugin.java @@ -25,9 +25,6 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; import com.raytheon.viz.ui.jobs.MemoryMonitorJob; import com.raytheon.viz.ui.panes.DrawCoordinatorJob; @@ -44,7 +41,7 @@ import com.raytheon.viz.ui.panes.DrawCoordinatorJob; * Oct 24, 2012 2491 bsteffen Do not start DrawCoordinatorJob during * activation to allow activation before * localization is set. - * + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -58,7 +55,8 @@ public class UiPlugin extends AbstractUIPlugin { // The shared instance. private static UiPlugin plugin; - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); private final Job memoryWatchJob = new MemoryMonitorJob(); @@ -116,17 +114,6 @@ public class UiPlugin extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/Activator.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/Activator.java index a650cf85b9..771ec7f2d6 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/Activator.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/Activator.java @@ -23,9 +23,6 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** @@ -36,6 +33,7 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 26, 2007 chammack Initial Creation. + * Mar 3, 2014 2861 mschenke Create preference store immediately * * * @@ -50,7 +48,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private IPersistentPreferenceStore prefs; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -98,17 +97,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } diff --git a/cave/ohd.hseb.monitor/src/com/raytheon/monitor/activator/Activator.java b/cave/ohd.hseb.monitor/src/com/raytheon/monitor/activator/Activator.java index 357e0b860c..7a2f34e2e2 100755 --- a/cave/ohd.hseb.monitor/src/com/raytheon/monitor/activator/Activator.java +++ b/cave/ohd.hseb.monitor/src/com/raytheon/monitor/activator/Activator.java @@ -4,13 +4,24 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { @@ -20,7 +31,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private IPersistentPreferenceStore prefs; + private IPersistentPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -70,17 +82,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public IPersistentPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; } } diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncradar/src/gov/noaa/nws/ncep/viz/rsc/ncradar/Activator.java b/ncep/gov.noaa.nws.ncep.viz.rsc.ncradar/src/gov/noaa/nws/ncep/viz/rsc/ncradar/Activator.java index f3ee9eca21..1935205c19 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.ncradar/src/gov/noaa/nws/ncep/viz/rsc/ncradar/Activator.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.ncradar/src/gov/noaa/nws/ncep/viz/rsc/ncradar/Activator.java @@ -3,13 +3,24 @@ package gov.noaa.nws.ncep.viz.rsc.ncradar; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore; /** + * * The activator class controls the plug-in life cycle + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Mar 3, 2014 2861 mschenke Create preference store immediately + * + *+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin { @@ -19,7 +30,8 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private HierarchicalPreferenceStore prefs; + private HierarchicalPreferenceStore prefs = new HierarchicalPreferenceStore( + this); /** * The constructor @@ -67,17 +79,6 @@ public class Activator extends AbstractUIPlugin { */ @Override public HierarchicalPreferenceStore getPreferenceStore() { - try { - if (prefs == null) { - prefs = new HierarchicalPreferenceStore(this); - } - } catch (LocalizationException e) { - UFStatus.getHandler().handle( - Priority.PROBLEM, - "Error reading preference store: " - + e.getLocalizedMessage(), e); - } - return prefs; }