public static Logger log;
/** Jalview Properties */
- public static Properties applicationProperties = new Properties()
+ private static Properties applicationProperties = new Properties()
{
// override results in properties output in alphabetical order
@Override
*/
public static void loadProperties(String propsFile)
{
+ /* for JalviewJS should be
+
+ getInstance().
+
+ */
+ loadPropertiesImpl(propsFile);
+
+ }
+
+ private /* JalviewJS should not be static */
+ static //
+ void loadPropertiesImpl(String propsFile)
+ {
+
propertiesFile = propsFile;
if (propsFile == null && !propsAreReadOnly)
{
*/
public static String getProperty(String key)
{
- String prop = applicationProperties.getProperty(key);
- if (prop == null && Platform.isJS())
- {
- prop = applicationProperties.getProperty(Platform.getUniqueAppletID()
- + "_" + JS_PROPERTY_PREFIX + key);
- }
+ String prop = /* for JalviewJS should be
+
+ getInstance().
+
+ */
+ applicationProperties.getProperty(key);
+// if (prop == null && Platform.isJS())
+// {
+// prop = applicationProperties.getProperty(Platform.getUniqueAppletID()
+// + "_" + JS_PROPERTY_PREFIX + key);
+// }
return prop;
}
}
/**
- * remove the specified property from the jalview properties file
+ * Removes the specified property from the jalview properties file
*
- * @param string
+ * @param key
+ */
+ public static void removeProperty(String key)
+ {
+ /* for JalviewJS should be
+
+ getInstance().
+
+ */
+ removePropertyImpl(key, true);
+ }
+
+ /**
+ * Removes the named property for the running application, without saving the
+ * properties file
+ *
+ * BH noting that ColourMenuHelper calls this. If the intent is to save,
+ * then simply chanet that call to removeProperty(key).
+ *
+ * @param key
+ */
+ public static void removePropertyNoSave(String key)
+ {
+ /* for JalviewJS should be
+
+ getInstance().
+
+ */
+ removePropertyImpl(key, false);
+ }
+
+ /**
+ * Removes the named property, and optionally saves the current properties to
+ * file
+ *
+ * @param key
+ * @param andSave
*/
- public static void removeProperty(String string)
+ private /* JalviewJS should not be static */
+ static //
+ void removePropertyImpl(String key, boolean andSave)
{
- applicationProperties.remove(string);
- saveProperties();
+ applicationProperties.remove(key);
+ if (andSave)
+ saveProperties();
}
/**
{
if (coloursFound.toString().length() > 1)
{
+ /* for JalviewJS should be
+
+ getInstance().
+
+ */
setProperty(UserDefinedColours.USER_DEFINED_COLOURS,
coloursFound.toString());
}
/**
*
- * For AppletParams
+ * For AppletParams and Preferences ok_actionPerformed and startupFileTextfield_mouseClicked
*
* Sets a property value for the running application, without saving it to the
* properties file