Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.emf.compare-parent/pom.xml3
-rw-r--r--packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java27
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java46
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java19
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/plugin.xml10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java23
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/schema/accessorFactory.exsd (renamed from plugins/org.eclipse.emf.compare.ide.ui/schema/accessor_factory.exsd)2
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java75
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/handler/AbstractCompareHandler.java7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java5
-rw-r--r--plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.ide/plugin.xml36
-rw-r--r--plugins/org.eclipse.emf.compare.ide/schema/ModelResolver.exsd166
-rw-r--r--plugins/org.eclipse.emf.compare.ide/schema/loadOnDemandPolicy.exsd (renamed from plugins/org.eclipse.emf.compare.ide/schema/load_on_demand_policy.exsd)2
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java95
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java152
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorIDEDescriptor.java93
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java121
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/policy/LoadOnDemandPolicyRegistryListener.java69
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/.settings/.api_filters8
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java167
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/DifferenceGroupProviderExtensionRegistryListener.java109
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/FilterExtensionRegistryListener.java107
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java249
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.classpath7
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.project28
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.core.prefs374
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.ui.prefs60
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF17
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/build.properties10
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/plugin.properties13
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/plugin.xml49
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/pom.xml24
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/schema/merger.exsd (renamed from plugins/org.eclipse.emf.compare.ide/schema/MergerExtension.exsd)258
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/schema/postProcessor.exsd (renamed from plugins/org.eclipse.emf.compare.ide/schema/PostProcess.exsd)308
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java134
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/AbstractRegistryEventListener.java (renamed from plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/AbstractRegistryEventListener.java)157
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/PluginClassDescriptor.java71
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/EMFCompareRCPMessages.java (renamed from plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEMessages.java)13
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/emfcomparercpmessages.properties (renamed from plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/emfcompareidemessages.properties)5
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/merger/MergerExtensionRegistryListener.java164
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorDescriptor.java136
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorRegistryListener.java134
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java62
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java45
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide/plugin.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java11
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/plugin.xml10
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java40
-rw-r--r--plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java16
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java95
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java116
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/AbstractPostProcessor.java54
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/IPostProcessor.java (renamed from plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java)87
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/PostProcessorRegistryImpl.java110
73 files changed, 2595 insertions, 1876 deletions
diff --git a/org.eclipse.emf.compare-parent/pom.xml b/org.eclipse.emf.compare-parent/pom.xml
index 0e12c653d..66c20a149 100644
--- a/org.eclipse.emf.compare-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/pom.xml
@@ -68,8 +68,9 @@
<module>../plugins/org.eclipse.emf.compare.ide.ui.tests</module>
-->
- <!-- RCP UI -->
+ <!-- RCP -->
<module>../packaging/org.eclipse.emf.compare.rcp.ui-feature</module>
+ <module>../plugins/org.eclipse.emf.compare.rcp</module>
<module>../plugins/org.eclipse.emf.compare.rcp.ui</module>
<!-- UML -->
diff --git a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
index 876aa8cb4..80755d041 100644
--- a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
@@ -30,6 +30,13 @@
unpack="false"/>
<plugin
+ id="org.eclipse.emf.compare.rcp"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
id="org.eclipse.emf.compare.rcp.ui"
download-size="0"
install-size="0"
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
index 19f778dde..7f6474e6d 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
@@ -1,13 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ecoretools.tests;
import java.util.Iterator;
import java.util.List;
+import java.util.regex.Pattern;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.PostProcessorRegistryImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.junit.After;
@@ -21,15 +32,13 @@ public abstract class AbstractTest {
private EMFCompare emfCompare;
- private PostProcessorRegistry postProcessorRegistry;
+ private PostProcessorRegistryImpl postProcessorRegistry;
@Before
public void before() {
- postProcessorRegistry = new PostProcessorRegistry();
- postProcessorRegistry.addPostProcessor(new PostProcessorDescriptor(
- "http://www.eclipse.org/gmf/runtime/\\d.\\d.\\d/notation", null,
- "org.eclipse.emf.compare.diagram.diff.DiagramDiffExtensionPostProcessor",
- new CompareDiagramPostProcessor()));
+ postProcessorRegistry = new PostProcessorRegistryImpl();
+ postProcessorRegistry.addPostProcessor(new CompareDiagramPostProcessor(
+ Pattern.compile("http://www.eclipse.org/gmf/runtime/\\d.\\d.\\d/notation"), null));
emfCompare = EMFCompare.builder().setPostProcessorRegistry(postProcessorRegistry).build();
}
@@ -40,7 +49,7 @@ public abstract class AbstractTest {
/**
* @return the postProcessorRegistry
*/
- protected PostProcessorRegistry getPostProcessorRegistry() {
+ protected IPostProcessor.Registry getPostProcessorRegistry() {
return postProcessorRegistry;
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
index 316a911ac..1d2763151 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
@@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.8.0",
org.eclipse.ui;bundle-version="3.103.0",
org.eclipse.emf.compare.diagram;bundle-version="2.0.0",
org.eclipse.emf.compare.ide;bundle-version="3.0.0",
- org.eclipse.emf.compare.diagram.ide.ui;bundle-version="3.0.0"
+ org.eclipse.emf.compare.diagram.ide.ui;bundle-version="3.0.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
index 75cb9c1db..1849f8efd 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
@@ -1,28 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ecoretools.tests.nodechanges;
-import static com.google.common.base.Predicates.and;
-import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.changedAttribute;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
-
import java.io.IOException;
import java.util.List;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ide.ecoretools.tests.nodechanges.data.NodeChangesInputData;
import org.eclipse.emf.compare.diagram.ide.ui.internal.CompareDiagramIDEUIPlugin;
import org.eclipse.emf.compare.diagram.internal.CompareDiagramConstants;
import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-import org.eclipse.emf.compare.ide.EMFCompareIDE;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Before;
@@ -30,6 +32,16 @@ import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.base.Predicates.and;
+import static com.google.common.base.Predicates.instanceOf;
+
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.changedAttribute;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
+
@SuppressWarnings("nls")
public class NodechangesTest extends AbstractTest {
@@ -42,7 +54,7 @@ public class NodechangesTest extends AbstractTest {
}
@Override
- protected PostProcessorRegistry getPostProcessorRegistry() {
+ protected IPostProcessor.Registry getPostProcessorRegistry() {
throw new UnsupportedOperationException("do not call this in IDE context");
}
@@ -70,8 +82,9 @@ public class NodechangesTest extends AbstractTest {
final Resource left = input.getA2Left();
final Resource right = input.getA2Right();
- final IComparisonScope scope = EMFCompareIDE.createDefaultScope(left.getResourceSet(), right.getResourceSet());
- final Comparison comparison = EMFCompareIDE.builder().build().compare(scope);
+ final IComparisonScope scope = EMFCompare.createDefaultScope(left.getResourceSet(), right.getResourceSet());
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(
+ EMFCompareRCPPlugin.getDefault().getPostProcessorRegistry()).build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -90,8 +103,9 @@ public class NodechangesTest extends AbstractTest {
final Resource left = input.getA1Left();
final Resource right = input.getA1Right();
- final IComparisonScope scope = EMFCompareIDE.createDefaultScope(left.getResourceSet(), right.getResourceSet());
- final Comparison comparison = EMFCompareIDE.builder().build().compare(scope);
+ final IComparisonScope scope = EMFCompare.createDefaultScope(left.getResourceSet(), right.getResourceSet());
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(
+ EMFCompareRCPPlugin.getDefault().getPostProcessorRegistry()).build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
index bd73468dc..aea865857 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.compare,
org.eclipse.emf.compare.rcp.ui;bundle-version="2.1.0",
org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.emf.ecore.edit;bundle-version="2.5.0",
- org.eclipse.emf.compare.edit;bundle-version="3.0.0"
+ org.eclipse.emf.compare.edit;bundle-version="3.0.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
index c870dff40..ea402e174 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
@@ -25,7 +25,7 @@
</page>
</extension>
<extension
- point="org.eclipse.emf.compare.ide.ui.accessor_factory">
+ point="org.eclipse.emf.compare.ide.ui.accessorFactory">
<factory
class="org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.factory.DiagramIDEDiffAccessorFactory"
ranking="40">
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java
index a60d946e1..1e493429e 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java
@@ -13,9 +13,8 @@ package org.eclipse.emf.compare.diagram.ide.ui.internal;
import org.eclipse.emf.compare.diagram.internal.CompareDiagramConfiguration;
import org.eclipse.emf.compare.diagram.internal.CompareDiagramConstants;
import org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -69,13 +68,15 @@ public class CompareDiagramIDEUIPlugin extends AbstractUIPlugin {
configuration.setMoveThreshold(getPreferenceStore().getInt(
CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD));
- PostProcessorRegistry postProcessorRegistry = EMFCompareIDEPlugin.getDefault()
+ IPostProcessor.Registry postProcessorRegistry = EMFCompareRCPPlugin.getDefault()
.getPostProcessorRegistry();
- for (PostProcessorDescriptor descriptor : postProcessorRegistry.getRegisteredPostProcessors()) {
- if (descriptor.getExtensionClassName().equals(CompareDiagramPostProcessor.class.getName())) {
- CompareDiagramPostProcessor postProcessor = (CompareDiagramPostProcessor)descriptor
- .getPostProcessor();
- postProcessor.setConfiguration(configuration);
+ for (IPostProcessor postprocessor : postProcessorRegistry.getPostProcessors()) {
+ if (postprocessor instanceof CompareDiagramPostProcessor) {
+ ((CompareDiagramPostProcessor)postprocessor).setConfiguration(configuration);
+ } else if (postprocessor instanceof IPostProcessor.Descriptor
+ && ((IPostProcessor.Descriptor)postprocessor).getPostProcessor() instanceof CompareDiagramPostProcessor) {
+ ((CompareDiagramPostProcessor)((IPostProcessor.Descriptor)postprocessor).getPostProcessor())
+ .setConfiguration(configuration);
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
index e831c6723..7915f3da5 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
@@ -51,11 +51,11 @@ import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramDiffAcce
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree.TreeContentMergeViewerContentProvider;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
import org.eclipse.emf.compare.utils.DiffUtil;
@@ -1628,7 +1628,7 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer {
*/
if (fCurrentSelectedDiff != null) {
final Command command = getEditingDomain().createCopyCommand(fCurrentSelectedDiff, leftToRight,
- EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ EMFCompareRCPPlugin.getDefault().getMergerRegistry());
getEditingDomain().getCommandStack().execute(command);
if (leftToRight) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/plugin.xml b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
index 8718557ef..b8df17cae 100644
--- a/plugins/org.eclipse.emf.compare.diagram/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
@@ -23,19 +23,19 @@
<extension
- point="org.eclipse.emf.compare.postProcessor">
- <postProcessor
+ point="org.eclipse.emf.compare.rcp.postProcessor">
+ <processor
class="org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor">
<nsURI
value="http://www.eclipse.org/gmf/runtime/\d.\d.\d/notation">
</nsURI>
- </postProcessor>
+ </processor>
</extension>
<extension
- point="org.eclipse.emf.compare.ide.mergerExtension">
+ point="org.eclipse.emf.compare.rcp.merger">
<merger
class="org.eclipse.emf.compare.diagram.internal.merge.CompareDiagramMerger"
- ranking="11">
+ ranking="20">
</merger>
</extension>
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java
index acdf4b467..4bc7ce269 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.compare.diagram.internal;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
@@ -21,14 +22,14 @@ import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.diagram.internal.factories.DiagramExtensionFactoryRegistry;
import org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory;
-import org.eclipse.emf.compare.extension.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.AbstractPostProcessor;
/**
* Post-processor to create the diagram difference extensions.
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class CompareDiagramPostProcessor implements IPostProcessor {
+public class CompareDiagramPostProcessor extends AbstractPostProcessor {
/** Registry of diagram difference extension factories. */
private Set<IDiagramExtensionFactory> diagramExtensionFactories;
@@ -40,7 +41,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
* Constructor.
*/
public CompareDiagramPostProcessor() {
-
+ super(Pattern.compile("http://www.eclipse.org/gmf/runtime/\\d.\\d.\\d/notation"), null); //$NON-NLS-1$
}
/**
@@ -49,8 +50,8 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
* @param configuration
* The diagram comparison configuration.
*/
- public CompareDiagramPostProcessor(CompareDiagramConfiguration configuration) {
- this.configuration = configuration;
+ public CompareDiagramPostProcessor(Pattern nsURI, Pattern resourceURI) {
+ super(nsURI, resourceURI);
}
/**
@@ -66,7 +67,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postMatch(Comparison comparison, Monitor monitor) {
@@ -75,7 +76,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postDiff(Comparison comparison, Monitor monitor) {
@@ -84,7 +85,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postRequirements(Comparison comparison, Monitor monitor) {
@@ -114,7 +115,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postEquivalences(Comparison comparison, Monitor monitor) {
@@ -123,7 +124,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postConflicts(Comparison comparison, Monitor monitor) {
@@ -132,7 +133,7 @@ public class CompareDiagramPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postComparison(Comparison comparison, Monitor monitor) {
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
index d96fb9cea..e6315dfc2 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
@@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.filesystem,
org.eclipse.team.core;bundle-version="3.5.0",
org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
- org.eclipse.team.ui;bundle-version="3.5.0"
+ org.eclipse.team.ui;bundle-version="3.5.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
index 8f041634f..c7ed76f71 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
@@ -13,7 +13,7 @@
-->
<plugin>
- <extension-point id="accessor_factory" name="Accessor Factory" schema="schema/accessor_factory.exsd"/>
+ <extension-point id="accessorFactory" name="Accessor Factory" schema="schema/accessorFactory.exsd"/>
<extension
point="org.eclipse.compare.structureMergeViewers">
<viewer
@@ -75,7 +75,7 @@
</factory>
</extension>
<extension
- point="org.eclipse.emf.compare.ide.ui.accessor_factory">
+ point="org.eclipse.emf.compare.ide.ui.accessorFactory">
<factory
class="org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.factory.IDEEObjectAccessorFactory"
ranking="10">
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/schema/accessor_factory.exsd b/plugins/org.eclipse.emf.compare.ide.ui/schema/accessorFactory.exsd
index 6e8848f0d..991454aea 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/schema/accessor_factory.exsd
+++ b/plugins/org.eclipse.emf.compare.ide.ui/schema/accessorFactory.exsd
@@ -3,7 +3,7 @@
<schema targetNamespace="org.eclipse.emf.compare.ide.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.ide.ui" id="accessor_factory" name="Accessor Factory"/>
+ <meta.schema plugin="org.eclipse.emf.compare.ide.ui" id="accessorFactory" name="Accessor Factory"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
index 1e710181d..b291a6fbb 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -13,11 +13,12 @@ package org.eclipse.emf.compare.ide.ui.internal;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.IAccessorFactory;
-import org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
@@ -66,7 +67,7 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
registry = new IAccessorFactory.RegistryImpl();
- listener = new AccessorFactoryExtensionRegistryListener(PLUGIN_ID, ACCESSOR_FACTORY_PPID);
+ listener = new AccessorFactoryExtensionRegistryListener(PLUGIN_ID, ACCESSOR_FACTORY_PPID, getLog());
extensionRegistry.addListener(listener, PLUGIN_ID + "." + ACCESSOR_FACTORY_PPID); //$NON-NLS-1$
listener.readRegistry(extensionRegistry);
}
@@ -179,65 +180,71 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
* @param extensionPointID
* @param registry
*/
- public AccessorFactoryExtensionRegistryListener(String pluginID, String extensionPointID) {
- super(pluginID, extensionPointID);
+ public AccessorFactoryExtensionRegistryListener(String pluginID, String extensionPointID, ILog log) {
+ super(pluginID, extensionPointID, log);
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
- * org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener.Action)
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
*/
@Override
- protected boolean readElement(IConfigurationElement element, Action b) {
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ final boolean valid;
if (element.getName().equals(TAG_FACTORY)) {
if (element.getAttribute(ATT_CLASS) == null) {
logMissingAttribute(element, ATT_CLASS);
+ valid = false;
} else if (element.getAttribute(ATT_RANKING) == null) {
String rankingStr = element.getAttribute(ATT_RANKING);
try {
Integer.parseInt(rankingStr);
} catch (NumberFormatException nfe) {
- logError(element, "Attribute '" + ATT_RANKING
+ log(IStatus.ERROR, element, "Attribute '" + ATT_RANKING
+ "' is malformed, should be an integer.");
}
logMissingAttribute(element, ATT_RANKING);
+ valid = false;
} else {
- switch (b) {
- case ADD:
- try {
- IAccessorFactory factory = (IAccessorFactory)element
- .createExecutableExtension(ATT_CLASS);
- factory.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
- IAccessorFactory previous = registry.add(factory);
- if (previous != null) {
- log(IStatus.WARNING, "The factory '" + factory.getClass().getName()
- + "' is registered twice.");
- }
- } catch (CoreException e) {
- logError(element, e.getMessage());
- }
- break;
- case REMOVE:
- registry.remove(element.getAttribute(ATT_CLASS));
- break;
- }
- return true;
+ valid = true;
+ }
+ } else {
+ valid = false;
+ }
+ return valid;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ try {
+ IAccessorFactory factory = (IAccessorFactory)element.createExecutableExtension(ATT_CLASS);
+ factory.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
+ IAccessorFactory previous = registry.add(factory);
+ if (previous != null) {
+ log(IStatus.WARNING, element, "The accessor factory '" + factory.getClass().getName()
+ + "' is registered twice.");
}
+ } catch (CoreException e) {
+ log(element, e);
}
- return false;
+ return true;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#logError(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String)
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
*/
@Override
- protected void logError(IConfigurationElement element, String string) {
- log(IStatus.ERROR, string);
+ protected boolean removedValid(IConfigurationElement element) {
+ registry.remove(element.getAttribute(ATT_CLASS));
+ return true;
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
index d819ba3fe..ea62219ed 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
@@ -28,12 +28,12 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareConstants;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.DynamicObject;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.EMFCompareColor;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColorProvider;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer;
@@ -331,7 +331,7 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
EList<Diff> differences = getComparison().getDifferences();
final Command copyCommand = getEditingDomain().createCopyAllNonConflictingCommand(differences,
- leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ leftToRight, EMFCompareRCPPlugin.getDefault().getMergerRegistry());
getEditingDomain().getCommandStack().execute(copyCommand);
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
index 6f4bfa15d..604124a8c 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -16,8 +16,8 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceState;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewerItem;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.MatchedObject;
@@ -113,7 +113,7 @@ public class TableContentMergeViewer extends EMFCompareContentMergeViewer {
final Diff diffToCopy = getDiffToCopy(getRightMergeViewer());
if (diffToCopy != null) {
Command copyCommand = getEditingDomain().createCopyCommand(diffToCopy, leftToRight,
- EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ EMFCompareRCPPlugin.getDefault().getMergerRegistry());
getEditingDomain().getCommandStack().execute(copyCommand);
refresh();
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java
index d3324a3bb..4d59b1b6c 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -33,10 +33,10 @@ import org.eclipse.emf.compare.DifferenceState;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.command.ICompareCopyCommand;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareConstants;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.DynamicObject;
import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider.AttributeChangeNode;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EAttribute;
@@ -91,7 +91,7 @@ public class EMFCompareTextMergeViewer extends TextMergeViewer {
final Comparison comparison = attributeChange.getMatch().getComparison();
final Command copyCommand = fEditingDomain.createCopyAllNonConflictingCommand(comparison
- .getDifferences(), leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ .getDifferences(), leftToRight, EMFCompareRCPPlugin.getDefault().getMergerRegistry());
fEditingDomain.getCommandStack().execute(copyCommand);
refresh();
@@ -104,7 +104,7 @@ public class EMFCompareTextMergeViewer extends TextMergeViewer {
final AttributeChange attributeChange = ((AttributeChangeNode)input).getTarget();
final Command copyCommand = fEditingDomain.createCopyCommand(attributeChange, leftToRight,
- EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ EMFCompareRCPPlugin.getDefault().getMergerRegistry());
fEditingDomain.getCommandStack().execute(copyCommand);
refresh();
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
index 8c9c40ce9..74ec3c438 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -16,8 +16,8 @@ import java.util.ResourceBundle;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.MergeViewer;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.TreeMergeViewer;
@@ -145,7 +145,7 @@ public class TreeContentMergeViewer extends EMFCompareContentMergeViewer {
List<Diff> differences = getComparison().getDifferences((EObject)firstElement);
final Command command = getEditingDomain().createCopyAllNonConflictingCommand(differences,
- leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ leftToRight, EMFCompareRCPPlugin.getDefault().getMergerRegistry());
getEditingDomain().getCommandStack().execute(command);
refresh();
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/handler/AbstractCompareHandler.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/handler/AbstractCompareHandler.java
index 2bab4fa17..0bc0416c7 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/handler/AbstractCompareHandler.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/handler/AbstractCompareHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -27,7 +27,6 @@ import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
import org.eclipse.emf.compare.domain.impl.EMFCompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDE;
import org.eclipse.emf.compare.ide.ui.internal.editor.ComparisonScopeEditorInput;
import org.eclipse.emf.compare.match.DefaultComparisonFactory;
import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory;
@@ -36,6 +35,7 @@ import org.eclipse.emf.compare.match.IComparisonFactory;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.utils.UseIdentifiers;
import org.eclipse.emf.ecore.EObject;
@@ -60,7 +60,8 @@ public abstract class AbstractCompareHandler extends AbstractHandler {
IEObjectMatcher eObjectMatcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.NEVER);
IMatchEngine matchEngine = new MatchEObjectEngine(eObjectMatcher, new DefaultComparisonFactory(
new DefaultEqualityHelperFactory()));
- EMFCompare comparator = EMFCompareIDE.builder().setMatchEngine(matchEngine).build();
+ EMFCompare comparator = EMFCompare.builder().setMatchEngine(matchEngine).setPostProcessorRegistry(
+ EMFCompareRCPPlugin.getDefault().getPostProcessorRegistry()).build();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
input = new ComparisonScopeEditorInput(configuration, editingDomain, adapterFactory, comparator,
scope);
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index 1941ecaf6..40b6f2d20 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -41,13 +41,13 @@ import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.command.ICompareCopyCommand;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
import org.eclipse.emf.compare.domain.impl.EMFCompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDE;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareConstants;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
import org.eclipse.emf.compare.ide.ui.internal.actions.save.SaveComparisonModelAction;
import org.eclipse.emf.compare.ide.ui.internal.editor.ComparisonScopeInput;
import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider.ComparisonNode;
import org.eclipse.emf.compare.ide.ui.logical.EMFSynchronizationModel;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.actions.FilterActionMenu;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.actions.GroupActionMenu;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter;
@@ -272,7 +272,8 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
}
final IComparisonScope scope = syncModel.createMinimizedScope();
- final Comparison compareResult = EMFCompareIDE.builder().build().compare(scope,
+ final Comparison compareResult = EMFCompare.builder().setPostProcessorRegistry(
+ EMFCompareRCPPlugin.getDefault().getPostProcessorRegistry()).build().compare(scope,
BasicMonitor.toMonitor(monitor));
final ResourceSet leftResourceSet = (ResourceSet)scope.getLeft();
diff --git a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
index bda2586ba..a1db3cae4 100644
--- a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
@@ -8,7 +8,8 @@ Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.emf.compare;bundle-version="2.0.1",
- org.eclipse.emf.ecore.xmi;bundle-version="2.5.0"
+ org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
@@ -19,7 +20,6 @@ Import-Package: com.google.common.annotations;version="[11.0.0,15.0.0)",
com.google.common.io;version="[11.0.0,15.0.0)",
com.google.common.util.concurrent;version="[11.0.0,15.0.0)"
Export-Package: org.eclipse.emf.compare.ide,
- org.eclipse.emf.compare.ide.internal.extension;x-internal:=true,
org.eclipse.emf.compare.ide.internal.policy;x-internal:=true,
org.eclipse.emf.compare.ide.internal.utils;x-friends:="org.eclipse.emf.compare.ide.ui",
org.eclipse.emf.compare.ide.policy,
diff --git a/plugins/org.eclipse.emf.compare.ide/plugin.xml b/plugins/org.eclipse.emf.compare.ide/plugin.xml
index 49ce681c9..98a701d52 100644
--- a/plugins/org.eclipse.emf.compare.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.ide/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.4"?>
<!--
- Copyright (c) 2012 Obeo.
+ Copyright (c) 2012, 2013 Obeo.
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
@@ -13,37 +13,5 @@
-->
<plugin>
- <extension-point id="org.eclipse.emf.compare.postProcessor" name="Post Processor" schema="schema/PostProcess.exsd"/>
- <extension-point id="load_on_demand_policy" name="Load on Demand Policy" schema="schema/load_on_demand_policy.exsd"/>
- <extension-point id="mergerExtension" name="Merger Extension" schema="schema/MergerExtension.exsd"/>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.eclipse.org/emf/compare"
- class="org.eclipse.emf.compare.ComparePackage"
- genModel="model/compare.genmodel"/>
- </extension>
- <extension
- point="org.eclipse.emf.compare.ide.mergerExtension">
- <merger
- class="org.eclipse.emf.compare.merge.ResourceAttachmentChangeMerger"
- ranking="10">
- </merger>
- <merger
- class="org.eclipse.emf.compare.merge.ReferenceChangeMerger"
- ranking="10">
- </merger>
- <merger
- class="org.eclipse.emf.compare.merge.AttributeChangeMerger"
- ranking="10">
- </merger>
- </extension>
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- id="org.eclipse.emf.compare.content.type"
- name="EMF Compare"
- priority="normal">
- </content-type>
- </extension>
+ <extension-point id="loadOnDemandPolicy" name="Load on Demand Policy" schema="schema/loadOnDemandPolicy.exsd"/>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.ide/schema/ModelResolver.exsd b/plugins/org.eclipse.emf.compare.ide/schema/ModelResolver.exsd
deleted file mode 100644
index 2598aa4ae..000000000
--- a/plugins/org.eclipse.emf.compare.ide/schema/ModelResolver.exsd
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.emf.compare.ide" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.ide" id="org.eclipse.emf.compare.modelResolver" name="Model Resolver"/>
- </appinfo>
- <documentation>
- This extension point can be used in order to tell EMF Compare how to resolve the resource set of a given IResource.
-
-Take note that EMF Compare will use the very first model resolver that can be applied to a given IResource and discard subsequent ones.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="modelResolver"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="modelResolver">
- <annotation>
- <documentation>
- Describes a Model Resolver and its enablement value.
- </documentation>
- </annotation>
- <complexType>
- <choice>
- <element ref="fileExtension"/>
- <element ref="namespace"/>
- </choice>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Fully qualified name of a class that implements org.eclipse.emf.compare.ide.logical.extension.IModelResolver.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.ide.logical.extension.IModelResolver"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="fileExtension">
- <annotation>
- <documentation>
- Extension of the files that this model resolver consider as part of the models it can resolve. Can be multiple file extensions separated with commas.
-
-Note : &quot;*&quot; is accepted as a wildcard for all extensions ... but should not be used as it would prevent any other model resolver to be provided to the framework.
-
-Example : &lt;fileExtension value=&quot;uml, ecore&quot;/&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="namespace">
- <annotation>
- <documentation>
- Namespace of the packages that this model resolver consider as part of the models it can resolve. These correspond to the package NsURI. More than a single NsURI can be set here, comma-separated. They will be interpreted as regular expressions.
-
-Example : &lt;namespace value=&quot;http://www.eclipse.org/uml2/(.*)/UML&quot;/&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 1.2
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- This is an example that can be used &quot;out of the box&quot; to use the modelResolver extension point with a resolver that will look in the parent of the selected file for other EMF resources that would reference it.
-
-&lt;extension point = &quot;org.eclipse.emf.compare.modelResolver&quot;&gt;
- &lt;modelResolver class=&quot;org.eclipse.emf.compare.ide.logical.extension.ScopedModelResolver&quot;&gt;
- &lt;fileExtension value=&quot;uml&quot;/&gt;
- &lt;/modelResolver&gt;
-&lt;/extension&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- See org.eclipse.emf.compare.ide.logical.extension.ScopedModelResolver
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2011, 2012 Obeo.
-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:
- Obeo - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.emf.compare.ide/schema/load_on_demand_policy.exsd b/plugins/org.eclipse.emf.compare.ide/schema/loadOnDemandPolicy.exsd
index 53b85a4b1..ab55b4274 100644
--- a/plugins/org.eclipse.emf.compare.ide/schema/load_on_demand_policy.exsd
+++ b/plugins/org.eclipse.emf.compare.ide/schema/loadOnDemandPolicy.exsd
@@ -3,7 +3,7 @@
<schema targetNamespace="org.eclipse.emf.compare.ide" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.ide" id="load_on_demand_policy" name="Load on Demand Policy"/>
+ <meta.schema plugin="org.eclipse.emf.compare.ide" id="loadOnDemandPolicy" name="Load on Demand Policy"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java
deleted file mode 100644
index 2406dd60d..000000000
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.ide;
-
-import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.conflict.IConflictDetector;
-import org.eclipse.emf.compare.diff.IDiffEngine;
-import org.eclipse.emf.compare.equi.IEquiEngine;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-import org.eclipse.emf.compare.match.IMatchEngine;
-import org.eclipse.emf.compare.req.IReqEngine;
-
-/**
- * Specialized EMFCompare class to handle IDE specific behavior.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class EMFCompareIDE extends EMFCompare {
-
- /**
- * Creates a new EMFCompareIDE object able to compare Notifier with the help of given engines.
- *
- * @param matchEngine
- * IMatchEngine to use to compute comparison
- * @param diffEngine
- * IDiffEngine to use to compute comparison
- * @param reqEngine
- * IReqEngine to use to compute comparison
- * @param equiEngine
- * IEquiEngine to use to compute comparison
- * @param conflictDetector
- * IConflictDetector to use to compute comparison
- * @param postProcessorRegistry
- * PostProcessorRegistry to use to find an IPostProcessor
- */
- protected EMFCompareIDE(IMatchEngine matchEngine, IDiffEngine diffEngine, IReqEngine reqEngine,
- IEquiEngine equiEngine, IConflictDetector conflictDetector,
- PostProcessorRegistry postProcessorRegistry) {
- super(matchEngine, diffEngine, reqEngine, equiEngine, conflictDetector, postProcessorRegistry);
- }
-
- /**
- * Creates a new builder to configure the creation of a new EMFCompare object.
- *
- * @return a new builder.
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * A Builder pattern to instantiate EMFCompareIDE objects.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
- public static class Builder extends EMFCompare.Builder {
-
- /**
- * Creates a new builder object.
- */
- protected Builder() {
- this.registry = EMFCompareIDEPlugin.getDefault().getPostProcessorRegistry();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.EMFCompare.Builder#setPostProcessorRegistry(org.eclipse.emf.compare.extension.PostProcessorRegistry)
- */
- @Override
- public org.eclipse.emf.compare.EMFCompare.Builder setPostProcessorRegistry(
- PostProcessorRegistry registry) {
- throw new UnsupportedOperationException(
- "Can not set a post processor registry in the IDE context");
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.EMFCompare.Builder#build()
- */
- @Override
- public EMFCompare build() {
- return super.build();
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
index 61cd9ec77..eb9befe95 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
@@ -10,21 +10,13 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-import org.eclipse.emf.compare.ide.internal.extension.PostProcessorRegistryListener;
import org.eclipse.emf.compare.ide.internal.policy.LoadOnDemandPolicyRegistryImpl;
import org.eclipse.emf.compare.ide.internal.policy.LoadOnDemandPolicyRegistryListener;
import org.eclipse.emf.compare.ide.policy.ILoadOnDemandPolicy;
-import org.eclipse.emf.compare.ide.policy.ILoadOnDemandPolicy.Registry;
-import org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener;
-import org.eclipse.emf.compare.merge.IMerger;
import org.osgi.framework.BundleContext;
/**
@@ -37,38 +29,17 @@ public class EMFCompareIDEPlugin extends Plugin {
public static final String PLUGIN_ID = "org.eclipse.emf.compare.ide"; //$NON-NLS-1$
/** The id of the load on demand policy extension point. */
- public static final String LOAD_ON_DEMAND_POLICY_PPID = "load_on_demand_policy"; //$NON-NLS-1$
-
- /**
- * The id of the merger extension point.
- *
- * @since 3.0
- */
- public static final String MERGER_EXTENSION_PPID = "mergerExtension"; //$NON-NLS-1$
+ public static final String LOAD_ON_DEMAND_POLICY_PPID = "loadOnDemandPolicy"; //$NON-NLS-1$
/** This plugin's shared instance. */
private static EMFCompareIDEPlugin plugin;
- /**
- * The registry that will hold references to all post processors.
- */
- private PostProcessorRegistry postProcessorRegistry;
-
- /** The registry listener that will be used to react to post processor changes. */
- private PostProcessorRegistryListener postProcessorListener;
-
/** The registry that will hold references to all {@link ILoadOnDemandPolicy}. **/
- private Registry loadOnDemandRegistry;
+ private ILoadOnDemandPolicy.Registry loadOnDemandRegistry;
/** The registry listener that will be used to react to load on demand policy changes. */
private LoadOnDemandPolicyRegistryListener loadOnDemandRegistryListener;
- /** The registry listener that will be used to react to merger extension changes. */
- private AbstractRegistryEventListener mergerRegistryListener;
-
- /** The registry that will hold references to all mergers. */
- private IMerger.Registry mergerRegistry;
-
/**
* {@inheritDoc}
*
@@ -81,25 +52,13 @@ public class EMFCompareIDEPlugin extends Plugin {
final IExtensionRegistry registry = Platform.getExtensionRegistry();
- this.postProcessorRegistry = new PostProcessorRegistry();
- this.postProcessorListener = new PostProcessorRegistryListener(postProcessorRegistry);
-
- registry.addListener(postProcessorListener,
- PostProcessorRegistryListener.POST_PROCESSOR_EXTENSION_POINT);
- postProcessorListener.parseInitialContributions();
-
this.loadOnDemandRegistry = new LoadOnDemandPolicyRegistryImpl();
this.loadOnDemandRegistryListener = new LoadOnDemandPolicyRegistryListener(loadOnDemandRegistry,
- PLUGIN_ID, LOAD_ON_DEMAND_POLICY_PPID);
+ PLUGIN_ID, LOAD_ON_DEMAND_POLICY_PPID, getLog());
registry.addListener(loadOnDemandRegistryListener, PLUGIN_ID + '.' + LOAD_ON_DEMAND_POLICY_PPID);
loadOnDemandRegistryListener.readRegistry(registry);
- mergerRegistry = new IMerger.RegistryImpl();
- mergerRegistryListener = new MergerExtensionRegistryListener(PLUGIN_ID, MERGER_EXTENSION_PPID);
- registry.addListener(mergerRegistryListener, PLUGIN_ID + '.' + MERGER_EXTENSION_PPID);
- mergerRegistryListener.readRegistry(registry);
-
}
/**
@@ -114,26 +73,6 @@ public class EMFCompareIDEPlugin extends Plugin {
final IExtensionRegistry registry = Platform.getExtensionRegistry();
registry.removeListener(loadOnDemandRegistryListener);
- registry.removeListener(postProcessorListener);
- }
-
- /**
- * Returns the post processor registry to which extension will be registered.
- *
- * @return the post processor registry to which extension will be registered
- */
- public PostProcessorRegistry getPostProcessorRegistry() {
- return postProcessorRegistry;
- }
-
- /**
- * Returns the merger registry to which extension will be registered.
- *
- * @return the merger registry to which extension will be registered
- * @since 3.0
- */
- public IMerger.Registry getMergerRegistry() {
- return mergerRegistry;
}
/**
@@ -165,89 +104,4 @@ public class EMFCompareIDEPlugin extends Plugin {
public static EMFCompareIDEPlugin getDefault() {
return plugin;
}
-
- /**
- * Listener for contributions to the merger extension.
- */
- private class MergerExtensionRegistryListener extends AbstractRegistryEventListener {
-
- /** TAG_MERGER. */
- static final String TAG_MERGER = "merger"; //$NON-NLS-1$
-
- /** ATT_CLASS. */
- static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- /** ATT_RANKING. */
- static final String ATT_RANKING = "ranking"; //$NON-NLS-1$
-
- /**
- * Constructor.
- *
- * @param pluginID
- * The plugin id.
- * @param extensionPointID
- * The extension point id.
- */
- public MergerExtensionRegistryListener(String pluginID, String extensionPointID) {
- super(pluginID, extensionPointID);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
- * org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener.Action)
- */
- @Override
- protected boolean readElement(IConfigurationElement element, Action b) {
- if (element.getName().equals(TAG_MERGER)) {
- if (element.getAttribute(ATT_CLASS) == null) {
- logMissingAttribute(element, ATT_CLASS);
- } else if (element.getAttribute(ATT_RANKING) == null) {
- String rankingStr = element.getAttribute(ATT_RANKING);
- try {
- Integer.parseInt(rankingStr);
- } catch (NumberFormatException nfe) {
- logError(element, EMFCompareIDEMessages.getString("malformed.extension.attribute", //$NON-NLS-1$
- ATT_RANKING));
- }
- logMissingAttribute(element, ATT_RANKING);
- } else {
- switch (b) {
- case ADD:
- try {
- IMerger merger = (IMerger)element.createExecutableExtension(ATT_CLASS);
- merger.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
- IMerger previous = mergerRegistry.add(merger);
- if (previous != null) {
- log(IStatus.WARNING, EMFCompareIDEMessages.getString(
- "duplicate.extension", merger.getClass().getName())); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- logError(element, e.getMessage());
- }
- break;
- case REMOVE:
- mergerRegistry.remove(element.getAttribute(ATT_CLASS));
- break;
- default:
- break;
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#logError(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String)
- */
- @Override
- protected void logError(IConfigurationElement element, String string) {
- log(IStatus.ERROR, string);
- }
- }
}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorIDEDescriptor.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorIDEDescriptor.java
deleted file mode 100644
index 9c7a0546a..000000000
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorIDEDescriptor.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.ide.internal.extension;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.compare.extension.IPostProcessor;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
-
-/**
- * Describes an extension as contributed to the "org.eclipse.emf.compare.postProcessor" extension point.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class PostProcessorIDEDescriptor extends PostProcessorDescriptor {
-
- /** Name of the attribute holding the {@link IPostProcessor} qualified names. */
- public static final String POST_PROCESSOR_CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-
- /** Name of the attribute holding the namespace URI(s) this processor applies to. */
- public static final String POST_PROCESSOR_NS_URI = "nsURI"; //$NON-NLS-1$
-
- /** Name of the attribute holding the resource URI(s) this processor applies to. */
- public static final String POST_PROCESSOR_RESOURCE_URI = "resourceURI"; //$NON-NLS-1$
-
- /** This attribute is common to the "enablement" tags : nsURI, resourceURI. */
- public static final String ENABLEMENT_TAG_VALUE = "value"; //$NON-NLS-1$
-
- /** All of our "enablement" tags accept comma-separated values. */
- public static final String VALUE_SEPARATOR = ","; //$NON-NLS-1$
-
- /** Configuration element of this descriptor. */
- private final IConfigurationElement element;
-
- /**
- * Creates a descriptor corresponding to the information of the given <em>element</em>.
- *
- * @param element
- * Configuration element from which to create this descriptor.
- */
- public PostProcessorIDEDescriptor(IConfigurationElement element) {
- super();
- this.element = element;
-
- extensionClassName = element.getAttribute(POST_PROCESSOR_CLASS_ATTRIBUTE);
-
- IConfigurationElement[] nsURIConfig = element.getChildren(POST_PROCESSOR_NS_URI);
- if (nsURIConfig.length > 0) {
- nsUri = nsURIConfig[0].getAttribute(ENABLEMENT_TAG_VALUE);
- } else {
- nsUri = null;
- }
-
- IConfigurationElement[] resourceUriConfig = element.getChildren(POST_PROCESSOR_RESOURCE_URI);
- if (resourceUriConfig.length > 0) {
- resourceUri = resourceUriConfig[0].getAttribute(ENABLEMENT_TAG_VALUE);
- } else {
- resourceUri = null;
- }
- }
-
- /**
- * Creates an instance of this descriptor's post processor if needed, then return it.
- *
- * @return An instance of this descriptor's post processor.
- */
- @Override
- public IPostProcessor getPostProcessor() {
- if (postProcessor == null) {
- try {
- postProcessor = (IPostProcessor)element
- .createExecutableExtension(POST_PROCESSOR_CLASS_ATTRIBUTE);
- } catch (CoreException e) {
- final IStatus status = new Status(IStatus.ERROR, EMFCompareIDEPlugin.PLUGIN_ID, e
- .getMessage(), e);
- EMFCompareIDEPlugin.getDefault().getLog().log(status);
- }
- }
- return postProcessor;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java
deleted file mode 100644
index 17e57600f..000000000
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.ide.internal.extension;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IRegistryEventListener;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-
-/**
- * This listener will allow us to be aware of contribution changes against the model resolver extension point.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class PostProcessorRegistryListener implements IRegistryEventListener {
- /** Name of the extension point to parse for extensions. */
- public static final String POST_PROCESSOR_EXTENSION_POINT = "org.eclipse.emf.compare.postProcessor"; //$NON-NLS-1$
-
- /** Name of the extension point's "postProcessor" tag. */
- private static final String POST_PROCESSOR_TAG = "postProcessor"; //$NON-NLS-1$
-
- /** The post processor registry to which extension will be registered. */
- private final PostProcessorRegistry registry;
-
- /**
- * Creates a new registry listener with the given post processor registry to which extension will be
- * registered.
- *
- * @param registry
- * the post processor registry to which extension will be registered.
- */
- public PostProcessorRegistryListener(PostProcessorRegistry registry) {
- this.registry = registry;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtension[])
- */
- public void added(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- parseExtension(extension);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void added(IExtensionPoint[] extensionPoints) {
- // no need to listen to this event
- }
-
- /**
- * Though this listener reacts to the extension point changes, there could have been contributions before
- * it's been registered. This will parse these initial contributions.
- */
- public void parseInitialContributions() {
- final IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-
- for (IExtension extension : extensionRegistry.getExtensionPoint(POST_PROCESSOR_EXTENSION_POINT)
- .getExtensions()) {
- parseExtension(extension);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtension[])
- */
- public void removed(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- final IConfigurationElement[] configElements = extension.getConfigurationElements();
- for (IConfigurationElement elem : configElements) {
- if (POST_PROCESSOR_TAG.equals(elem.getName())) {
- final String postProcessorClassName = elem
- .getAttribute(PostProcessorIDEDescriptor.POST_PROCESSOR_CLASS_ATTRIBUTE);
- registry.removePostProcessor(postProcessorClassName);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void removed(IExtensionPoint[] extensionPoints) {
- // no need to listen to this event
- }
-
- /**
- * Parses a single extension contribution.
- *
- * @param extension
- * Parses the given extension and adds its contribution to the registry.
- */
- private void parseExtension(IExtension extension) {
- final IConfigurationElement[] configElements = extension.getConfigurationElements();
- for (IConfigurationElement element : configElements) {
- if (POST_PROCESSOR_TAG.equals(element.getName())) {
- registry.addPostProcessor(new PostProcessorIDEDescriptor(element));
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/policy/LoadOnDemandPolicyRegistryListener.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/policy/LoadOnDemandPolicyRegistryListener.java
index 9078baeca..253bbc857 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/policy/LoadOnDemandPolicyRegistryListener.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/policy/LoadOnDemandPolicyRegistryListener.java
@@ -12,11 +12,12 @@ package org.eclipse.emf.compare.ide.internal.policy;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
import org.eclipse.emf.compare.ide.policy.ILoadOnDemandPolicy;
import org.eclipse.emf.compare.ide.policy.ILoadOnDemandPolicy.Registry;
-import org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
/**
* A listener for load on demand policy extension point.
@@ -45,60 +46,60 @@ public class LoadOnDemandPolicyRegistryListener extends AbstractRegistryEventLis
* the id of the extension point to listen to.
*/
public LoadOnDemandPolicyRegistryListener(ILoadOnDemandPolicy.Registry registry, String pluginID,
- String extensionPointID) {
- super(pluginID, extensionPointID);
+ String extensionPointID, ILog log) {
+ super(pluginID, extensionPointID, log);
this.registry = registry;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
- * org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener.Action)
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
*/
@Override
- protected boolean readElement(IConfigurationElement element, Action action) {
- if (element.getName().equals(TAG_POLICY)) {
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ if (TAG_POLICY.equals(element.getName())) {
if (element.getAttribute(ATT_CLASS) == null) {
logMissingAttribute(element, ATT_CLASS);
+ return false;
} else {
- switch (action) {
- case ADD:
- try {
- ILoadOnDemandPolicy policy = (ILoadOnDemandPolicy)element
- .createExecutableExtension(ATT_CLASS);
- ILoadOnDemandPolicy previous = registry.addPolicy(policy);
- if (previous != null) {
- EMFCompareIDEPlugin.getDefault().log(
- IStatus.WARNING,
- "The factory '" + policy.getClass().getName()
- + "' is registered twice.");
- }
- } catch (CoreException e) {
- logError(element, e.getMessage());
- }
- break;
- case REMOVE:
- registry.removePolicy(element.getAttribute(ATT_CLASS));
- break;
- default:
- throw new IllegalStateException("Unsupported case " + action);
- }
return true;
}
+ } else {
+ return false;
}
- return false;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#logError(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String)
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
*/
@Override
- protected void logError(IConfigurationElement element, String string) {
- EMFCompareIDEPlugin.getDefault().log(IStatus.ERROR, string);
+ protected boolean addedValid(IConfigurationElement element) {
+ try {
+ ILoadOnDemandPolicy policy = (ILoadOnDemandPolicy)element.createExecutableExtension(ATT_CLASS);
+ ILoadOnDemandPolicy previous = registry.addPolicy(policy);
+ if (previous != null) {
+ EMFCompareIDEPlugin.getDefault().log(IStatus.WARNING,
+ "The factory '" + policy.getClass().getName() + "' is registered twice.");
+ }
+ } catch (CoreException e) {
+ log(IStatus.ERROR, element, e.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ registry.removePolicy(element.getAttribute(ATT_CLASS));
+ return true;
}
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/.settings/.api_filters b/plugins/org.eclipse.emf.compare.rcp.ui/.settings/.api_filters
index a71f386f9..388b72248 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/.settings/.api_filters
@@ -8,12 +8,4 @@
</message_arguments>
</filter>
</resource>
- <resource path="src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java" type="org.eclipse.emf.compare.rcp.ui.mergeviewer.accessor.ManyStructuralFeatureAccessorImpl">
- <filter id="421683322">
- <message_arguments>
- <message_argument value="org.eclipse.emf.compare.rcp.ui.mergeviewer.accessor.ManyStructuralFeatureAccessorImpl"/>
- <message_argument value="getDiffValue(Diff)"/>
- </message_arguments>
- </filter>
- </resource>
</component>
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
index 7aa87b068..25e109fa8 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.emf.compare;bundle-version="2.0.1",
org.eclipse.emf.compare.edit;bundle-version="2.0.1",
- org.eclipse.emf.ecore.xmi;bundle-version="2.5.0"
+ org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
Export-Package: org.eclipse.emf.compare.rcp.ui,
org.eclipse.emf.compare.rcp.ui.mergeviewer,
org.eclipse.emf.compare.rcp.ui.mergeviewer.accessor,
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
index 4cfe494d3..aa424e61f 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
@@ -14,13 +14,13 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.ui.internal.DifferenceGroupProviderExtensionRegistryListener;
+import org.eclipse.emf.compare.rcp.ui.internal.FilterExtensionRegistryListener;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -81,13 +81,14 @@ public class EMFCompareRCPUIPlugin extends AbstractUIPlugin {
groupProviderRegistry = new IDifferenceGroupProvider.RegistryImpl();
groupProviderRegistryListener = new DifferenceGroupProviderExtensionRegistryListener(PLUGIN_ID,
- GROUP_PROVIDER_PPID);
+ GROUP_PROVIDER_PPID, getLog(), groupProviderRegistry);
extensionRegistry.addListener(groupProviderRegistryListener, PLUGIN_ID + "." + GROUP_PROVIDER_PPID); //$NON-NLS-1$
groupProviderRegistryListener.readRegistry(extensionRegistry);
filterRegistry = new IDifferenceFilter.RegistryImpl();
- filterRegistryListener = new FilterExtensionRegistryListener(PLUGIN_ID, FILTER_PROVIDER_PPID);
+ filterRegistryListener = new FilterExtensionRegistryListener(PLUGIN_ID, FILTER_PROVIDER_PPID,
+ getLog(), filterRegistry);
extensionRegistry.addListener(filterRegistryListener, PLUGIN_ID + "." + FILTER_PROVIDER_PPID); //$NON-NLS-1$
filterRegistryListener.readRegistry(extensionRegistry);
}
@@ -206,160 +207,4 @@ public class EMFCompareRCPUIPlugin extends AbstractUIPlugin {
}
resourcesMapper.clear();
}
-
- private class DifferenceGroupProviderExtensionRegistryListener extends AbstractRegistryEventListener {
-
- static final String TAG_GROUP_PROVIDER = "group"; //$NON-NLS-1$
-
- static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- static final String ATT_LABEL = "label"; //$NON-NLS-1$
-
- static final String ATT_ACTIVE = "activeByDefault"; //$NON-NLS-1$
-
- /**
- * @param pluginID
- * @param extensionPointID
- * @param registry
- */
- public DifferenceGroupProviderExtensionRegistryListener(String pluginID, String extensionPointID) {
- super(pluginID, extensionPointID);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
- * org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener.Action)
- */
- @SuppressWarnings("boxing")
- @Override
- protected boolean readElement(IConfigurationElement element, Action b) {
- if (element.getName().equals(TAG_GROUP_PROVIDER)) {
- if (element.getAttribute(ATT_CLASS) == null) {
- logMissingAttribute(element, ATT_CLASS);
- } else if (element.getAttribute(ATT_LABEL) == null) {
- logMissingAttribute(element, ATT_LABEL);
- } else if (element.getAttribute(ATT_ACTIVE) == null) {
- logMissingAttribute(element, ATT_ACTIVE);
- } else {
- switch (b) {
- case ADD:
- try {
- IDifferenceGroupProvider provider = (IDifferenceGroupProvider)element
- .createExecutableExtension(ATT_CLASS);
- provider.setLabel(element.getAttribute(ATT_LABEL));
- if (Boolean.valueOf(element.getAttribute(ATT_ACTIVE))) {
- provider.setDefaultSelected(true);
- } else {
- provider.setDefaultSelected(false);
- }
- IDifferenceGroupProvider previous = groupProviderRegistry.add(provider);
- if (previous != null) {
- log(IStatus.WARNING, "The provider '" + provider.getClass().getName()
- + "' is registered twice.");
- }
- } catch (CoreException e) {
- logError(element, e.getMessage());
- }
- break;
- case REMOVE:
- groupProviderRegistry.remove(element.getAttribute(ATT_CLASS));
- break;
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener#logError(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String)
- */
- @Override
- protected void logError(IConfigurationElement element, String string) {
- log(IStatus.ERROR, string);
- }
- }
-
- private class FilterExtensionRegistryListener extends AbstractRegistryEventListener {
-
- static final String TAG_FILTER_ACTION = "filter"; //$NON-NLS-1$
-
- static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- static final String ATT_LABEL = "label"; //$NON-NLS-1$
-
- static final String ATT_ACTIVE = "activeByDefault"; //$NON-NLS-1$
-
- /**
- * @param pluginID
- * @param extensionPointID
- * @param registry
- */
- public FilterExtensionRegistryListener(String pluginID, String extensionPointID) {
- super(pluginID, extensionPointID);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
- * org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener.Action)
- */
- @SuppressWarnings("boxing")
- @Override
- protected boolean readElement(IConfigurationElement element, Action b) {
- if (element.getName().equals(TAG_FILTER_ACTION)) {
- if (element.getAttribute(ATT_CLASS) == null) {
- logMissingAttribute(element, ATT_CLASS);
- } else if (element.getAttribute(ATT_LABEL) == null) {
- logMissingAttribute(element, ATT_LABEL);
- } else if (element.getAttribute(ATT_ACTIVE) == null) {
- logMissingAttribute(element, ATT_ACTIVE);
- } else {
- switch (b) {
- case ADD:
- try {
- IDifferenceFilter filter = (IDifferenceFilter)element
- .createExecutableExtension(ATT_CLASS);
- filter.setLabel(element.getAttribute(ATT_LABEL));
- if (Boolean.valueOf(element.getAttribute(ATT_ACTIVE))) {
- filter.setDefaultSelected(true);
- } else {
- filter.setDefaultSelected(false);
- }
- IDifferenceFilter previous = filterRegistry.add(filter);
- if (previous != null) {
- log(IStatus.WARNING, "The filter '" + filter.getClass().getName()
- + "' is registered twice.");
- }
- } catch (CoreException e) {
- logError(element, e.getMessage());
- }
- break;
- case REMOVE:
- filterRegistry.remove(element.getAttribute(ATT_CLASS));
- break;
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.internal.util.AbstractRegistryEventListener#logError(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String)
- */
- @Override
- protected void logError(IConfigurationElement element, String string) {
- log(IStatus.ERROR, string);
- }
- }
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/DifferenceGroupProviderExtensionRegistryListener.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/DifferenceGroupProviderExtensionRegistryListener.java
new file mode 100644
index 000000000..10a9c151e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/DifferenceGroupProviderExtensionRegistryListener.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider;
+
+public class DifferenceGroupProviderExtensionRegistryListener extends AbstractRegistryEventListener {
+
+ static final String TAG_GROUP_PROVIDER = "group"; //$NON-NLS-1$
+
+ static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+ static final String ATT_LABEL = "label"; //$NON-NLS-1$
+
+ static final String ATT_ACTIVE = "activeByDefault"; //$NON-NLS-1$
+
+ private final IDifferenceGroupProvider.Registry groupProviderRegistry;
+
+ /**
+ * @param pluginID
+ * @param extensionPointID
+ * @param registry
+ */
+ public DifferenceGroupProviderExtensionRegistryListener(String pluginID, String extensionPointID,
+ ILog log, IDifferenceGroupProvider.Registry groupProviderRegistry) {
+ super(pluginID, extensionPointID, log);
+ this.groupProviderRegistry = groupProviderRegistry;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ final boolean valid;
+
+ if (element.getName().equals(TAG_GROUP_PROVIDER)) {
+ if (element.getAttribute(ATT_CLASS) == null) {
+ logMissingAttribute(element, ATT_CLASS);
+ valid = false;
+ } else if (element.getAttribute(ATT_LABEL) == null) {
+ logMissingAttribute(element, ATT_LABEL);
+ valid = false;
+ } else if (element.getAttribute(ATT_ACTIVE) == null) {
+ logMissingAttribute(element, ATT_ACTIVE);
+ valid = false;
+ } else {
+ valid = true;
+ }
+ } else {
+ valid = false;
+ }
+ return valid;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ try {
+ IDifferenceGroupProvider provider = (IDifferenceGroupProvider)element
+ .createExecutableExtension(ATT_CLASS);
+ provider.setLabel(element.getAttribute(ATT_LABEL));
+ if (Boolean.valueOf(element.getAttribute(ATT_ACTIVE)).booleanValue()) {
+ provider.setDefaultSelected(true);
+ } else {
+ provider.setDefaultSelected(false);
+ }
+ IDifferenceGroupProvider previous = groupProviderRegistry.add(provider);
+ if (previous != null) {
+ log(IStatus.WARNING, element, "The group provider '" + provider.getClass().getName()
+ + "' is registered twice.");
+ }
+ } catch (CoreException e) {
+ log(element, e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ groupProviderRegistry.remove(element.getAttribute(ATT_CLASS));
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/FilterExtensionRegistryListener.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/FilterExtensionRegistryListener.java
new file mode 100644
index 000000000..71b005d9a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/FilterExtensionRegistryListener.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter;
+
+public class FilterExtensionRegistryListener extends AbstractRegistryEventListener {
+
+ static final String TAG_FILTER_ACTION = "filter"; //$NON-NLS-1$
+
+ static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+ static final String ATT_LABEL = "label"; //$NON-NLS-1$
+
+ static final String ATT_ACTIVE = "activeByDefault"; //$NON-NLS-1$
+
+ private final IDifferenceFilter.Registry filterRegistry;
+
+ /**
+ * @param pluginID
+ * @param extensionPointID
+ * @param registry
+ */
+ public FilterExtensionRegistryListener(String pluginID, String extensionPointID, ILog log,
+ IDifferenceFilter.Registry filterRegistry) {
+ super(pluginID, extensionPointID, log);
+ this.filterRegistry = filterRegistry;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ final boolean valid;
+ if (element.getName().equals(TAG_FILTER_ACTION)) {
+ if (element.getAttribute(ATT_CLASS) == null) {
+ logMissingAttribute(element, ATT_CLASS);
+ valid = false;
+ } else if (element.getAttribute(ATT_LABEL) == null) {
+ logMissingAttribute(element, ATT_LABEL);
+ valid = false;
+ } else if (element.getAttribute(ATT_ACTIVE) == null) {
+ logMissingAttribute(element, ATT_ACTIVE);
+ valid = false;
+ } else {
+ valid = true;
+ }
+ } else {
+ valid = false;
+ }
+ return valid;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ try {
+ IDifferenceFilter filter = (IDifferenceFilter)element.createExecutableExtension(ATT_CLASS);
+ filter.setLabel(element.getAttribute(ATT_LABEL));
+ if (Boolean.valueOf(element.getAttribute(ATT_ACTIVE)).booleanValue()) {
+ filter.setDefaultSelected(true);
+ } else {
+ filter.setDefaultSelected(false);
+ }
+ IDifferenceFilter previous = filterRegistry.add(filter);
+ if (previous != null) {
+ log(IStatus.WARNING, element, "The filter '" + filter.getClass().getName()
+ + "' is registered twice.");
+ }
+ } catch (CoreException e) {
+ log(element, e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ filterRegistry.remove(element.getAttribute(ATT_CLASS));
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java
deleted file mode 100644
index 190a6c336..000000000
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.internal.util;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IRegistryEventListener;
-
-/**
- * Abstract utility class to listen to the {@link IExtensionRegistry}. It provides base implementation to
- * {@link #added(IExtension[])} and {@link #removed(IExtension[])}. Users must implement
- * {@link #readElement(IConfigurationElement, Action)} according to their extension schema.
- * <p>
- * The helper method {@link #readRegistry()} is browsing already registered extension to the extension
- * registry making it easy to read the registry after having added the listener to it.
- * <p>
- * {@link #readRegistry()} is delegating to {@link #readElement(IConfigurationElement, Action)}.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public abstract class AbstractRegistryEventListener implements IRegistryEventListener {
-
- /**
- * Enumeration that says if the {@link IConfigurationElement} is to be added or removed from the
- * {@link IExtensionRegistry}.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
- protected static enum Action {
- /**
- * The {@link IConfigurationElement} is to be added.
- */
- ADD,
- /**
- * The {@link IConfigurationElement} is to be removed.
- */
- REMOVE
- }
-
- /**
- * The plugin ID which declare the extension point to be monitored.
- */
- private final String pluginID;
-
- /**
- * The extension point ID to be monitored.
- */
- private final String extensionPointID;
-
- /**
- * Creates a new registry event listener.
- *
- * @param pluginID
- * The plugin ID which declare the extension point to be monitored.
- * @param extensionPointID
- * The extension point ID to be monitored
- */
- public AbstractRegistryEventListener(String pluginID, String extensionPointID) {
- this.pluginID = pluginID;
- this.extensionPointID = extensionPointID;
- }
-
- /**
- * Reads the given registry and call {@link #readElement(IConfigurationElement, Action)} as the read
- * {@link IConfigurationElement} were just added to it.
- *
- * @param extensionRegistry
- * the registry to read.
- */
- public void readRegistry(IExtensionRegistry extensionRegistry) {
- IExtensionPoint point = extensionRegistry.getExtensionPoint(pluginID, extensionPointID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- internalReadElement(elements[i], Action.ADD);
- }
- }
- }
-
- /**
- * Reads the given {@code element}. This method can be call when the element is added or remove. The
- * {@code action} reflect it. It returns true if the element is recognized as valid regarding the
- * monitored extension point. It will be call on sub elements recursively for all recognized ones.
- *
- * @param element
- * the element to be read.
- * @param action
- * is the element added or removed.
- * @return true if the element is recognized as valid regarding the monitored extension point.
- */
- protected abstract boolean readElement(IConfigurationElement element, Action action);
-
- /**
- * Reads the given element and, if recognized, browse recursively the children and try to read it.
- *
- * @param element
- * the element to be read.
- * @param action
- * is the element added or removed.
- */
- private void internalReadElement(IConfigurationElement element, Action action) {
- boolean recognized = readElement(element, action);
- if (recognized) {
- IConfigurationElement[] children = element.getChildren();
- for (int i = 0; i < children.length; ++i) {
- internalReadElement(children[i], action);
- }
- } else {
- logError(element, "Error processing extension: " + element);
- }
- }
-
- /**
- * Delegates the logging of a missing attribute to {@link #logError(IConfigurationElement, String)} with a
- * proper message.
- *
- * @param element
- * the element to which an attribute is missing.
- * @param attributeName
- * the name of the missing attribute.
- */
- protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "The required attribute '" + attributeName + "' not defined");
- }
-
- /**
- * Log the error to any mean (often the current plugin logger).
- *
- * @param element
- * the element from which comes to the error.
- * @param string
- * the message to be logged.
- */
- protected abstract void logError(IConfigurationElement element, String string);
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtension[])
- */
- public void added(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- if (extension.getExtensionPointUniqueIdentifier().equals(extensionPointID)) {
- IConfigurationElement[] configurationElement = extension.getConfigurationElements();
- for (int j = 0; j < configurationElement.length; ++j) {
- internalReadElement(configurationElement[j], Action.ADD);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtension[])
- */
- public void removed(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- if (extension.getExtensionPointUniqueIdentifier().equals(extensionPointID)) {
- IConfigurationElement[] configurationElement = extension.getConfigurationElements();
- for (int j = 0; j < configurationElement.length; ++j) {
- internalReadElement(configurationElement[j], Action.REMOVE);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void added(IExtensionPoint[] extensionPoints) {
- // no need to listen to this.
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void removed(IExtensionPoint[] extensionPoints) {
- // no need to listen to this.
- }
-
- /**
- * Simple utility class to create proxy of extension that are
- * {@link IConfigurationElement#createExecutableExtension(String) instantiable}.
- * <p>
- * No test of the {@link IConfigurationElement#isValid() validity} of the wrapped
- * {@link IConfigurationElement} is performed. As such you should always extend this class while listening
- * to the {@link IExtensionRegistry} and react properly the removal of the wrapped
- * {@link IConfigurationElement}.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
- public static class PluginClassDescriptor {
- /**
- * The element from which create an instance.
- */
- protected IConfigurationElement element;
-
- /**
- * The name of the attribute that holds the class full name to be instantiated.
- */
- protected String attributeName;
-
- /**
- * Creates a new descriptor for given element keeping the class name to be instantiated in an
- * attribute named {@code attributeName}.
- *
- * @param element
- * The element from which create an instance.
- * @param attributeName
- * The name of the attribute that holds the class full name to be instantiated.
- */
- public PluginClassDescriptor(IConfigurationElement element, String attributeName) {
- this.element = element;
- this.attributeName = attributeName;
- }
-
- /**
- * Creates a new instance.
- *
- * @return the new instance.
- * @throws RuntimeException
- * wraps a CoreException if an instance of the executable extension could not be created
- * for any reason.
- */
- public Object createInstance() {
- try {
- return element.createExecutableExtension(attributeName);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.rcp/.classpath b/plugins/org.eclipse.emf.compare.rcp/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.compare.rcp/.project b/plugins/org.eclipse.emf.compare.rcp/.project
new file mode 100644
index 000000000..3a94fc495
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.rcp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..4824b8026
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 000000000..f8a67de1d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\r\n
diff --git a/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..c1f1d5d08
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,374 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeFieldsInNullAnalysis=disabled
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=110
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=110
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=false \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..4517c0f23
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMF Compare
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=fr;com;java;javax;org;
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 000000000..c447f8f19
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Warning
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Warning
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Warning
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Warning
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Warning
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Warning
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Warning
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Warning
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Warning
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Warning
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Warning
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Warning
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+INVALID_JAVADOC_TAG=Ignore
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+MISSING_EE_DESCRIPTIONS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Warning
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Warning
+malformed_since_tag=Warning
+missing_since_tag=Warning
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..4b887d34f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare.rcp;singleton:=true
+Bundle-Version: 2.1.0.qualifier
+Bundle-Activator: org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.compare;bundle-version="3.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.emf.compare.rcp,
+ org.eclipse.emf.compare.rcp.extension,
+ org.eclipse.emf.compare.rcp.internal;x-internal:=true,
+ org.eclipse.emf.compare.rcp.internal.merger;x-internal:=true,
+ org.eclipse.emf.compare.rcp.internal.postprocessor;x-internal:=true
diff --git a/plugins/org.eclipse.emf.compare.rcp/about.html b/plugins/org.eclipse.emf.compare.rcp/about.html
new file mode 100644
index 000000000..34ab520ee
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.rcp/build.properties b/plugins/org.eclipse.emf.compare.rcp/build.properties
new file mode 100644
index 000000000..3b2b7ba50
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ schema/,\
+ plugin.properties,\
+ about.html
+src.includes = schema/,\
+ about.html
diff --git a/plugins/org.eclipse.emf.compare.rcp/plugin.properties b/plugins/org.eclipse.emf.compare.rcp/plugin.properties
new file mode 100644
index 000000000..8296e2875
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/plugin.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2012 Obeo.
+# 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:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare RCP
+providerName = Eclipse Modeling Project
+
diff --git a/plugins/org.eclipse.emf.compare.rcp/plugin.xml b/plugins/org.eclipse.emf.compare.rcp/plugin.xml
new file mode 100644
index 000000000..b0e84ff83
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/plugin.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+
+<!--
+ Copyright (c) 2013 Obeo.
+ 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:
+ Obeo - initial API and implementation
+-->
+
+<plugin>
+ <extension-point id="postProcessor" name="Post Processor" schema="schema/postProcessor.exsd"/>
+ <extension-point id="merger" name="Merger" schema="schema/merger.exsd"/>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/emf/compare"
+ class="org.eclipse.emf.compare.ComparePackage"
+ genModel="platform:/plugin/org.eclipse.emf.compare/model/compare.genmodel"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.emf.compare.rcp.merger">
+ <merger
+ class="org.eclipse.emf.compare.merge.ResourceAttachmentChangeMerger"
+ ranking="10">
+ </merger>
+ <merger
+ class="org.eclipse.emf.compare.merge.ReferenceChangeMerger"
+ ranking="10">
+ </merger>
+ <merger
+ class="org.eclipse.emf.compare.merge.AttributeChangeMerger"
+ ranking="10">
+ </merger>
+ </extension>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ id="org.eclipse.emf.compare.content.type"
+ name="EMF Compare"
+ priority="normal">
+ </content-type>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.emf.compare.rcp/pom.xml b/plugins/org.eclipse.emf.compare.rcp/pom.xml
new file mode 100644
index 000000000..5da9d7714
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>emf.compare-parent</artifactId>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <version>2.1.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>org.eclipse.emf.compare.rcp</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.compare.ide/schema/MergerExtension.exsd b/plugins/org.eclipse.emf.compare.rcp/schema/merger.exsd
index 5391f784f..5b2fb2b10 100644
--- a/plugins/org.eclipse.emf.compare.ide/schema/MergerExtension.exsd
+++ b/plugins/org.eclipse.emf.compare.rcp/schema/merger.exsd
@@ -1,129 +1,129 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.emf.compare.ide" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.ide" id="mergerExtension" name="Merger Extension"/>
- </appinfo>
- <documentation>
- This can be used to provide your own mergers to either replace existing ones or implement mergers for custom differences.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="merger" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="merger">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.merge.IMerger"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="ranking" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;extension point=&quot;org.eclipse.emf.compare.ide.mergerExtension&quot;&gt;
- &lt;merger
- class=&quot;org.eclipse.emf.compare.merge.ResourceAttachmentChangeMerger&quot;
- ranking=&quot;10&quot;&gt;
- &lt;/merger&gt;
- &lt;merger
- class=&quot;org.eclipse.emf.compare.merge.ReferenceChangeMerger&quot;
- ranking=&quot;10&quot;&gt;
- &lt;/merger&gt;
- &lt;merger
- class=&quot;org.eclipse.emf.compare.merge.AttributeChangeMerger&quot;
- ranking=&quot;10&quot;&gt;
- &lt;/merger&gt;
-&lt;/extension&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- See org.eclipse.emf.compare.ide/plugin.xml for existing contributions.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2011, 2013 Obeo.
-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:
- Obeo - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.compare.rcp" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.compare.rcp" id="merger" name="Difference Merger"/>
+ </appinfo>
+ <documentation>
+ This can be used to provide your own mergers to either replace existing ones or implement mergers for custom differences.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="merger" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="merger">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.merge.IMerger"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="ranking" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 3.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;extension point=&quot;org.eclipse.emf.compare.rcp.merger&quot;&gt;
+ &lt;merger
+ class=&quot;org.eclipse.emf.compare.merge.ResourceAttachmentChangeMerger&quot;
+ ranking=&quot;10&quot;&gt;
+ &lt;/merger&gt;
+ &lt;merger
+ class=&quot;org.eclipse.emf.compare.merge.ReferenceChangeMerger&quot;
+ ranking=&quot;10&quot;&gt;
+ &lt;/merger&gt;
+ &lt;merger
+ class=&quot;org.eclipse.emf.compare.merge.AttributeChangeMerger&quot;
+ ranking=&quot;10&quot;&gt;
+ &lt;/merger&gt;
+&lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ See org.eclipse.emf.compare.rcp/plugin.xml for existing contributions.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011, 2013 Obeo.
+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:
+ Obeo - initial API and implementation
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.emf.compare.ide/schema/PostProcess.exsd b/plugins/org.eclipse.emf.compare.rcp/schema/postProcessor.exsd
index ecdff07bf..162217ce8 100644
--- a/plugins/org.eclipse.emf.compare.ide/schema/PostProcess.exsd
+++ b/plugins/org.eclipse.emf.compare.rcp/schema/postProcessor.exsd
@@ -1,154 +1,154 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.emf.compare.ide" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.ide" id="org.eclipse.emf.compare.postMatch" name="Post Match Processing"/>
- </appinfo>
- <documentation>
- This extension point can be used in order to handle the comparison result after the match processing.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="postProcessor"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="postProcessor">
- <annotation>
- <documentation>
- Describes a Post Processor and its enablement value.
- </documentation>
- </annotation>
- <complexType>
- <choice>
- <element ref="nsURI"/>
- <element ref="resourceURI"/>
- </choice>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Fully qualified name of a class that implements org.eclipse.emf.compare.logical.extension.IPostProcessor.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.extension.IPostProcessor"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="resourceURI">
- <annotation>
- <documentation>
- Resource URIs that this processor consider to activate post handling. This property is a regex.
-
-Example : &lt;resourceURI value=&quot;.*.ecore&quot;/&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="nsURI">
- <annotation>
- <documentation>
- Namespace of the packages that this model resolver consider as part of the models it can resolve. These correspond to the package NsURI. More than a single NsURI can be set here, comma-separated. They will be interpreted as regular expressions.
-
-Example : &lt;namespace value=&quot;http://www.eclipse.org/uml2/(.*)/UML&quot;/&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- This is an example that can be used &quot;out of the box&quot; to use the postMatch extension point with a processor that will iterate on the given comparison (match elements) to modify or exploit it.
-
-&lt;extension point = &quot;org.eclipse.emf.compare.postMatch&quot;&gt;
- &lt;postMatchProcessor class=&quot;org.eclipse.emf.compare.ide.post.match.extension.PostMatchProcessor&quot;&gt;
- &lt;nsUri value=&quot;&quot;/&gt;
- &lt;/postMatchProcessor&gt;
-&lt;/extension&gt;
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2011, 2012 Obeo.
-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:
- Obeo - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.compare.rcp" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.compare.rcp" id="postProcessor" name="Comparison Post Processor"/>
+ </appinfo>
+ <documentation>
+ This extension point can be used in order to customize the comparison result after each comparison step.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="processor"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="processor">
+ <annotation>
+ <documentation>
+ Describes a Post Processor and its enablement value.
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="nsURI"/>
+ <element ref="resourceURI"/>
+ </choice>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Fully qualified name of a class that implements org.eclipse.emf.compare.postprocessor.IPostProcessor.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.extension.IPostProcessor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="resourceURI">
+ <annotation>
+ <documentation>
+ Resource URIs that this processor consider to activate post handling. This property is a regex.
+
+Example : &lt;resourceURI value=&quot;.*.ecore&quot;/&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="nsURI">
+ <annotation>
+ <documentation>
+ These correspond to the package NsURI. They will be interpreted as regular expressions.
+
+Example : &lt;namespace value=&quot;http://www.eclipse.org/uml2/(.*)/UML&quot;/&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 2.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example that can be used &quot;out of the box&quot; to use the postProcessor extension point with a processor that will iterate on the given comparison to modify or exploit it.
+
+&lt;extension point = &quot;org.eclipse.emf.compare.postProcessor&quot;&gt;
+ &lt;processor class=&quot;fully.qualified.name.of.MyPostProcessor&quot;&gt;
+ &lt;nsUri value=&quot;&quot;/&gt;
+ &lt;/processor&gt;
+&lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011, 2013 Obeo.
+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:
+ Obeo - initial API and implementation
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java
new file mode 100644
index 000000000..fc5a53c2d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp;
+
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.compare.merge.IMerger;
+import org.eclipse.emf.compare.postprocessor.PostProcessorRegistryImpl;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.internal.merger.MergerExtensionRegistryListener;
+import org.eclipse.emf.compare.rcp.internal.postprocessor.PostProcessorRegistryListener;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class EMFCompareRCPPlugin extends Plugin {
+
+ /** The plug-in ID. */
+ public static final String PLUGIN_ID = "org.eclipse.emf.compare.rcp"; //$NON-NLS-1$
+
+ public static final String POST_PROCESSOR_PPID = "postProcessor"; //$NON-NLS-1$
+
+ /** The id of the merger extension point. */
+ public static final String MERGER_PPID = "merger"; //$NON-NLS-1$
+
+ // This plugin is a singleton, so it's quite ok to keep the plugin in a static field.
+ private static EMFCompareRCPPlugin plugin;
+
+ private IMerger.Registry mergerRegistry;
+
+ private AbstractRegistryEventListener mergerRegistryListener;
+
+ /**
+ * The registry that will hold references to all post processors.
+ */
+ private PostProcessorRegistryImpl postProcessorRegistry;
+
+ /** The registry listener that will be used to react to post processor changes. */
+ private PostProcessorRegistryListener postProcessorRegistryListener;
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ EMFCompareRCPPlugin.plugin = this;
+
+ final IExtensionRegistry registry = Platform.getExtensionRegistry();
+
+ mergerRegistry = new IMerger.RegistryImpl();
+ mergerRegistryListener = new MergerExtensionRegistryListener(PLUGIN_ID, MERGER_PPID, getLog(),
+ mergerRegistry);
+ registry.addListener(mergerRegistryListener, PLUGIN_ID + '.' + MERGER_PPID);
+ mergerRegistryListener.readRegistry(registry);
+
+ postProcessorRegistry = new PostProcessorRegistryImpl();
+ postProcessorRegistryListener = new PostProcessorRegistryListener(PLUGIN_ID, POST_PROCESSOR_PPID,
+ getLog(), postProcessorRegistry);
+ registry.addListener(postProcessorRegistryListener, PLUGIN_ID + '.' + POST_PROCESSOR_PPID);
+ postProcessorRegistryListener.readRegistry(registry);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ EMFCompareRCPPlugin.plugin = null;
+
+ final IExtensionRegistry registry = Platform.getExtensionRegistry();
+
+ registry.removeListener(postProcessorRegistryListener);
+ postProcessorRegistryListener = null;
+ postProcessorRegistry = null;
+
+ registry.removeListener(mergerRegistryListener);
+ mergerRegistryListener = null;
+ mergerRegistry = null;
+ }
+
+ /**
+ * Returns the merger registry to which extension will be registered.
+ *
+ * @return the merger registry to which extension will be registered
+ * @since 3.0
+ */
+ public IMerger.Registry getMergerRegistry() {
+ return mergerRegistry;
+ }
+
+ /**
+ * Returns the post processor registry to which extension will be registered.
+ *
+ * @return the post processor registry to which extension will be registered
+ */
+ public PostProcessorRegistryImpl getPostProcessorRegistry() {
+ return postProcessorRegistry;
+ }
+
+ /**
+ * Log the given message with the given severity to the logger of this plugin.
+ *
+ * @param severity
+ * the severity of the message.
+ * @param message
+ * the message to log.
+ */
+ public void log(int severity, String message) {
+ getLog().log(new Status(severity, PLUGIN_ID, message));
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static EMFCompareRCPPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/AbstractRegistryEventListener.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/AbstractRegistryEventListener.java
index b6ae52459..372b30fec 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/AbstractRegistryEventListener.java
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/AbstractRegistryEventListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -8,14 +8,16 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.ide.utils;
+package org.eclipse.emf.compare.rcp.extension;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IRegistryEventListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
/**
* Abstract utility class to listen to the {@link IExtensionRegistry}. It provides base implementation to
@@ -49,26 +51,31 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
}
/**
- * The plugin ID which declare the extension point to be monitored.
+ * The namespace of the extension point to be monitored.
*/
- private final String pluginID;
+ private final String namespace;
/**
* The extension point ID to be monitored.
*/
private final String extensionPointID;
+ private final ILog log;
+
/**
* Creates a new registry event listener.
*
- * @param pluginID
- * The plugin ID which declare the extension point to be monitored.
+ * @param namespace
+ * The namespace of the extension point to be monitored.
* @param extensionPointID
* The extension point ID to be monitored
+ * @param log
+ * The log object to be used to log error and/or warning.
*/
- public AbstractRegistryEventListener(String pluginID, String extensionPointID) {
- this.pluginID = pluginID;
+ public AbstractRegistryEventListener(String namespace, String extensionPointID, ILog log) {
+ this.namespace = namespace;
this.extensionPointID = extensionPointID;
+ this.log = log;
}
/**
@@ -79,7 +86,7 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
* the registry to read.
*/
public void readRegistry(IExtensionRegistry extensionRegistry) {
- IExtensionPoint point = extensionRegistry.getExtensionPoint(pluginID, extensionPointID);
+ IExtensionPoint point = extensionRegistry.getExtensionPoint(namespace, extensionPointID);
if (point != null) {
IConfigurationElement[] elements = point.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
@@ -99,7 +106,55 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
* is the element added or removed.
* @return true if the element is recognized as valid regarding the monitored extension point.
*/
- protected abstract boolean readElement(IConfigurationElement element, Action action);
+ protected boolean readElement(IConfigurationElement element, Action action) {
+ final boolean ret;
+ if (validateExtensionElement(element)) {
+ switch (action) {
+ case ADD:
+ ret = addedValid(element);
+ break;
+ case REMOVE:
+ ret = removedValid(element);
+ break;
+ default:
+ ret = false;
+ break;
+ }
+ } else {
+ ret = false;
+ }
+ return ret;
+ }
+
+ /**
+ * Validates if the given element is an element for the given extension and is well constructed. Returns
+ * true if the element should be further parsed for addition or removal.
+ *
+ * @param element
+ * the element to validate.
+ * @return true if the element should be further parsed for addition or removal, else otherwise.
+ */
+ protected abstract boolean validateExtensionElement(IConfigurationElement element);
+
+ /**
+ * Process the given element as the addition of a valid element extension.
+ *
+ * @param element
+ * the element to be added.
+ * @return true if the given element has been added and if its children should be processed, false
+ * otherwise.
+ */
+ protected abstract boolean addedValid(IConfigurationElement element);
+
+ /**
+ * Process the given element as the removal of a valid element extension.
+ *
+ * @param element
+ * the element to be removed.
+ * @return true if the given element has been removed and if its children should be processed, false
+ * otherwise.
+ */
+ protected abstract boolean removedValid(IConfigurationElement element);
/**
* Reads the given element and, if recognized, browse recursively the children and try to read it.
@@ -117,12 +172,12 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
internalReadElement(children[i], action);
}
} else {
- logError(element, "Error processing extension: " + element); //$NON-NLS-1$
+ log(IStatus.ERROR, element, "Error processing extension: " + element);
}
}
/**
- * Delegates the logging of a missing attribute to {@link #logError(IConfigurationElement, String)} with a
+ * Delegates the logging of a missing attribute to {@link #log(IConfigurationElement, String)} with a
* proper message.
*
* @param element
@@ -131,18 +186,33 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
* the name of the missing attribute.
*/
protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "The required attribute '" + attributeName + "' not defined"); //$NON-NLS-1$//$NON-NLS-2$
+ log(IStatus.ERROR, element, "The required attribute '" + attributeName + "' not defined");
}
/**
- * Log the error to any mean (often the current plugin logger).
+ * Log the error to the current plugin logger.
*
* @param element
* the element from which comes to the error.
- * @param string
+ * @param message
* the message to be logged.
*/
- protected abstract void logError(IConfigurationElement element, String string);
+ protected void log(int severity, IConfigurationElement element, String message) {
+ log.log(new Status(severity, element.getDeclaringExtension().getContributor().getName(), message));
+ }
+
+ /**
+ * Log the error to the current plugin logger.
+ *
+ * @param element
+ * the element from which comes to the error.
+ * @param message
+ * the message to be logged.
+ */
+ protected void log(IConfigurationElement element, Throwable t) {
+ log.log(new Status(IStatus.ERROR, element.getDeclaringExtension().getContributor().getName(), t
+ .getMessage(), t));
+ }
/**
* {@inheritDoc}
@@ -193,57 +263,4 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
public void removed(IExtensionPoint[] extensionPoints) {
// no need to listen to this.
}
-
- /**
- * Simple utility class to create proxy of extension that are
- * {@link IConfigurationElement#createExecutableExtension(String) instantiable}.
- * <p>
- * No test of the {@link IConfigurationElement#isValid() validity} of the wrapped
- * {@link IConfigurationElement} is performed. As such you should always extend this class while listening
- * to the {@link IExtensionRegistry} and react properly the removal of the wrapped
- * {@link IConfigurationElement}.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
- public static class PluginClassDescriptor {
- /**
- * The element from which create an instance.
- */
- protected IConfigurationElement element;
-
- /**
- * The name of the attribute that holds the class full name to be instantiated.
- */
- protected String attributeName;
-
- /**
- * Creates a new descriptor for given element keeping the class name to be instantiated in an
- * attribute named {@code attributeName}.
- *
- * @param element
- * The element from which create an instance.
- * @param attributeName
- * The name of the attribute that holds the class full name to be instantiated.
- */
- public PluginClassDescriptor(IConfigurationElement element, String attributeName) {
- this.element = element;
- this.attributeName = attributeName;
- }
-
- /**
- * Creates a new instance.
- *
- * @return the new instance.
- * @throws RuntimeException
- * wraps a CoreException if an instance of the executable extension could not be created
- * for any reason.
- */
- public Object createInstance() {
- try {
- return element.createExecutableExtension(attributeName);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- }
}
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/PluginClassDescriptor.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/PluginClassDescriptor.java
new file mode 100644
index 000000000..01e9595e8
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/extension/PluginClassDescriptor.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2013 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 - Initial API and implementation
+ * Obeo - Introduce generics and add documentation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.extension;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+
+/**
+ * Simple utility class to create proxy of extension that are
+ * {@link IConfigurationElement#createExecutableExtension(String) instantiable}.
+ * <p>
+ * No test of the {@link IConfigurationElement#isValid() validity} of the wrapped
+ * {@link IConfigurationElement} is performed. As such you should always extend this class while listening to
+ * the {@link IExtensionRegistry} and react properly the removal of the wrapped {@link IConfigurationElement}.
+ * <p>
+ * Note: this is based on {@code org.eclipse.emf.ecore.plugin.RegistryReader.PluginClassDescriptor}
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class PluginClassDescriptor<T> {
+ /**
+ * The element from which create an instance.
+ */
+ protected IConfigurationElement element;
+
+ /**
+ * The name of the attribute that holds the class full name to be instantiated.
+ */
+ protected String attributeName;
+
+ /**
+ * Creates a new descriptor for given element keeping the class name to be instantiated in an attribute
+ * named {@code attributeName}.
+ *
+ * @param element
+ * The element from which create an instance.
+ * @param attributeName
+ * The name of the attribute that holds the class full name to be instantiated.
+ */
+ public PluginClassDescriptor(IConfigurationElement element, String attributeName) {
+ this.element = element;
+ this.attributeName = attributeName;
+ }
+
+ /**
+ * Creates a new instance.
+ *
+ * @return the new instance.
+ * @throws RuntimeException
+ * wraps a CoreException if an instance of the executable extension could not be created for
+ * any reason.
+ */
+ @SuppressWarnings("unchecked")
+ protected T createInstance() {
+ try {
+ return (T)element.createExecutableExtension(attributeName);
+ } catch (CoreException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEMessages.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/EMFCompareRCPMessages.java
index f9d5adc32..f4030601e 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEMessages.java
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/EMFCompareRCPMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
+ * Copyright (c) 2006, 2013 Obeo.
* 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
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.ide;
+package org.eclipse.emf.compare.rcp.internal;
import java.text.MessageFormat;
import java.util.MissingResourceException;
@@ -19,9 +19,9 @@ import java.util.ResourceBundle;
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
-public final class EMFCompareIDEMessages {
+public final class EMFCompareRCPMessages {
/** Full qualified path to the properties file in which to seek the keys. */
- private static final String BUNDLE_NAME = "org.eclipse.emf.compare.ide.emfcompareidemessages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.eclipse.emf.compare.rcp.internal.emfcomparercpmessages"; //$NON-NLS-1$
/** Contains the locale specific {@link String}s needed by this plug-in. */
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
@@ -29,7 +29,7 @@ public final class EMFCompareIDEMessages {
/**
* Utility classes don't need to (and shouldn't) be instantiated.
*/
- private EMFCompareIDEMessages() {
+ private EMFCompareRCPMessages() {
// prevents instantiation
}
@@ -57,7 +57,8 @@ public final class EMFCompareIDEMessages {
* <code>'!' + key + '!'</code> will be returned in case we didn't find it in the bundle.
*/
public static String getString(String key) {
- // Pass through MessageFormat so that we're consistent in the handling of special chars such as the
+ // Pass through MessageFormat so that we're consistent in the handling
+ // of special chars such as the
// apostrophe
return MessageFormat.format(internalGetString(key), new Object[] {});
}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/emfcompareidemessages.properties b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/emfcomparercpmessages.properties
index 84e35f0fd..170ab4343 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/emfcompareidemessages.properties
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/emfcomparercpmessages.properties
@@ -9,8 +9,5 @@
# Obeo - initial API and implementation
################################################################################
## note : apostrophes need to be doubled in these messages or they'll be ignored
-synchronize.job.label = Querying EMF synchronization state
-storage.adapt.failure = Failed to retrieve an actual file revision for {0}
-
malformed.extension.attribute = Attribute {0} is malformed, should be an integer.
-duplicate.extension = The factory {0} is registered twice. \ No newline at end of file
+duplicate.merger = The merger {0} is registered twice. \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/merger/MergerExtensionRegistryListener.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/merger/MergerExtensionRegistryListener.java
new file mode 100644
index 000000000..014de3197
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/merger/MergerExtensionRegistryListener.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.internal.merger;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.compare.merge.IMerger;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+import org.eclipse.emf.compare.rcp.internal.EMFCompareRCPMessages;
+
+/**
+ * Listener for contributions to the merger extension.
+ */
+public class MergerExtensionRegistryListener extends AbstractRegistryEventListener {
+
+ /** TAG_MERGER. */
+ private static final String TAG_MERGER = "merger"; //$NON-NLS-1$
+
+ /** ATT_CLASS. */
+ private static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+ /** ATT_RANKING. */
+ private static final String ATT_RANKING = "ranking"; //$NON-NLS-1$
+
+ private final IMerger.Registry mergerRegistry;
+
+ /**
+ * Constructor.
+ *
+ * @param pluginID
+ * The plugin id.
+ * @param extensionPointID
+ * The extension point id.
+ * @param mergerRegistry
+ */
+ public MergerExtensionRegistryListener(String pluginID, String extensionPointID, ILog log,
+ IMerger.Registry mergerRegistry) {
+ super(pluginID, extensionPointID, log);
+ this.mergerRegistry = mergerRegistry;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener#readElement(org.eclipse.core.runtime.IConfigurationElement,
+ * org.eclipse.emf.compare.ide.utils.AbstractRegistryEventListener.Action)
+ */
+ @Override
+ protected boolean readElement(IConfigurationElement element, Action b) {
+ if (element.getName().equals(TAG_MERGER)) {
+ if (element.getAttribute(ATT_CLASS) == null) {
+ logMissingAttribute(element, ATT_CLASS);
+ } else if (element.getAttribute(ATT_RANKING) == null) {
+ String rankingStr = element.getAttribute(ATT_RANKING);
+ try {
+ Integer.parseInt(rankingStr);
+ } catch (NumberFormatException nfe) {
+ log(IStatus.ERROR, element, EMFCompareRCPMessages.getString(
+ "malformed.extension.attribute", //$NON-NLS-1$
+ ATT_RANKING));
+ }
+ logMissingAttribute(element, ATT_RANKING);
+ } else {
+ switch (b) {
+ case ADD:
+ try {
+ IMerger merger = (IMerger)element.createExecutableExtension(ATT_CLASS);
+ merger.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
+ IMerger previous = mergerRegistry.add(merger);
+ if (previous != null) {
+ log(IStatus.WARNING, element, EMFCompareRCPMessages.getString(
+ "duplicate.merger", merger.getClass().getName())); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ log(IStatus.ERROR, element, e.getMessage());
+ }
+ break;
+ case REMOVE:
+ mergerRegistry.remove(element.getAttribute(ATT_CLASS));
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ final boolean ret;
+ if (TAG_MERGER.equals(element.getName())) {
+ if (element.getAttribute(ATT_CLASS) == null) {
+ logMissingAttribute(element, ATT_CLASS);
+ ret = false;
+ } else if (element.getAttribute(ATT_RANKING) == null) {
+ String rankingStr = element.getAttribute(ATT_RANKING);
+ try {
+ Integer.parseInt(rankingStr);
+ } catch (NumberFormatException nfe) {
+ log(IStatus.ERROR, element, EMFCompareRCPMessages.getString(
+ "malformed.extension.attribute", //$NON-NLS-1$
+ ATT_RANKING));
+ }
+ logMissingAttribute(element, ATT_RANKING);
+ ret = false;
+ } else {
+ ret = true;
+ }
+ } else {
+ ret = false;
+ }
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ try {
+ IMerger merger = (IMerger)element.createExecutableExtension(ATT_CLASS);
+ merger.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
+ IMerger previous = mergerRegistry.add(merger);
+ if (previous != null) {
+ log(IStatus.WARNING, element, EMFCompareRCPMessages.getString(
+ "duplicate.extension", merger.getClass().getName())); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ log(IStatus.ERROR, element, e.getMessage());
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ mergerRegistry.remove(element.getAttribute(ATT_CLASS));
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorDescriptor.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorDescriptor.java
new file mode 100644
index 000000000..b803151e4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorDescriptor.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.internal.postprocessor;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.rcp.extension.PluginClassDescriptor;
+
+/**
+ * Describes an extension as contributed to the "org.eclipse.emf.compare.post_processor" extension point.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class PostProcessorDescriptor extends PluginClassDescriptor<IPostProcessor> implements IPostProcessor.Descriptor {
+
+ private IPostProcessor delegate;
+
+ private final Pattern nsURI;
+
+ private final Pattern resourceURI;
+
+ /**
+ * Creates a descriptor corresponding to the information of the given <em>element</em>.
+ *
+ * @param element
+ * Configuration element from which to create this descriptor.
+ */
+ public PostProcessorDescriptor(IConfigurationElement element, Pattern nsURI, Pattern resourceURI) {
+ super(element, PostProcessorRegistryListener.ATT_CLASS);
+ this.nsURI = nsURI;
+ this.resourceURI = resourceURI;
+ }
+
+ /**
+ * Creates an instance of this descriptor's post processor if needed, then return it.
+ *
+ * @return An instance of this descriptor's post processor.
+ */
+ public IPostProcessor getPostProcessor() {
+ if (delegate == null) {
+ delegate = createInstance();
+ }
+ return delegate;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postMatch(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postMatch(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postDiff(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postDiff(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postRequirements(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postRequirements(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postEquivalences(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postConflicts(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postConflicts(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postComparison(Comparison comparison, Monitor monitor) {
+ getPostProcessor().postComparison(comparison, monitor);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#getNsURI()
+ */
+ public Pattern getNsURI() {
+ return nsURI;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#getResourceURI()
+ */
+ public Pattern getResourceURI() {
+ return resourceURI;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorRegistryListener.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorRegistryListener.java
new file mode 100644
index 000000000..c6923e995
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/postprocessor/PostProcessorRegistryListener.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.internal.postprocessor;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+
+/**
+ * This listener will allow us to be aware of contribution changes against the model resolver extension point.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class PostProcessorRegistryListener extends AbstractRegistryEventListener {
+
+ static final String TAG_PROCESSOR = "processor"; //$NON-NLS-1$
+
+ static final String TAG_NS_URI = "nsURI"; //$NON-NLS-1$
+
+ static final String TAG_RESOURCE_URI = "resourceURI"; //$NON-NLS-1$
+
+ static final String ATT_VALUE = "value"; //$NON-NLS-1$
+
+ static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+ /** The post processor registry to which extension will be registered. */
+ private final IPostProcessor.Registry registry;
+
+ /**
+ * Creates a new registry listener with the given post processor registry to which extension will be
+ * registered.
+ *
+ * @param registry
+ * the post processor registry to which extension will be registered.
+ * @param pluginID
+ * @param extensionPointID
+ * @param log
+ */
+ public PostProcessorRegistryListener(String pluginID, String extensionPointID, ILog log,
+ IPostProcessor.Registry registry) {
+ super(pluginID, extensionPointID, log);
+ this.registry = registry;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#validateExtensionElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ final boolean valid;
+ if (TAG_PROCESSOR.equals(element.getName())) {
+ IConfigurationElement[] nsURIChildren = element.getChildren(TAG_NS_URI);
+ IConfigurationElement[] resourceURIChildren = element.getChildren(TAG_RESOURCE_URI);
+ if (element.getAttribute(ATT_CLASS) == null) {
+ logMissingAttribute(element, ATT_CLASS);
+ valid = false;
+ } else if (nsURIChildren.length > 0) {
+ if (nsURIChildren[0].getAttribute(ATT_VALUE) == null) {
+ logMissingAttribute(nsURIChildren[0], ATT_VALUE);
+ valid = false;
+ } else {
+ valid = true;
+ }
+ } else if (resourceURIChildren.length > 0) {
+ if (resourceURIChildren[0].getAttribute(ATT_VALUE) == null) {
+ logMissingAttribute(resourceURIChildren[0], ATT_VALUE);
+ valid = false;
+ } else {
+ valid = true;
+ }
+ } else {
+ log(IStatus.ERROR, element, "Post processor must have an nsURI or a resource URI");
+ valid = false;
+ }
+ } else {
+ valid = false;
+ }
+
+ return valid;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#addedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ IConfigurationElement[] nsURIChildren = element.getChildren(TAG_NS_URI);
+ IConfigurationElement[] resourceURIChildren = element.getChildren(TAG_RESOURCE_URI);
+ Pattern nsURI = null;
+ if (nsURIChildren.length > 0) {
+ nsURI = Pattern.compile(nsURIChildren[0].getAttribute(ATT_VALUE));
+ }
+ Pattern resourceURI = null;
+ if (resourceURIChildren.length > 0) {
+ resourceURI = Pattern.compile(resourceURIChildren[0].getAttribute(ATT_VALUE));
+ }
+
+ IPostProcessor processor = new PostProcessorDescriptor(element, nsURI, resourceURI);
+ IPostProcessor previous = registry.addPostProcessor(processor);
+ if (previous != null) {
+ EMFCompareRCPPlugin.getDefault().log(IStatus.WARNING,
+ "The post processor '" + element.getAttribute(ATT_CLASS) + "' is registered twice.");
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener#removedValid(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ registry.removePostProcessor(element.getAttribute(ATT_CLASS));
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
index 5c66f007b..7dd7531f7 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -16,8 +16,7 @@ import java.io.IOException;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
+import org.eclipse.emf.compare.postprocessor.PostProcessorRegistryImpl;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.nodes.NodesPackage;
import org.eclipse.emf.compare.tests.postprocess.data.PostProcessInputData;
@@ -54,12 +53,11 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// Post processing (add a match element) if EMF Compare scans a model coming from the namespace URI
// "http://www.eclipse.org/emf/compare/tests/nodes" at least.
- registry.addPostProcessor(new PostProcessorDescriptor(
- "http://www.eclipse.org/emf/compare/tests/nodes", null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor("http://www.eclipse.org/emf/compare/tests/nodes",
+ null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -74,11 +72,10 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// Post processing (add a match element) if EMF Compare scans a model from the namespace URI which
// matches the regex ".*/nodes" at least.
- registry.addPostProcessor(new PostProcessorDescriptor(".*/nodes", null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(".*/nodes", null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -93,10 +90,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned namespace URIs.
- registry.addPostProcessor(new PostProcessorDescriptor(".*/nides", null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(".*/nides", null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -111,10 +107,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned namespace URIs (null value case)
- registry.addPostProcessor(new PostProcessorDescriptor(null, null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -129,10 +124,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned namespace URIs (empty value case)
- registry.addPostProcessor(new PostProcessorDescriptor("", null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor("", null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -147,10 +141,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned namespace URIs (blank value case)
- registry.addPostProcessor(new PostProcessorDescriptor(" ", null,
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(" ", null));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -165,11 +158,10 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// Post processing (add a match element) if EMF Compare scans a resource where its URI is the same as
// the specified one at least.
- registry.addPostProcessor(new PostProcessorDescriptor(null, left.getURI().toString(),
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, left.getURI().toString()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -184,11 +176,10 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// Post processing (add a match element) if EMF Compare scans a resource where its URI matches the
// specified regex at least.
- registry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nodes",
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, ".*.nodes"));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -203,10 +194,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned resource URIs
- registry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nides",
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, ".*.nides"));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -221,10 +211,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned resource URIs (empty value)
- registry.addPostProcessor(new PostProcessorDescriptor(null, "",
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, ""));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
@@ -239,10 +228,9 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
- PostProcessorRegistry registry = new PostProcessorRegistry();
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
// No post processes if the regex matches no scanned resource URIs (blank value)
- registry.addPostProcessor(new PostProcessorDescriptor(null, " ",
- "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
+ registry.addPostProcessor(new TestPostProcessor(null, " "));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
index 11126127c..0497b0659 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -11,12 +11,13 @@
package org.eclipse.emf.compare.tests.postprocess.data;
import java.util.List;
+import java.util.regex.Pattern;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.extension.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
/**
* This provides a post processor to add a copy of the first scanned match at the same level of the
@@ -26,6 +27,18 @@ import org.eclipse.emf.compare.extension.IPostProcessor;
*/
public class TestPostProcessor implements IPostProcessor {
+ private Pattern nsURI;
+
+ private Pattern resourceURI;
+
+ /**
+ *
+ */
+ public TestPostProcessor(String nsURI, String resourceURI) {
+ this.nsURI = nsURI == null ? null : Pattern.compile(nsURI);
+ this.resourceURI = resourceURI == null ? null : Pattern.compile(resourceURI);
+ }
+
public void postMatch(Comparison comparison, Monitor monitor) {
final List<Match> matches = comparison.getMatches();
final Match lastMatch = matches.get(matches.size() - 1);
@@ -39,7 +52,7 @@ public class TestPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postConflicts(Comparison comparison, Monitor monitor) {
@@ -50,7 +63,7 @@ public class TestPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postEquivalences(Comparison comparison, Monitor monitor) {
@@ -61,7 +74,7 @@ public class TestPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postRequirements(Comparison comparison, Monitor monitor) {
@@ -72,7 +85,7 @@ public class TestPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postDiff(Comparison comparison, Monitor monitor) {
@@ -83,7 +96,25 @@ public class TestPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#getNsURI()
+ */
+ public Pattern getNsURI() {
+ return nsURI;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#getResourceURI()
+ */
+ public Pattern getResourceURI() {
+ return resourceURI;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postComparison(Comparison comparison, Monitor monitor) {
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
index af129b3ed..7bf0a7aaf 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.emf.compare.ide.ui.accessor_factory">
+ point="org.eclipse.emf.compare.ide.ui.accessorFactory">
<factory
class="org.eclipse.emf.compare.uml2.ide.ui.internal.accessor.factory.UMLIDEManyStructuralFeatureAccessorFactory"
ranking="20">
@@ -13,7 +13,7 @@
</factory>
<factory
class="org.eclipse.emf.compare.uml2.ide.ui.internal.accessor.factory.UMLStereotypeApplicationChangeFeatureAccessorFactory"
- ranking="21">
+ ranking="25">
</factory>
</extension>
<extension
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide/plugin.xml b/plugins/org.eclipse.emf.compare.uml2.ide/plugin.xml
index 636d30f43..ad0fde7a6 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.uml2.ide/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.emf.compare.ide.load_on_demand_policy">
+ point="org.eclipse.emf.compare.ide.loadOnDemandPolicy">
<policy
class="org.eclipse.emf.compare.uml2.ide.internal.policy.UMLLoadOnDemandPolicy">
</policy>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
index a69b5d5cf..aab74699b 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
@@ -17,6 +17,7 @@ import com.google.common.collect.Iterators;
import java.util.Iterator;
import java.util.List;
+import java.util.regex.Pattern;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicMonitor;
@@ -27,11 +28,10 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.merge.BatchMerger;
import org.eclipse.emf.compare.merge.IBatchMerger;
import org.eclipse.emf.compare.merge.IMerger;
+import org.eclipse.emf.compare.postprocessor.PostProcessorRegistryImpl;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
import org.eclipse.emf.compare.uml2.diff.UMLDiffExtensionPostProcessor;
@@ -67,10 +67,9 @@ public abstract class AbstractTest {
@Before
public void before() {
- PostProcessorRegistry registry = new PostProcessorRegistry();
- registry.addPostProcessor(new PostProcessorDescriptor("http://www.eclipse.org/uml2/\\d\\.0\\.0/UML",
- null, "org.eclipse.emf.compare.uml2.diff.UMLDiffExtensionPostProcessor",
- new UMLDiffExtensionPostProcessor()));
+ PostProcessorRegistryImpl registry = new PostProcessorRegistryImpl();
+ registry.addPostProcessor(new UMLDiffExtensionPostProcessor(Pattern
+ .compile("http://www.eclipse.org/uml2/\\d\\.0\\.0/UML"), null));
emfCompare = EMFCompare.builder().setPostProcessorRegistry(registry).build();
}
diff --git a/plugins/org.eclipse.emf.compare.uml2/plugin.xml b/plugins/org.eclipse.emf.compare.uml2/plugin.xml
index 9b47b4a89..ab6632800 100644
--- a/plugins/org.eclipse.emf.compare.uml2/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.uml2/plugin.xml
@@ -21,19 +21,19 @@ Contributors:
genModel="model/uml2diff.genmodel"/>
</extension>
<extension
- point="org.eclipse.emf.compare.postProcessor">
- <postProcessor
+ point="org.eclipse.emf.compare.rcp.postProcessor">
+ <processor
class="org.eclipse.emf.compare.uml2.diff.UMLDiffExtensionPostProcessor">
<nsURI
value="http://www.eclipse.org/uml2/\d.0.0/UML">
</nsURI>
- </postProcessor>
+ </processor>
</extension>
<extension
- point="org.eclipse.emf.compare.ide.mergerExtension">
+ point="org.eclipse.emf.compare.rcp.merger">
<merger
class="org.eclipse.emf.compare.uml2.merge.UMLDiffMerger"
- ranking="11">
+ ranking="20">
</merger>
</extension>
diff --git a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
index 01ddf86b4..870925356 100644
--- a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.uml2.diff;
import com.google.common.collect.Iterables;
@@ -11,6 +21,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
@@ -19,7 +30,7 @@ import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.extension.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.AbstractPostProcessor;
import org.eclipse.emf.compare.uml2.UMLDiff;
import org.eclipse.emf.compare.uml2.diff.internal.extension.DiffExtensionFactoryRegistry;
import org.eclipse.emf.compare.uml2.diff.internal.extension.IDiffExtensionFactory;
@@ -29,7 +40,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.uml2.common.util.SubsetSupersetEObjectEList;
-public class UMLDiffExtensionPostProcessor implements IPostProcessor {
+public class UMLDiffExtensionPostProcessor extends AbstractPostProcessor {
+
/** UML2 extensions factories. */
private Set<IDiffExtensionFactory> uml2ExtensionFactories;
@@ -60,10 +72,22 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
*/
private static final Field SUBSET_FEATURES_FIELD = getSubsetField();
+ public UMLDiffExtensionPostProcessor() {
+ super(Pattern.compile("http://www.eclipse.org/uml2/\\d.\\d.\\d/UML"), null);
+ }
+
+ /**
+ * @param nsURI
+ * @param resourceURI
+ */
+ public UMLDiffExtensionPostProcessor(Pattern nsURI, Pattern resourceURI) {
+ super(nsURI, resourceURI);
+ }
+
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postMatch(Comparison comparison, Monitor monitor) {
@@ -73,7 +97,7 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postDiff(Comparison comparison, Monitor monitor) {
@@ -178,7 +202,7 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postRequirements(Comparison comparison, Monitor monitor) {
@@ -188,7 +212,7 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postEquivalences(Comparison comparison, Monitor monitor) {
@@ -218,7 +242,7 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postConflicts(Comparison comparison, Monitor monitor) {
@@ -228,7 +252,7 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.common.util.Monitor)
*/
public void postComparison(Comparison comparison, Monitor monitor) {
diff --git a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
index 94a2c36a6..29d786e9e 100644
--- a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Export-Package: org.eclipse.emf.compare,
org.eclipse.emf.compare.conflict,
org.eclipse.emf.compare.diff,
org.eclipse.emf.compare.equi,
- org.eclipse.emf.compare.extension,
org.eclipse.emf.compare.impl,
org.eclipse.emf.compare.internal;x-friends:="org.eclipse.emf.compare.logical,org.eclipse.emf.compare.ide",
org.eclipse.emf.compare.internal.spec;x-friends:="org.eclipse.emf.compare.tests",
@@ -19,6 +18,7 @@ Export-Package: org.eclipse.emf.compare,
org.eclipse.emf.compare.match.eobject,
org.eclipse.emf.compare.match.resource,
org.eclipse.emf.compare.merge,
+ org.eclipse.emf.compare.postprocessor,
org.eclipse.emf.compare.req,
org.eclipse.emf.compare.scope,
org.eclipse.emf.compare.util,
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
index db03a30b1..c79dfbe40 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -24,10 +24,10 @@ import org.eclipse.emf.compare.diff.DiffBuilder;
import org.eclipse.emf.compare.diff.IDiffEngine;
import org.eclipse.emf.compare.equi.DefaultEquiEngine;
import org.eclipse.emf.compare.equi.IEquiEngine;
-import org.eclipse.emf.compare.extension.IPostProcessor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IMatchEngine;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.PostProcessorRegistryImpl;
import org.eclipse.emf.compare.req.DefaultReqEngine;
import org.eclipse.emf.compare.req.IReqEngine;
import org.eclipse.emf.compare.scope.DefaultComparisonScope;
@@ -66,7 +66,7 @@ public class EMFCompare {
private final IConflictDetector conflictDetector;
/** The PostProcessorRegistry to use to find an IPostProcessor. */
- private final PostProcessorRegistry postProcessorRegistry;
+ private final IPostProcessor.Registry postProcessorRegistry;
/**
* Creates a new EMFCompare object able to compare Notifier with the help of given engines.
@@ -86,7 +86,7 @@ public class EMFCompare {
*/
protected EMFCompare(IMatchEngine matchEngine, IDiffEngine diffEngine, IReqEngine reqEngine,
IEquiEngine equiEngine, IConflictDetector conflictDetector,
- PostProcessorRegistry postProcessorRegistry) {
+ IPostProcessor.Registry postProcessorRegistry) {
this.matchEngine = checkNotNull(matchEngine);
this.diffEngine = checkNotNull(diffEngine);
this.reqEngine = checkNotNull(reqEngine);
@@ -246,7 +246,7 @@ public class EMFCompare {
protected IConflictDetector conflictDetector;
/** The PostProcessorRegistry to use to find an IPostProcessor. */
- protected PostProcessorRegistry registry;
+ protected IPostProcessor.Registry registry;
/**
* Creates a new builder object.
@@ -321,7 +321,7 @@ public class EMFCompare {
* the PostProcessor to be used to find the post processor of each comparison steps.
* @return this same builder to allow chained call.
*/
- public Builder setPostProcessorRegistry(PostProcessorRegistry r) {
+ public Builder setPostProcessorRegistry(IPostProcessor.Registry r) {
this.registry = checkNotNull(r);
return this;
}
@@ -345,7 +345,7 @@ public class EMFCompare {
equiEngine = new DefaultEquiEngine();
}
if (registry == null) {
- registry = new PostProcessorRegistry();
+ registry = new PostProcessorRegistryImpl();
}
if (conflictDetector == null) {
conflictDetector = new DefaultConflictDetector();
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java
deleted file mode 100644
index 104b0d318..000000000
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.extension;
-
-/**
- * Describes an extension to make post handling at each step of the comparison. This descriptor has to be
- * added in the PostProcessorRegistry in order that the contribution be effective.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class PostProcessorDescriptor {
-
- /** Qualified class name of the post processor. This will be used as an id to remove contributions. */
- protected String extensionClassName;
-
- /** Namespace URIs (regex) this processor applies to. */
- protected String nsUri;
-
- /** Resource URIs (regex) this processor applies to. */
- protected String resourceUri;
-
- /** We only need to create the instance once, this will keep reference to it. */
- protected IPostProcessor postProcessor;
-
- /**
- * Constructor.
- */
- public PostProcessorDescriptor() {
- }
-
- /**
- * Constructor used in standalone applications. It enables to manually initialize the descriptor.
- *
- * @param nsUri
- * The namespace URI the post processor applies to.
- * @param resourceUri
- * The resource URI the post processor applies to.
- * @param extensionClassName
- * The qualified name of the post processor.
- * @param postProcessor
- * The post processor itself.
- */
- public PostProcessorDescriptor(String nsUri, String resourceUri, String extensionClassName,
- IPostProcessor postProcessor) {
- this.nsUri = nsUri;
- this.resourceUri = resourceUri;
- this.extensionClassName = extensionClassName;
- this.postProcessor = postProcessor;
- }
-
- /**
- * Returns this descriptor's post processor qualified name.
- *
- * @return This descriptor's post processor qualified name.
- */
- public String getExtensionClassName() {
- return extensionClassName;
- }
-
- /**
- * Returns the post processor related to this descriptor.
- *
- * @return The post processor.
- */
- public IPostProcessor getPostProcessor() {
- return postProcessor;
- }
-
- /**
- * Returns the namespace URI.
- *
- * @return The namespace URI.
- */
- public String getNsURI() {
- return nsUri;
- }
-
- /**
- * Returns the resource URI.
- *
- * @return The resource URI.
- */
- public String getResourceURI() {
- return resourceUri;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java
deleted file mode 100644
index d2e0af443..000000000
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.extension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.eclipse.emf.compare.scope.IComparisonScope;
-
-/**
- * This will contain all of the EMF Compare extensions.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class PostProcessorRegistry {
-
- /** List of all the post processors contributed through "org.eclipse.emf.compare.postProcessor". */
- private final List<PostProcessorDescriptor> postProcessors;
-
- /**
- * Creates a new extension registry.
- */
- public PostProcessorRegistry() {
- postProcessors = new CopyOnWriteArrayList<PostProcessorDescriptor>();
- }
-
- /**
- * Adds a post processor to the registry.
- *
- * @param postProcessor
- * Post Processor that is to be added to this registry.
- */
- public void addPostProcessor(PostProcessorDescriptor postProcessor) {
- postProcessors.add(postProcessor);
- }
-
- /**
- * Removes all extensions from this registry.
- *
- * @noreference This method is not intended to be referenced by clients.
- */
- public void clearRegistry() {
- postProcessors.clear();
- }
-
- /**
- * This will return a copy of the registered post processors list.
- *
- * @return A copy of the registered post processors list.
- */
- public List<PostProcessorDescriptor> getRegisteredPostProcessors() {
- return postProcessors;
- }
-
- /**
- * Removes a post processor from this registry.
- *
- * @param postProcessorClassName
- * Qualified class name of the post processor that is to be removed from the registry.
- */
- public void removePostProcessor(String postProcessorClassName) {
- for (PostProcessorDescriptor descriptor : getRegisteredPostProcessors()) {
- if (descriptor.getExtensionClassName().equals(postProcessorClassName)) {
- postProcessors.remove(descriptor);
- }
- }
- }
-
- /**
- * Retrieve the post processors from a given <code>scope</code>. The scope provides the set of scanned
- * namespaces and resource uris. If they match with the regex of a "org.eclipse.emf.compare.postProcessor"
- * extension point, then the associated post processors are returned.
- *
- * @param scope
- * The given scope.
- * @return The associated post processors if any.
- */
- public List<IPostProcessor> getPostProcessors(IComparisonScope scope) {
- final List<IPostProcessor> processors = new ArrayList<IPostProcessor>();
- final Iterator<PostProcessorDescriptor> postProcessorIterator = postProcessors.iterator();
- while (postProcessorIterator.hasNext()) {
- final PostProcessorDescriptor descriptor = postProcessorIterator.next();
- if (descriptor.getNsURI() != null && descriptor.getNsURI().trim().length() != 0) {
- final Iterator<String> nsUris = scope.getNsURIs().iterator();
- while (nsUris.hasNext()) {
- if (nsUris.next().matches(descriptor.getNsURI())) {
- processors.add(descriptor.getPostProcessor());
- break;
- }
- }
- }
- // Should probably use two loops here to prioritize NsURI matching
- if (descriptor.getResourceURI() != null && descriptor.getResourceURI().trim().length() != 0) {
- final Iterator<String> resourceUris = scope.getResourceURIs().iterator();
- while (resourceUris.hasNext()) {
- if (resourceUris.next().matches(descriptor.getResourceURI())) {
- processors.add(descriptor.getPostProcessor());
- break;
- }
- }
- }
- }
- return processors;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/AbstractPostProcessor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/AbstractPostProcessor.java
new file mode 100644
index 000000000..c32d266b9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/AbstractPostProcessor.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.postprocessor;
+
+import java.util.regex.Pattern;
+
+/**
+ * Abstract implementation of a post processor. It handles nsURI and resourceURI patterns as final fields.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public abstract class AbstractPostProcessor implements IPostProcessor {
+
+ /** Namespace URIs (regex) this processor applies to. */
+ private final Pattern nsUri;
+
+ /** Resource URIs (regex) this processor applies to. */
+ private final Pattern resourceUri;
+
+ /**
+ * Constructor.
+ */
+ public AbstractPostProcessor(Pattern nsURI, Pattern resourceURI) {
+ nsUri = nsURI;
+ resourceUri = resourceURI;
+ }
+
+ /**
+ * Returns the namespace URI.
+ *
+ * @return The namespace URI.
+ */
+ public Pattern getNsURI() {
+ return nsUri;
+ }
+
+ /**
+ * Returns the resource URI.
+ *
+ * @return The resource URI.
+ */
+ public Pattern getResourceURI() {
+ return resourceUri;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/IPostProcessor.java
index 9ef25d788..545301572 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/IPostProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* 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
@@ -8,10 +8,15 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.extension;
+package org.eclipse.emf.compare.postprocessor;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.regex.Pattern;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.scope.IComparisonScope;
/**
* Implementations of this interface can be used in order to tell EMF Compare how to make post treatments at
@@ -93,4 +98,82 @@ public interface IPostProcessor {
*/
void postComparison(Comparison comparison, Monitor monitor);
+ /**
+ * Returns the pattern of namespace URI on which this post processor can be applied.
+ *
+ * @return The namespace URI pattern.
+ */
+ Pattern getNsURI();
+
+ /**
+ * Returns the pattern of resource URI on which this post processor can be applied.
+ *
+ * @return The resource URI.
+ */
+ Pattern getResourceURI();
+
+ /**
+ * Registry of post processor.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+ public interface Registry {
+
+ /**
+ * Adds a post processor to the registry.
+ *
+ * @param postProcessor
+ * Post Processor that is to be added to this registry.
+ */
+ IPostProcessor addPostProcessor(IPostProcessor postProcessor);
+
+ /**
+ * Removes all extensions from this registry.
+ *
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ void clear();
+
+ /**
+ * This will return a copy of the registered post processors list.
+ *
+ * @return A copy of the registered post processors list.
+ */
+ ImmutableList<IPostProcessor> getPostProcessors();
+
+ /**
+ * Removes a post processor from this registry.
+ *
+ * @param postProcessorClassName
+ * Qualified class name of the post processor that is to be removed from the registry.
+ * @return the previous value associated with <tt>key</tt>, or <tt>null</tt> if there was no mapping
+ * for <tt>key</tt>.
+ */
+ IPostProcessor removePostProcessor(String postProcessorClassName);
+
+ /**
+ * Retrieve the post processors from a given <code>scope</code>. The scope provides the set of scanned
+ * namespaces and resource uris. If they match with the regex of some post processors, then tey are
+ * returned.
+ *
+ * @param scope
+ * The given scope.
+ * @return The associated post processors if any.
+ */
+ ImmutableList<IPostProcessor> getPostProcessors(IComparisonScope scope);
+ }
+
+ /**
+ * Wrapper describing the given post processor
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+ interface Descriptor extends IPostProcessor {
+ /**
+ * Returns the wrapped post processor
+ *
+ * @return the wrapped post processor
+ */
+ IPostProcessor getPostProcessor();
+ }
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/PostProcessorRegistryImpl.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/PostProcessorRegistryImpl.java
new file mode 100644
index 000000000..ca7731c37
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/postprocessor/PostProcessorRegistryImpl.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.postprocessor;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.compare.scope.IComparisonScope;
+
+/**
+ * This will contain all of the EMF Compare extensions.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class PostProcessorRegistryImpl implements IPostProcessor.Registry {
+
+ /** List of all the post processors contributed through "org.eclipse.emf.compare.postProcessor". */
+ private final Map<String, IPostProcessor> postProcessors;
+
+ /**
+ * Creates a new extension registry.
+ */
+ public PostProcessorRegistryImpl() {
+ postProcessors = new ConcurrentHashMap<String, IPostProcessor>();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.Registry#addPostProcessor(org.eclipse.emf.compare.extension.PostProcessorDescriptor)
+ */
+ public IPostProcessor addPostProcessor(IPostProcessor postProcessor) {
+ if (postProcessor instanceof IPostProcessor.Descriptor) {
+ return postProcessors.put(((IPostProcessor.Descriptor)postProcessor).getPostProcessor()
+ .getClass().getName(), postProcessor);
+ } else {
+ return postProcessors.put(postProcessor.getClass().getName(), postProcessor);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.Registry#clearRegistry()
+ */
+ public void clear() {
+ postProcessors.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.Registry#getRegisteredPostProcessors()
+ */
+ public ImmutableList<IPostProcessor> getPostProcessors() {
+ return ImmutableList.copyOf(postProcessors.values());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return
+ * @see org.eclipse.emf.compare.extension.Registry#removePostProcessor(java.lang.String)
+ */
+ public IPostProcessor removePostProcessor(String postProcessorClassName) {
+ return postProcessors.remove(postProcessorClassName);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.Registry#getPostProcessors(org.eclipse.emf.compare.scope.IComparisonScope)
+ */
+ public ImmutableList<IPostProcessor> getPostProcessors(IComparisonScope scope) {
+ final ImmutableList.Builder<IPostProcessor> processors = ImmutableList.builder();
+ for (IPostProcessor postProcessor : getPostProcessors()) {
+ Pattern nsURIPattern = postProcessor.getNsURI();
+ if (nsURIPattern != null) {
+ for (String nsURI : scope.getNsURIs()) {
+ if (nsURIPattern.matcher(nsURI).matches()) {
+ processors.add(postProcessor);
+ break;
+ }
+ }
+ }
+ // Should probably use two loops here to prioritize NsURI matching
+ Pattern resourceURIPattern = postProcessor.getResourceURI();
+ if (resourceURIPattern != null) {
+ for (String resourceURI : scope.getResourceURIs()) {
+ if (resourceURIPattern.matcher(resourceURI).matches()) {
+ processors.add(postProcessor);
+ break;
+ }
+ }
+ }
+ }
+ return processors.build();
+ }
+}

Back to the top