aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Ptaszkiewicz2014-01-20 13:32:15 (EST)
committerGerrit Code Review @ Eclipse.org2014-02-07 07:51:48 (EST)
commitbca16bb90252d1b3ba8f9ee273765f3a7d780597 (patch)
tree3ec0f4e125daae3df7a833139fa6c41460119fac
parent6f8aff7dc62a4cd3f18cf8fcf2f1f5c7659813ee (diff)
downloadeclipse.platform.runtime-bca16bb90252d1b3ba8f9ee273765f3a7d780597.zip
eclipse.platform.runtime-bca16bb90252d1b3ba8f9ee273765f3a7d780597.tar.gz
eclipse.platform.runtime-bca16bb90252d1b3ba8f9ee273765f3a7d780597.tar.bz2
Bug 122217 - [content type] cannot import user defined associationsI20140211-1100I20140211-0800I20140209-1458refs/changes/33/20833/3
Change-Id: Id3e7dbec380c0bc2876234df94f474cb19855bed Signed-off-by: Szymon Ptaszkiewicz <szymon.ptaszkiewicz@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.core.contenttype/plugin.xml5
-rw-r--r--bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/PreferenceModifyListener.java32
2 files changed, 36 insertions, 1 deletions
diff --git a/bundles/org.eclipse.core.contenttype/plugin.xml b/bundles/org.eclipse.core.contenttype/plugin.xml
index a6f0e3a..915521a 100644
--- a/bundles/org.eclipse.core.contenttype/plugin.xml
+++ b/bundles/org.eclipse.core.contenttype/plugin.xml
@@ -25,5 +25,8 @@
file-extensions="properties">
<property name="org.eclipse.core.runtime.charset" default="ISO-8859-1"/>
</content-type>
- </extension>
+ </extension>
+ <extension point="org.eclipse.equinox.preferences.preferences">
+ <modifier class="org.eclipse.core.internal.content.PreferenceModifyListener"/>
+ </extension>
</plugin>
diff --git a/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/PreferenceModifyListener.java b/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/PreferenceModifyListener.java
new file mode 100644
index 0000000..c234d37
--- /dev/null
+++ b/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/PreferenceModifyListener.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.content;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+public class PreferenceModifyListener extends org.eclipse.core.runtime.preferences.PreferenceModifyListener {
+ public IEclipsePreferences preApply(IEclipsePreferences node) {
+ Preferences root = node.node("/"); //$NON-NLS-1$
+ try {
+ if (root.nodeExists(InstanceScope.SCOPE)) {
+ Preferences instance = root.node(InstanceScope.SCOPE);
+ if (instance.nodeExists(ContentTypeManager.CONTENT_TYPE_PREF_NODE))
+ ContentTypeManager.getInstance().invalidate();
+ }
+ } catch (BackingStoreException e) {
+ // do nothing
+ }
+ return node;
+ }
+}