Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-02-07 10:07:58 +0000
committerCamille Letavernier2014-02-07 10:07:58 +0000
commit25d1978314cda6257c58358916dc6b1f42d20172 (patch)
tree8424f1f54c7c57721ce1996b3fdd6af8add77307
parentade9d574e165b8b0dcd4dc717b68eb7a39bb3ceb (diff)
downloadorg.eclipse.papyrus-25d1978314cda6257c58358916dc6b1f42d20172.tar.gz
org.eclipse.papyrus-25d1978314cda6257c58358916dc6b1f42d20172.tar.xz
org.eclipse.papyrus-25d1978314cda6257c58358916dc6b1f42d20172.zip
417396: [CSS] The CSS Engine shall support label visibility & mask
https://bugs.eclipse.org/bugs/show_bug.cgi?id=417396 - Update tests
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/plugin.xml114
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch2
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java12
6 files changed, 23 insertions, 124 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
index 45243f3c623..5faa3d62bbc 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
@@ -176,7 +176,7 @@
<extension
point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
<mapping
- humanReadableType="symbol"
+ humanReadableType="Symbol"
type="compartment_shape_display">
</mapping>
</extension>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
index 8a31d568a5a..48c0b35f3d4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ShapeDisplayCompartmentEditPart.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -53,7 +53,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.service.shape.ShapeService;
public class ShapeDisplayCompartmentEditPart extends ResizableCompartmentEditPart {
/** Title of this compartment */
- public final static String COMPARTMENT_NAME = "shape"; // $NON-NLS-1$
+ public final static String COMPARTMENT_NAME = "SymbolCompartment"; // $NON-NLS-1$
/**
* Creates a new ShapeDisplayCompartmentEditPart
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
index 9beb2520610..cd8d0de611f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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,7 +24,9 @@ import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
import org.eclipse.papyrus.infra.core.extension.diagrameditor.PluggableEditorFactoryReader;
import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.common.types.NotationTypesMap;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.NamedElement;
import org.w3c.dom.Element;
/**
@@ -68,9 +70,9 @@ public class NotationLabelProvider extends EMFLabelProvider {
}
/**
- *
+ *
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- *
+ *
* @param element
* @return <ul>
* <li>if element is a {@link NamedElement}, we return its name</li>
@@ -85,6 +87,11 @@ public class NotationLabelProvider extends EMFLabelProvider {
}
if(element instanceof View) { // maybe it is a view of a compartment
+ String humanType = NotationTypesMap.instance.getHumanReadableType((View)element);
+ if(humanType != null) {
+ return humanType;
+ }
+
EditPart dummyEP = EditPartService.getInstance().createGraphicEditPart((View)element);
if(dummyEP instanceof ResizableCompartmentEditPart) {
return ((ResizableCompartmentEditPart)dummyEP).getCompartmentName();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/plugin.xml
index 6f317d68655..61d2dc7da72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/plugin.xml
@@ -7,117 +7,5 @@
factory="org.eclipse.papyrus.uml.diagram.css.dom.GMFUMLElementProviderFactory"
order="50">
</factory>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
-
- <diagramMappings
- diagramID="PapyrusUMLClassDiagram">
- <mapping
- humanReadableType="attribute"
- type="7017">
- </mapping>
- <mapping
- humanReadableType="operation"
- type="7018">
- </mapping>
- <mapping
- humanReadableType="nestedClassifier"
- type="7019">
- </mapping>
- <mapping
- humanReadableType="Class Diagram"
- type="PapyrusUMLClassDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="CompositeStructure">
- <mapping
- humanReadableType="Composite Diagram"
- type="CompositeStructure">
- </mapping>
- <mapping
- humanReadableType="structure"
- type="7077">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="Package">
- <mapping
- humanReadableType="Package Diagram"
- type="Package">
- </mapping>
-
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLActivityDiagram">
- <mapping
- humanReadableType="Activity Diagram"
- type="PapyrusUMLActivityDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLCommunicationDiagram">
- <mapping
- humanReadableType="Communication Diagram"
- type="PapyrusUMLCommunicationDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLComponentDiagram">
- <mapping
- humanReadableType="Component Diagram"
- type="PapyrusUMLComponentDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLDeploymentDiagram">
- <mapping
- humanReadableType="Deployment Diagram"
- type="PapyrusUMLDeploymentDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLProfileDiagram">
- <mapping
- humanReadableType="Profile Diagram"
- type="PapyrusUMLProfileDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLSequenceDiagram">
- <mapping
- humanReadableType="Sequence Diagram"
- type="PapyrusUMLSequenceDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLStateMachineDiagram">
- <mapping
- humanReadableType="State Machine Diagram"
- type="PapyrusUMLStateMachineDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="UseCase">
- <mapping
- humanReadableType="Use Case Diagram"
- type="UseCase">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLTimingDiagram">
- <mapping
- humanReadableType="Timing Diagram"
- type="PapyrusUMLTimingDiagram">
- </mapping>
- </diagramMappings>
- <diagramMappings
- diagramID="PapyrusUMLInteractionOverviewDiagram">
- <mapping
- humanReadableType="Interaction Overview Diagram"
- type="PapyrusUMLInteractionOverviewDiagram">
- </mapping>
- </diagramMappings>
- </extension>
+ </extension>
</plugin>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch
index eb1de64a68e..7e6458447b4 100644
--- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch
@@ -23,7 +23,7 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.infra.gmfdiag.css.tests"/>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
index c311a50ca4e..96f7c5198cb 100644
--- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
@@ -20,7 +20,9 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.Diagram;
@@ -43,9 +45,9 @@ import org.junit.Test;
/**
* Test case for Compartment-related styles and properties
* See resources/model/compartmentsTest/model.di for details
- *
- * @author Camille Letavernier
*
+ * @author Camille Letavernier
+ *
*/
public class CSSCompartmentsTests {
@@ -147,15 +149,17 @@ public class CSSCompartmentsTests {
//Check all compartments
for(View childNode : (List<View>)class3.getChildren()) {
if(childNode instanceof BasicCompartment) {
- Assert.assertFalse("All compartments from Class3 should be hidden", childNode.isVisible());
+ Assert.assertFalse("All compartments from Class3 should be hidden. " + childNode.getType() + " is visible", childNode.isVisible());
}
}
//We need an editingDomain for the ResetStyle operation
- new TransactionalEditingDomainImpl(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), diagram.eResource().getResourceSet());
+ TransactionalEditingDomain domain = new TransactionalEditingDomainImpl(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), diagram.eResource().getResourceSet());
+ diagram.eResource().getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(domain));
//Test resetStyle
ResetStyleHelper.resetStyle(Collections.singleton(class3));
+
//Check only some specific compartments. Some style rules still hide the nestedClassifier compartment. The visibility of e.g. the ShapeCompartment is undetermined.
BasicCompartment attributesCompartment = findCompartment(class3, CLASS_ATTRIBUTE_COMPARTMENT_TYPE);
BasicCompartment operationsCompartment = findCompartment(class3, CLASS_OPERATION_COMPARTMENT_TYPE);

Back to the top