Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsma Smaoui2018-04-16 13:32:33 +0000
committerPatrick Tessier2018-05-22 08:32:05 +0000
commitd4f0d45f9f3881b9313349150e37ab03a779647c (patch)
tree1c414c71c96d5b4ba0f29ed8b4d0724572bec260
parent189141fe5d923f3f83e263207a9d8ccfe32281ed (diff)
downloadorg.eclipse.papyrus-d4f0d45f9f3881b9313349150e37ab03a779647c.tar.gz
org.eclipse.papyrus-d4f0d45f9f3881b9313349150e37ab03a779647c.tar.xz
org.eclipse.papyrus-d4f0d45f9f3881b9313349150e37ab03a779647c.zip
Bug 533613 - [Table] [Properties view] change the row sources content
provider to include text-filter and an History widget * include also imported package elements Change-Id: If04e86e8a7dfbc206ccd422df703018578a4d53b Signed-off-by: Asma Smaoui <asma.smaoui@cea.fr> (cherry picked from commit 552c794e40cf35049ba9ae28ab8b73c248157b10)
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/MatrixSourcesContentProvider.java3
-rwxr-xr-xplugins/uml/nattable/org.eclipse.papyrus.uml.nattable.properties/src/org/eclipse/papyrus/uml/nattable/properties/modelelements/GenericUMLRelationshipMatrixModelElement.java16
2 files changed, 13 insertions, 6 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/MatrixSourcesContentProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/MatrixSourcesContentProvider.java
index 6cf95d70e8b..ca3583678d7 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/MatrixSourcesContentProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/MatrixSourcesContentProvider.java
@@ -22,8 +22,9 @@ import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
* This class provides the elements of the model to used them as source for the rows and columns of the matrix
*
* @since 3.0
- *
+ * @deprecated since Papyrus 6.0.100
*/
+@Deprecated
public class MatrixSourcesContentProvider extends EcoreModelContentProvider implements IStaticContentProvider {
/**
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.properties/src/org/eclipse/papyrus/uml/nattable/properties/modelelements/GenericUMLRelationshipMatrixModelElement.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.properties/src/org/eclipse/papyrus/uml/nattable/properties/modelelements/GenericUMLRelationshipMatrixModelElement.java
index ddae1fce18e..0ddb52b3020 100755
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.properties/src/org/eclipse/papyrus/uml/nattable/properties/modelelements/GenericUMLRelationshipMatrixModelElement.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.properties/src/org/eclipse/papyrus/uml/nattable/properties/modelelements/GenericUMLRelationshipMatrixModelElement.java
@@ -9,6 +9,7 @@
* Contributors:
* Vincent LORENZO (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - Bug 532639
+ * Asma Smaoui (CEA LIST) - asma.smaoui@cea.fr - Bug 533613
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.properties.modelelements;
@@ -18,12 +19,12 @@ import java.util.Iterator;
import java.util.List;
import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -51,6 +52,7 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattablewrapper.EObject
import org.eclipse.papyrus.infra.nattable.provider.MatrixRelationshipDirectionLabelProvider;
import org.eclipse.papyrus.infra.nattable.provider.MatrixRelationshipOwnerStrategyLabelProvider;
import org.eclipse.papyrus.infra.properties.ui.modelelement.EMFModelElement;
+import org.eclipse.papyrus.infra.ui.emf.utils.ProviderHelper;
import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.uml.expressions.umlexpressions.UMLExpressionsPackage;
@@ -340,10 +342,13 @@ public class GenericUMLRelationshipMatrixModelElement extends EMFModelElement {
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
IStaticContentProvider provider = null;
- if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) {
- provider = new MatrixSourcesContentProvider(getRoot(getEditedTable().getContext()));
+
+ if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) {
+ ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet();
+ provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "rowSources");
} else if (MatrixPropertyConstants.MATRIX_COLUMN_SOURCES.equals(propertyPath)) {
- provider = new MatrixSourcesContentProvider(getRoot(getEditedTable().getContext()));
+ ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet();
+ provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "columnSources");
} else if (MatrixPropertyConstants.MATRIX_CELL_TYPE.equals(propertyPath)) {
provider = new GenericRelationshipMatrixElementTypeContentProvider(getRoot(getEditedTable().getContext()));
} else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_DIRECTION.equals(propertyPath)) {
@@ -351,7 +356,8 @@ public class GenericUMLRelationshipMatrixModelElement extends EMFModelElement {
} else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER_STRATEGY.equals(propertyPath)) {
provider = new MatrixRelationshipOwnerStrategyContentProvider();
} else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER.equals(propertyPath)) {
- provider = new MatrixSourcesContentProvider(getRoot(getEditedTable().getContext()));
+ ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet();
+ provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "relationshipOwner");
} else {
provider = super.getContentProvider(propertyPath);
}

Back to the top