diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/Activator.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/Activator.java
index 22935ed47f..fc000e6df5 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/Activator.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/Activator.java
@@ -12,10 +12,16 @@
*******************************************************************************/
package org.eclipse.wildwebdeveloper;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.eclipse.wildwebdeveloper.css.CSSLanguageServer;
+import org.eclipse.wildwebdeveloper.html.HTMLLanguageServer;
+import org.eclipse.wildwebdeveloper.yaml.YAMLLanguageServer;
import org.osgi.framework.BundleContext;
/**
@@ -28,6 +34,12 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
+
+ private ScopedPreferenceStore cssPreferenceStore;
+
+ private ScopedPreferenceStore htmlPreferenceStore;
+
+ private ScopedPreferenceStore yamlPreferenceStore;
/**
* The constructor
@@ -57,8 +69,8 @@ public static Activator getDefault() {
}
/**
- * Returns the currently active workbench window shell or null
- * if none.
+ * Returns the currently active workbench window shell or null
if
+ * none.
*
* @return the currently active workbench window shell or null
*/
@@ -69,10 +81,69 @@ public static Shell getShell() {
if (windows.length > 0) {
return windows[0].getShell();
}
- }
- else {
+ } else {
return window.getShell();
}
return null;
}
+
+ /**
+ * Returns the CSS preference store.
+ *
+ * @return the CSS preference store.
+ */
+ public IPreferenceStore getCSSPreferenceStore() {
+ // Create the preference store lazily.
+ ScopedPreferenceStore result = cssPreferenceStore;
+ if (result == null) { // First check (no locking)
+ synchronized (this) {
+ result = cssPreferenceStore;
+ if (result == null) { // Second check (with locking)
+ cssPreferenceStore = result = new ScopedPreferenceStore(InstanceScope.INSTANCE,
+ CSSLanguageServer.LANGUAGE_SERVER_ID);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Returns the HTML preference store.
+ *
+ * @return the HTML preference store.
+ */
+ public IPreferenceStore getHTMLPreferenceStore() {
+ // Create the preference store lazily.
+ ScopedPreferenceStore result = htmlPreferenceStore;
+ if (result == null) { // First check (no locking)
+ synchronized (this) {
+ result = htmlPreferenceStore;
+ if (result == null) { // Second check (with locking)
+ htmlPreferenceStore = result = new ScopedPreferenceStore(InstanceScope.INSTANCE,
+ HTMLLanguageServer.LANGUAGE_SERVER_ID);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Returns the YAML preference store.
+ *
+ * @return the YAML preference store.
+ */
+ public IPreferenceStore getYAMLPreferenceStore() {
+ // Create the preference store lazily.
+ ScopedPreferenceStore result = yamlPreferenceStore;
+ if (result == null) { // First check (no locking)
+ synchronized (this) {
+ result = yamlPreferenceStore;
+ if (result == null) { // Second check (with locking)
+ yamlPreferenceStore = result = new ScopedPreferenceStore(InstanceScope.INSTANCE,
+ YAMLLanguageServer.LANGUAGE_SERVER_ID);
+ }
+ }
+ }
+ return result;
+ }
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/CSSLanguageServer.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/CSSLanguageServer.java
index 57f47b7ae2..6fb469de4b 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/CSSLanguageServer.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/CSSLanguageServer.java
@@ -32,12 +32,12 @@
public class CSSLanguageServer extends ProcessStreamConnectionProviderWithPreference {
- private static final String CSS_LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.css";
+ public static final String LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.css";
private static final String[] SUPPORTED_SECTIONS = { "css", "scss", "less" };
public CSSLanguageServer() {
- super(CSS_LANGUAGE_SERVER_ID, Activator.getDefault().getPreferenceStore(), SUPPORTED_SECTIONS);
+ super(LANGUAGE_SERVER_ID, Activator.getDefault().getCSSPreferenceStore(), SUPPORTED_SECTIONS);
List commands = new ArrayList<>();
commands.add(NodeJSManager.getNodeJsLocation().getAbsolutePath());
try {
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSCompletionPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSCompletionPreferencePage.java
index 804d322c42..39f18437d6 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSCompletionPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSCompletionPreferencePage.java
@@ -43,6 +43,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSFormatPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSFormatPreferencePage.java
index b3b4760538..ddbfeace86 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSFormatPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSFormatPreferencePage.java
@@ -58,6 +58,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSHoverPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSHoverPreferencePage.java
index 0806bc2228..067f3559fd 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSHoverPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSHoverPreferencePage.java
@@ -42,6 +42,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferencePage.java
index dae742b293..4733ebb4ac 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferencePage.java
@@ -29,7 +29,7 @@ public CSSPreferencePage() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
@Override
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferenceServerConstants.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferenceServerConstants.java
index 7becc03c42..be83e619c6 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferenceServerConstants.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSPreferenceServerConstants.java
@@ -70,7 +70,7 @@ public class CSSPreferenceServerConstants {
public static final String CSS_PREFERENCES_LINT_UNKNOWNATRULES = "css.lint.unknownAtRules";
public static Settings getGlobalSettings() {
- Settings settings = new Settings(Activator.getDefault().getPreferenceStore());
+ Settings settings = new Settings(getPreferenceStore());
// Completion settings
settings.fillAsBoolean(CSS_PREFERENCES_COMPLETION_TRIGGER_PROPERTY_VALUE_COMPLETION);
@@ -117,7 +117,7 @@ public static Settings getGlobalSettings() {
}
public static void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ IPreferenceStore store = getPreferenceStore();
// Server settings
@@ -174,4 +174,14 @@ public static void initializeDefaultPreferences() {
public static boolean isMatchCssSection(String section) {
return isMatchSection(section, CSS_SECTION);
}
+
+ /**
+ * Returns the CSS preference store.
+ *
+ * @return the CSS preference store.
+ */
+ public static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSValidationPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSValidationPreferencePage.java
index 7e3f94d631..53ba793725 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSValidationPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/CSSValidationPreferencePage.java
@@ -101,6 +101,6 @@ private void addSeverityField(String name, String labelText) {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSCompletionPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSCompletionPreferencePage.java
index 4efb188c3d..b181e728e8 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSCompletionPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSCompletionPreferencePage.java
@@ -43,6 +43,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSFormatPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSFormatPreferencePage.java
index 0873c65652..442b86080d 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSFormatPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSFormatPreferencePage.java
@@ -58,6 +58,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSHoverPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSHoverPreferencePage.java
index 6685b8d611..991cf91750 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSHoverPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSHoverPreferencePage.java
@@ -42,6 +42,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferencePage.java
index df2495cc1a..53631486d1 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferencePage.java
@@ -29,7 +29,7 @@ public LESSPreferencePage() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
@Override
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferenceServerConstants.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferenceServerConstants.java
index 3a1c1b5e9e..e4c11007c3 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferenceServerConstants.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSPreferenceServerConstants.java
@@ -70,7 +70,7 @@ public class LESSPreferenceServerConstants {
public static final String LESS_PREFERENCES_LINT_UNKNOWNATRULES = "less.lint.unknownAtRules";
public static Settings getGlobalSettings() {
- Settings settings = new Settings(Activator.getDefault().getPreferenceStore());
+ Settings settings = new Settings(Activator.getDefault().getCSSPreferenceStore());
// Completion settings
settings.fillAsBoolean(LESS_PREFERENCES_COMPLETION_TRIGGER_PROPERTY_VALUE_COMPLETION);
@@ -117,7 +117,7 @@ public static Settings getGlobalSettings() {
}
public static void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ IPreferenceStore store = Activator.getDefault().getCSSPreferenceStore();
// Server settings
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSValidationPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSValidationPreferencePage.java
index bb820a72cc..1f6ea799bb 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSValidationPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/less/LESSValidationPreferencePage.java
@@ -102,6 +102,6 @@ private void addSeverityField(String name, String labelText) {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSCompletionPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSCompletionPreferencePage.java
index 1f866366a2..e06bdcacae 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSCompletionPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSCompletionPreferencePage.java
@@ -43,6 +43,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSFormatPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSFormatPreferencePage.java
index 65c5da3ddb..a6d9b65442 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSFormatPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSFormatPreferencePage.java
@@ -58,6 +58,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSHoverPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSHoverPreferencePage.java
index 86390062d7..93c9afa152 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSHoverPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSHoverPreferencePage.java
@@ -42,6 +42,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferencePage.java
index 8dd5f06966..ca9cf4fcf3 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferencePage.java
@@ -29,7 +29,7 @@ public SCSSPreferencePage() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
@Override
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferenceServerConstants.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferenceServerConstants.java
index b0002df05f..e55298aae2 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferenceServerConstants.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSPreferenceServerConstants.java
@@ -70,7 +70,7 @@ public class SCSSPreferenceServerConstants {
public static final String SCSS_PREFERENCES_LINT_UNKNOWNATRULES = "scss.lint.unknownAtRules";
public static Settings getGlobalSettings() {
- Settings settings = new Settings(Activator.getDefault().getPreferenceStore());
+ Settings settings = new Settings(Activator.getDefault().getCSSPreferenceStore());
// Completion settings
settings.fillAsBoolean(SCSS_PREFERENCES_COMPLETION_TRIGGER_PROPERTY_VALUE_COMPLETION);
@@ -117,7 +117,7 @@ public static Settings getGlobalSettings() {
}
public static void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ IPreferenceStore store = Activator.getDefault().getCSSPreferenceStore();
// Server settings
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSValidationPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSValidationPreferencePage.java
index 4787f4fac3..b0d210b9f4 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSValidationPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/css/ui/preferences/scss/SCSSValidationPreferencePage.java
@@ -102,6 +102,6 @@ private void addSeverityField(String name, String labelText) {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getCSSPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/HTMLLanguageServer.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/HTMLLanguageServer.java
index 656cdb13cc..493c997a78 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/HTMLLanguageServer.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/HTMLLanguageServer.java
@@ -34,12 +34,12 @@
*/
public class HTMLLanguageServer extends ProcessStreamConnectionProviderWithPreference {
- private static final String HTML_LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.html";
+ public static final String LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.html";
private static final String[] SUPPORTED_SECTIONS = { "html", "css", "javascript" };
public HTMLLanguageServer() {
- super(HTML_LANGUAGE_SERVER_ID, Activator.getDefault().getPreferenceStore(), SUPPORTED_SECTIONS);
+ super(LANGUAGE_SERVER_ID, Activator.getDefault().getHTMLPreferenceStore(), SUPPORTED_SECTIONS);
List commands = new ArrayList<>();
commands.add(NodeJSManager.getNodeJsLocation().getAbsolutePath());
try {
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java
index ad47b33698..9df2e4a1fd 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java
@@ -139,11 +139,11 @@ private void autoInsert(DocumentEvent event) {
}
private boolean isAutoClosingTagEnabled() {
- return Activator.getDefault().getPreferenceStore().getBoolean(HTML_PREFERENCES_AUTO_CLOSING_TAGS);
+ return Activator.getDefault().getHTMLPreferenceStore().getBoolean(HTML_PREFERENCES_AUTO_CLOSING_TAGS);
}
private boolean isAutoCreateQuotesEnabled() {
- return Activator.getDefault().getPreferenceStore().getBoolean(HTML_PREFERENCES_AUTO_CREATE_QUOTES);
+ return Activator.getDefault().getHTMLPreferenceStore().getBoolean(HTML_PREFERENCES_AUTO_CREATE_QUOTES);
}
/**
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLCompletionPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLCompletionPreferencePage.java
index 465047474c..e6b00c56c6 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLCompletionPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLCompletionPreferencePage.java
@@ -50,6 +50,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getHTMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLFormatPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLFormatPreferencePage.java
index ccbce90d8c..c462cdbbce 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLFormatPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLFormatPreferencePage.java
@@ -80,6 +80,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getHTMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLHoverPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLHoverPreferencePage.java
index 5fedd80753..a5b8ddf22c 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLHoverPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLHoverPreferencePage.java
@@ -42,6 +42,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getHTMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferencePage.java
index c08b428cb7..6fd7bea3fb 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferencePage.java
@@ -32,17 +32,16 @@ public HTMLPreferencePage() {
super(GRID);
}
- @Override
- public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
- }
-
@Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(HTML_PREFERENCES_AUTO_CLOSING_TAGS, Messages.HTMLPreferencePage_autoClosingTags,
getFieldEditorParent()));
addField(new BooleanFieldEditor(HTML_PREFERENCES_AUTO_CREATE_QUOTES,
Messages.HTMLPreferencePage_autoCreateQuotes, getFieldEditorParent()));
+ }
+ @Override
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getHTMLPreferenceStore());
}
}
\ No newline at end of file
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferenceServerConstants.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferenceServerConstants.java
index 1afdf7c0e9..297858599b 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferenceServerConstants.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLPreferenceServerConstants.java
@@ -55,7 +55,7 @@ public class HTMLPreferenceServerConstants {
public static final String HTML_PREFERENCES_VALIDATE_STYLES = "html.validate.styles";
public static Settings getGlobalSettings() {
- Settings settings = new Settings(Activator.getDefault().getPreferenceStore());
+ Settings settings = new Settings(Activator.getDefault().getHTMLPreferenceStore());
// Completion settings
settings.fillAsString(HTML_PREFERENCES_COMPLETION_ATTRIBUTE_DEFAULT_VALUE);
@@ -89,7 +89,7 @@ public static Settings getGlobalSettings() {
}
public static void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ IPreferenceStore store = Activator.getDefault().getHTMLPreferenceStore();
// Client settings
store.setDefault(HTML_PREFERENCES_AUTO_CLOSING_TAGS, true);
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLValidationPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLValidationPreferencePage.java
index 3b4a4d9446..3d58b74ea0 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLValidationPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/ui/preferences/HTMLValidationPreferencePage.java
@@ -42,6 +42,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getHTMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/YAMLLanguageServer.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/YAMLLanguageServer.java
index 0b3dc5e080..5718cd660e 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/YAMLLanguageServer.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/YAMLLanguageServer.java
@@ -36,12 +36,12 @@
*/
public class YAMLLanguageServer extends ProcessStreamConnectionProviderWithPreference {
- private static final String YAML_LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.yaml";
+ public static final String LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.yaml";
private static final String[] SUPPORTED_SECTIONS = { "yaml" };
public YAMLLanguageServer() {
- super(YAML_LANGUAGE_SERVER_ID, Activator.getDefault().getPreferenceStore(), SUPPORTED_SECTIONS);
+ super(LANGUAGE_SERVER_ID, Activator.getDefault().getYAMLPreferenceStore(), SUPPORTED_SECTIONS);
List commands = new ArrayList<>();
commands.add(NodeJSManager.getNodeJsLocation().getAbsolutePath());
try {
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLCompletionPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLCompletionPreferencePage.java
index ba82088a04..cae36cb0ae 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLCompletionPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLCompletionPreferencePage.java
@@ -45,6 +45,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getYAMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLFormatPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLFormatPreferencePage.java
index 4a410e6d42..ffcc8909c2 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLFormatPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLFormatPreferencePage.java
@@ -59,6 +59,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getYAMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLHoverPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLHoverPreferencePage.java
index 8586ce1169..e602727cf4 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLHoverPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLHoverPreferencePage.java
@@ -39,6 +39,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getYAMLPreferenceStore());
}
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferencePage.java
index a57dd5fa4c..089345901a 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferencePage.java
@@ -66,11 +66,6 @@ public void widgetSelected(SelectionEvent e) {
return composite;
}
- @Override
- public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
- }
-
@Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(YAML_PREFERENCES_SCHEMASTORE_ENABLE,
@@ -81,4 +76,9 @@ protected void createFieldEditors() {
getFieldEditorParent()));
}
+
+ @Override
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getYAMLPreferenceStore());
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferenceServerConstants.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferenceServerConstants.java
index ecd51b5c26..1294b2ce0f 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferenceServerConstants.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLPreferenceServerConstants.java
@@ -68,7 +68,7 @@ public class YAMLPreferenceServerConstants {
public static final String YAML_PREFERENCES_STYLE_FLOWSEQUENCE = "yaml.style.flowSequence";
public static Settings getGlobalSettings() {
- Settings settings = new Settings(getPreferenceStore());
+ Settings settings = new Settings(Activator.getDefault().getYAMLPreferenceStore());
settings.fillSetting(YAML_PREFERENCES_SCHEMAS,
getSchemaAssociations(Activator.getDefault().getPreferenceStore()));
@@ -103,7 +103,7 @@ public static Settings getGlobalSettings() {
}
public static void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ IPreferenceStore store = Activator.getDefault().getYAMLPreferenceStore();
// Server settings
store.setDefault(YAML_PREFERENCES_SCHEMASTORE_ENABLE, true);
@@ -191,7 +191,4 @@ private static Map getSchemaAssociations(IPreferenceStore prefer
return associations;
}
- public static IPreferenceStore getPreferenceStore() {
- return Activator.getDefault().getPreferenceStore();
- }
}
diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLValidationPreferencePage.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLValidationPreferencePage.java
index a7a176184d..be2a2c78e8 100644
--- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLValidationPreferencePage.java
+++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/yaml/ui/preferences/YAMLValidationPreferencePage.java
@@ -57,6 +57,6 @@ public void createFieldEditors() {
@Override
public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setPreferenceStore(Activator.getDefault().getYAMLPreferenceStore());
}
}