Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2013-01-31 10:05:24 +0000
committerptessier2013-01-31 10:05:24 +0000
commit6a4f416b7556dd0f8309a01f58213c94a824df0d (patch)
treeaa24407ec76b6751e2dbae568ed5d26f5eba22e2 /incoming
parent6fb871bd7e41d396f428d072c1027b36d27ee875 (diff)
downloadorg.eclipse.papyrus-6a4f416b7556dd0f8309a01f58213c94a824df0d.tar.gz
org.eclipse.papyrus-6a4f416b7556dd0f8309a01f58213c94a824df0d.tar.xz
org.eclipse.papyrus-6a4f416b7556dd0f8309a01f58213c94a824df0d.zip
269492: [All Diagrams] Display properties of a applied stereotypes as a " comment"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=269492
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java80
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java94
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml62
3 files changed, 0 insertions, 236 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java
deleted file mode 100644
index 35a16df7f83..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 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.timing.custom.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypeMultilinePropertyEditPart;
-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.timing.edit.parts.TimingDiagramEditPart;
-
-/**
- * this is an editpolicy provider in charge to install a policy to create a AssociationClass
- *
- * @author Patrick Tessier
- */
-public class CustomEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
-
- /**
- *
- * {@inheritDoc}
- */
- public void createEditPolicies(final EditPart editPart) {
- if(!(editPart instanceof AppliedStereotypeMultilinePropertyEditPart)) {
- // editPart.installEditPolicy(NavigationEditPolicy.NAVIGATION_POLICY, new NavigationEditPolicy());
- if(editPart instanceof IPrimaryEditPart) {
- // if (EMFHelper.getEObject(editPart) != null) {
- // editPart.installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT,
- // new AppliedStereotypeCommentCreationEditPolicy());
- // }
-
- if(!(editPart instanceof ConnectionEditPart)) {
- // editPart.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- }
- }
- if(editPart instanceof NamedElementEditPart) {
- editPart.installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeCompartmentEditPolicy());
- }
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean provides(final IOperation operation) {
- final CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
- return false;
- }
-
- final EditPart gep = epOperation.getEditPart();
- final String diagramType = ((View)gep.getModel()).getDiagram().getType();
- if(!TimingDiagramEditPart.MODEL_ID.equals(diagramType)) {
- return false;
- }
-
- return true;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java
deleted file mode 100644
index e2fc2878dc4..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java
+++ /dev/null
@@ -1,94 +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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.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.infra.gmfdiag.common.providers.RestrictedAbstractEditPartProvider;
-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;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypesCommentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AppliedStereotypesCommentLinkEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
-
-public class StereotypePropertiesEditPartProvider extends RestrictedAbstractEditPartProvider {
-
- /** 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 StereotypePropertiesEditPartProvider() {
- super();
-
- this.diagramType = TimingDiagramEditPart.MODEL_ID;
-
- this.nodeMap.put(AppliedStereotypeConpartmentEditPart.ID, AppliedStereotypeConpartmentEditPart.class);
- this.nodeMap.put(AppliedStereotypePropertyEditPart.ID, AppliedStereotypeMultilinePropertyEditPart.class);
- this.nodeMap.put(AppliedStereotypesCommentEditPart.ID, AppliedStereotypesCommentEditPart.class);
- this.edgeMap.put(AppliedStereotypesCommentLinkEditPart.ID, AppliedStereotypesCommentLinkEditPart.class);
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean provides(final IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- final View newView = ((IEditPartOperation)operation).getView();
- if(newView == null) {
- return false;
- }
-
- final String graphicalType = newView.getType();
-
- if((newView instanceof Node) && (!this.nodeMap.containsKey(graphicalType))) {
- return false;
- }
-
- if((newView instanceof Edge) && (!this.edgeMap.containsKey(graphicalType))) {
- return false;
- }
- }
-
- return super.provides(operation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class<?> getNodeEditPartClass(final View view) {
- return this.nodeMap.get(view.getType());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class<?> getEdgeEditPartClass(final View view) {
- return this.edgeMap.get(view.getType());
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml b/incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml
index 2dc87dd6bd1..a0da98b8e88 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml
@@ -1449,68 +1449,6 @@
<!-- custom editpart provider (see also org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomUMLEditPartFactory#createEditPart) -->
- <extension
- id="custom-ep-provider"
- point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
- <editpartProvider
- class="org.eclipse.papyrus.uml.diagram.timing.custom.providers.CustomUMLEditPartProvider">
- <Priority name="Medium"/>
- <object
- class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
- id="customized-edit-parts">
- <!-- 1 = TimingDiagramEditPart -->
- <!-- 2 = InteractionEditPartTN -->
- <!-- 5 = InteractionCompartmentEditPartTN -->
- <!-- 7 = FullLifelineStateDefinitionCompartmentEditPartCN -->
- <!-- 8 = FullLifelineTimelineCompartmentEditPartCN -->
- <!-- 9 = StateDefinitionEditPart -->
- <!-- 10 = OccurrenceSpecificationLabelEditPart -->
- <!-- 11 = FullStateInvariantEditPartCN -->
- <!-- 12 = OccurrenceSpecificationEditPartCN -->
- <!-- 13 = MessageOccurrenceSpecificationEditPartCN -->
- <!-- 14 = MessageOccurrenceSpecificationLabelEditPart -->
- <!-- 15 = TimeConstraintEditPart -->
- <!-- 16 = TimeObservationEditPart -->
- <!-- 17 = DurationObservationEditPartCN -->
- <!-- 18 = DurationConstraintEditPartCN -->
- <!-- 19 = FullLifelineEditPartCN -->
- <!-- 20 = CompactLifelineEditPartCN -->
- <!-- 23 = CompactLifelineCompartmentEditPartCN -->
- <!-- 24 = FreeTimingRulerEditPartCN -->
- <!-- 26 = TickEditPart -->
- <!-- 27 = DestructionOccurrenceSpecificationEditPartCN -->
- <!-- 28 = CompactStateInvariantEditPartCN -->
- <!-- 29 = TimeRulerCompartmentEditPartCN -->
- <!-- 31 = CompactStateInvariantNameEditPart -->
- <!-- 32 = DestructionOccurrenceSpecificationLabelEditPart -->
- <!-- 38 = StateDefinitionLabelEditPart -->
- <!-- 39 = FullStateInvariantVerticalLineEditPart -->
- <!-- 50 = MessageLostEditPart -->
- <!-- 53 = MessageFoundEditPart -->
- <!-- 67 = GeneralOrderingEditPart -->
- <!-- 69 = GateEditPart -->
- <!-- 80 = FreeTimeRulerCompartmentEditPart -->
- <!-- 82 = FullLifelineTimeRulerCompartmentEditPartCN -->
- <!-- 83 = CompactLifelineTimeRulerCompartmentEditPartCN -->
- <method name="getType()" value="1,2,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,26,27,28,29,31,32,38,39,50,53,67,69,80,82,83"/>
- </object>
- <context views="customized-edit-parts"/>
- </editpartProvider>
- </extension>
- <extension
- id="stereotype-ep-provider"
- point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
- <editpartProvider
- class="org.eclipse.papyrus.uml.diagram.timing.custom.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,AppliedStereotypesComment,AppliedStereotypesCommentLink"/>
- </object>
- </editpartProvider>
- </extension>
</plugin>

Back to the top