Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracuccuru2014-01-07 18:35:23 +0000
committeracuccuru2014-01-07 18:35:23 +0000
commite6736917f818b8c735756c263a7c966ba62dd2b3 (patch)
tree96c2e925f0cd61edaf0106a298def17c7488c439 /extraplugins
parent3e18efd3e2b535459462202b4d030643c522b438 (diff)
parent6fa7b8085953a872914cab9ebc01d4088d77581b (diff)
downloadorg.eclipse.papyrus-e6736917f818b8c735756c263a7c966ba62dd2b3.tar.gz
org.eclipse.papyrus-e6736917f818b8c735756c263a7c966ba62dd2b3.tar.xz
org.eclipse.papyrus-e6736917f818b8c735756c263a7c966ba62dd2b3.zip
Merge branch 'compare'
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/plugin.xml5
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java (renamed from extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/SampleUMLProvider.java)38
3 files changed, 19 insertions, 27 deletions
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/META-INF/MANIFEST.MF b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/META-INF/MANIFEST.MF
index e795e958d92..a8f5c59fcf5 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/META-INF/MANIFEST.MF
@@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.common,
org.eclipse.uml2.uml;bundle-version="4.1.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0",
- org.eclipse.uml2.uml.edit;bundle-version="4.1.0"
+ org.eclipse.uml2.uml.edit;bundle-version="4.1.0",
+ org.eclipse.emf.compare.edit;bundle-version="3.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/plugin.xml b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/plugin.xml
index d9d0e003eff..b36b44abfd7 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/plugin.xml
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/plugin.xml
@@ -44,9 +44,10 @@
</menuContribution>
</extension> -->
<extension
- point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ point="org.eclipse.emf.compare.edit.adapterFactory">
<factory
- class="org.eclipse.papyrus.uml.compare.ui.provider.SampleUMLProvider"
+ class="org.eclipse.papyrus.uml.compare.ui.provider.PapyrusCompareAdapterFactory"
+ ranking="11"
supportedTypes="org.eclipse.emf.edit.provider.IItemLabelProvider"
uri="http://www.eclipse.org/uml2/4.0.0/UML">
</factory>
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/SampleUMLProvider.java b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java
index 2cd609d7e36..a36acf4ec29 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/SampleUMLProvider.java
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java
@@ -15,31 +15,23 @@
package org.eclipse.papyrus.uml.compare.ui.provider;
import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.services.labelprovider.service.impl.LabelProviderServiceImpl;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
import org.eclipse.uml2.uml.Element;
-public class SampleUMLProvider extends AdapterFactoryImpl {
+public class PapyrusCompareAdapterFactory extends AdapterFactoryImpl {
/**
* The instance of the actual label provider
*/
private LabelProviderAdapter instance = new LabelProviderAdapter();
- /**
- * The UMLItemProviderAdapterFactory to which production of IItemLabelProvider
- * is delegated
- */
- private AdapterFactory delegate = new UMLItemProviderAdapterFactory();
-
/**
* Overrides AdapatFactoryImple.adapt so that, if the target element is an Element,
* and if the requested adaptation type is IItemLabelProvider,
@@ -49,36 +41,34 @@ public class SampleUMLProvider extends AdapterFactoryImpl {
*/
@Override
public Adapter adapt(Notifier target, Object type) {
- // Test on instance.isRunning to avoid a stack overflow
- // Delegate to UML Item Label Provider
- if (target instanceof Element && type == IItemLabelProvider.class){
- if (! instance.isRunning){
- return instance;
- } else {
- return delegate.adapt(target, type);
- }
+ if (target instanceof Element && type == IItemLabelProvider.class) {
+ return instance;
}
- // FIXME Propose a more generic solution? (not bound directly to UML)
return super.adapt(target, type);
}
private class LabelProviderAdapter extends AdapterImpl implements IItemLabelProvider {
-
- private boolean isRunning = false;
+ /**
+ * An instance of the Papyrus label provider service
+ */
private LabelProviderService service = new LabelProviderServiceImpl();
+ /**
+ * Delegates production of the text label to the
+ * label provider associated with the Papyrus label provider service
+ */
public String getText(Object object) {
- isRunning = true;
String result = service.getLabelProvider().getText(object);
- isRunning = false;
return result;
}
+ /**
+ * Delegates production of the image to the
+ * label provider associated with the Papyrus label provider service
+ */
public Object getImage(Object object) {
- isRunning = true;
Object result = service.getLabelProvider().getImage(object);
- isRunning = false;
return result;
}

Back to the top