Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-04-03 14:10:03 -0400
committerCamille Letavernier2014-04-03 14:10:03 -0400
commitfe3c331ceb1147c8ff572f49f0bdfa95396766b1 (patch)
tree79ad82e18b09ffda39f397de36dc181cfdd27f1e
parenta749799122653dd09914d8d275a1645a06a5e7fb (diff)
downloadorg.eclipse.papyrus-fe3c331ceb1147c8ff572f49f0bdfa95396766b1.tar.gz
org.eclipse.papyrus-fe3c331ceb1147c8ff572f49f0bdfa95396766b1.tar.xz
org.eclipse.papyrus-fe3c331ceb1147c8ff572f49f0bdfa95396766b1.zip
[EMF Facet 0.2] Remove some dependencies to EMF Facet
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF1
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/META-INF/MANIFEST.MF1
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/providers/ExtensivePartitionNameLabelProvider.java52
3 files changed, 28 insertions, 26 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
index 4797222df87..d5df075e20b 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
@@ -34,7 +34,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.cdo.dawn.gmf;bundle-version="[2.1.0,3.0.0)",
org.eclipse.emf.cdo.dawn.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.3.0",
org.eclipse.papyrus.infra.onefile;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0",
org.eclipse.papyrus.cdo.validation.problems;bundle-version="1.0.0",
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/META-INF/MANIFEST.MF b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/META-INF/MANIFEST.MF
index ac2c7899b34..df29f34e34e 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/META-INF/MANIFEST.MF
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/META-INF/MANIFEST.MF
@@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core,
org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
org.eclipse.ui.navigator;bundle-version="3.5.101",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.2",
org.eclipse.papyrus.infra.emf.readonly,
org.eclipse.core.expressions,
org.eclipse.uml2.uml;bundle-version="3.2.100",
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/providers/ExtensivePartitionNameLabelProvider.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/providers/ExtensivePartitionNameLabelProvider.java
index 4926945c839..6026b1672bf 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/providers/ExtensivePartitionNameLabelProvider.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/providers/ExtensivePartitionNameLabelProvider.java
@@ -13,11 +13,11 @@ package org.eclipse.papyrus.team.collaborative.strategy.ui.providers;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
@@ -46,7 +46,7 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
/**
* Instantiates a new extensive label provider.
- *
+ *
* @param predicate
* the predicate
*/
@@ -65,7 +65,7 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
/**
* Sets the color.
- *
+ *
* @param color
* the new color
*/
@@ -76,7 +76,7 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
/**
* Sets the font.
- *
+ *
* @param font
* the new font
*/
@@ -89,19 +89,17 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
*
* @see org.eclipse.papyrus.modelexplorer.MoDiscoLabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
String superText = internal.getText(element);
- if(element instanceof ModelElementItem) {
- ModelElementItem elem = (ModelElementItem)element;
- EObject eObject = elem.getEObject();
- if(eObject != null) {
- String partitionName = getPartitionName(eObject);
- if(partitionName != null) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(partitionName);
- stringBuilder.append(superText);
- superText = stringBuilder.toString();
- }
+ EObject eObject = EMFHelper.getEObject(element);
+ if(eObject != null) {
+ String partitionName = getPartitionName(eObject);
+ if(partitionName != null) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(partitionName);
+ stringBuilder.append(superText);
+ superText = stringBuilder.toString();
}
}
return superText;
@@ -114,7 +112,7 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
/**
* Gets the partition name.
- *
+ *
* @param eObject
* the e object
* @return the partition name
@@ -138,13 +136,13 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
*
* @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getFont(java.lang.Object)
*/
- @SuppressWarnings("restriction")
+ @Override
public Font getFont(Object element) {
if(predicate != null) {
- if(element instanceof ModelElementItem) {
- ModelElementItem eObject = (ModelElementItem)element;
+ EObject eObject = EMFHelper.getEObject(element);
+ if(eObject != null) {
if(font != null) {
- if(predicate.apply(eObject.getEObject())) {
+ if(predicate.apply(eObject)) {
return font;
}
}
@@ -161,13 +159,13 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
*
* @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getForeground(java.lang.Object)
*/
- @SuppressWarnings("restriction")
+ @Override
public Color getForeground(Object element) {
if(predicate != null) {
- if(element instanceof ModelElementItem) {
- ModelElementItem eObject = (ModelElementItem)element;
+ EObject eObject = EMFHelper.getEObject(element);
+ if(eObject != null) {
if(color != null) {
- if(predicate.apply(eObject.getEObject())) {
+ if(predicate.apply(eObject)) {
return color;
}
}
@@ -180,34 +178,40 @@ public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColo
}
+ @Override
public void addListener(ILabelProviderListener listener) {
internal.addListener(listener);
}
+ @Override
public void dispose() {
internal.dispose();
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return internal.isLabelProperty(element, property);
}
+ @Override
public void removeListener(ILabelProviderListener listener) {
internal.removeListener(listener);
}
+ @Override
public Image getImage(Object element) {
return internal.getImage(element);
}
+ @Override
public Color getBackground(Object element) {
if(internal instanceof IColorProvider) {
return ((IColorProvider)internal).getBackground(element);

Back to the top