Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2013-01-31 10:05:07 +0000
committerptessier2013-01-31 10:05:07 +0000
commit6fb871bd7e41d396f428d072c1027b36d27ee875 (patch)
tree21bb0e857bd128f319eeb5f15332b38d51a6d86a
parent8ea4dde42249e1903c1a6fc69d473e1d9ebf7241 (diff)
downloadorg.eclipse.papyrus-6fb871bd7e41d396f428d072c1027b36d27ee875.tar.gz
org.eclipse.papyrus-6fb871bd7e41d396f428d072c1027b36d27ee875.tar.xz
org.eclipse.papyrus-6fb871bd7e41d396f428d072c1027b36d27ee875.zip
269492: [All Diagrams] Display properties of a applied stereotypes as a " comment"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=269492
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPartProvider.java81
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPolicyProvider.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.xml16
3 files changed, 1 insertions, 170 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPartProvider.java
deleted file mode 100644
index b6ab5686d9f..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPartProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.usecase.providers;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypeConpartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypeMultilinePropertyEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypePropertyEditPart;
-
-public class CustomEditPartProvider extends CustomAbstractEditPartProvider {
-
- /** Map containing node view types supported by this provider */
- protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>();
-
- /** Map containing edge view types supported by this provider */
- protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>();
-
- /** Default constructor */
- public CustomEditPartProvider() {
- super();
- diagramType = "UseCase";
- nodeMap.put(AppliedStereotypeConpartmentEditPart.ID, AppliedStereotypeConpartmentEditPart.class);
- nodeMap.put(AppliedStereotypePropertyEditPart.ID, AppliedStereotypeMultilinePropertyEditPart.class);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean provides(IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- View newView = ((IEditPartOperation)operation).getView();
- if(newView == null) {
- return false;
- }
- String graphicalType = newView.getType();
- if((newView instanceof Node) && (!nodeMap.containsKey(graphicalType))) {
- return false;
- }
- if((newView instanceof Edge) && (!edgeMap.containsKey(graphicalType))) {
- return false;
- }
- }
- return super.provides(operation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class<?> getNodeEditPartClass(View view) {
- return nodeMap.get(view.getType());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class<?> getEdgeEditPartClass(View view) {
- return edgeMap.get(view.getType());
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPolicyProvider.java
deleted file mode 100644
index 31f65e0a4e5..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/providers/CustomEditPolicyProvider.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.usecase.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeCompartmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.papyrus.uml.diagram.usecase.edit.parts.UseCaseDiagramEditPart;
-
-/**
- * this is an editpolicy provider in charge to install a policy to navigate between diagrams and elements
- *
- */
-public class CustomEditPolicyProvider implements IEditPolicyProvider {
-
- /**
- *
- * {@inheritDoc}
- */
- public void addProviderChangeListener(IProviderChangeListener listener) {
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart)epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if(UseCaseDiagramEditPart.MODEL_ID.equals(diagramType)) {
- return true;
- }
- return false;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void removeProviderChangeListener(IProviderChangeListener listener) {
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.xml
index 83c984df17e..ab005aa53ff 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.xml
@@ -1490,20 +1490,6 @@
</extension>
<!-- Custom extension point editpart provider for editing properties of stereotype-->
-
- <extension
- id="stereotype-ep-provider"
- point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
- <editpartProvider
- class="org.eclipse.papyrus.uml.diagram.usecase.providers.StereotypePropertiesEditPartProvider">
- <Priority name="Medium"/>
-
- <object
- class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
- id="org.eclipse.papyrus.uml.diagram.clazz.editpart.AppliedStereotypeContainer">
- <method name="getType()" value="AppliedStereotypeContainer,AppliedStereotypeProperty"/>
- </object>
- </editpartProvider>
- </extension>
+
</plugin>

Back to the top