diff options
| author | Christian W. Damus | 2016-04-12 20:31:25 +0000 |
|---|---|---|
| committer | Christian W. Damus | 2016-04-20 18:38:56 +0000 |
| commit | 7c4ced9f8175e2dde279e85416317efa1fddd54b (patch) | |
| tree | 7b14225202d7d0f1a6b51946b46b0fc9452c329c | |
| parent | 9c928207df80a2dabe91c5bc25ab97ab47d87650 (diff) | |
| download | org.eclipse.papyrus-rt-7c4ced9f8175e2dde279e85416317efa1fddd54b.tar.gz org.eclipse.papyrus-rt-7c4ced9f8175e2dde279e85416317efa1fddd54b.tar.xz org.eclipse.papyrus-rt-7c4ced9f8175e2dde279e85416317efa1fddd54b.zip | |
Bug 477821: [Tooling] Improve the behavior of the port creation tool on palette in capsule structure diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=477821
Ensure that the dialog for creation of ports and capsule-parts is
cancellable, via a new edit advice that configures the request with
the appropriate parameter.
Fix the 'Create a new null' title for the protocol creation dialog when creating a new port.
Just create the new protocol for a port in the same package as contains the capsule defining the port.
Change-Id: Ib22b76ec8777d4a19b374f748d70363fec17fd28
Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
4 files changed, 102 insertions, 8 deletions
diff --git a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/META-INF/MANIFEST.MF b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/META-INF/MANIFEST.MF index 74a143fb8..0a6d24563 100644 --- a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/META-INF/MANIFEST.MF +++ b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/META-INF/MANIFEST.MF @@ -35,6 +35,7 @@ Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.papyrusrt.umlrt.tooling.ui, org.eclipse.papyrusrt.umlrt.tooling.ui.constraints, org.eclipse.papyrusrt.umlrt.tooling.ui.editors, + org.eclipse.papyrusrt.umlrt.tooling.ui.internal.advice;x-internal:=true, org.eclipse.papyrusrt.umlrt.tooling.ui.internal.modelelement;x-internal:=true, org.eclipse.papyrusrt.umlrt.tooling.ui.modelelement, org.eclipse.papyrusrt.umlrt.tooling.ui.widgets diff --git a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/elementtypes/uml-rt.tooling.ui.elementtypesconfigurations b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/elementtypes/uml-rt.tooling.ui.elementtypesconfigurations index b85348780..17478270f 100644 --- a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/elementtypes/uml-rt.tooling.ui.elementtypesconfigurations +++ b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/elementtypes/uml-rt.tooling.ui.elementtypesconfigurations @@ -1,20 +1,23 @@ -<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1" xmlns:runtimevaluesadvice="http://www.eclipse.org/papyrus/emf/types/runtimevaluesadvice/1.1" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.elementTypeSet" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML" name="UMLRealTime Tooling UI" xmi:id="_ubJcsKeUEeSUR5jX0TaAcA" xmi:version="2.0"> - <elementTypeConfigurations description="Creation type only for RTPorts from UI, like model explorer" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui" name="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui" xmi:id="_5SPR8DdmEeWK7ZUbpAMB-g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration"> +<?xml version="1.0" encoding="ASCII"?> +<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1" xmlns:runtimevaluesadvice="http://www.eclipse.org/papyrus/emf/types/runtimevaluesadvice/1.1" xmi:id="_ubJcsKeUEeSUR5jX0TaAcA" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.elementTypeSet" name="UMLRealTime Tooling UI" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML"> + <elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_5SPR8DdmEeWK7ZUbpAMB-g" description="Creation type only for RTPorts from UI, like model explorer" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui" name="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui"> <specializedTypesID>org.eclipse.papyrusrt.umlrt.core.ExternalBehaviorPort</specializedTypesID> - <matcherConfiguration matcherClassName="org.eclipse.papyrusrt.umlrt.core.types.matcher.NoMatcher" xmi:id="_JLWfsDdnEeWK7ZUbpAMB-g" xsi:type="elementtypesconfigurations:MatcherConfiguration"/> + <matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_JLWfsDdnEeWK7ZUbpAMB-g" matcherClassName="org.eclipse.papyrusrt.umlrt.core.types.matcher.NoMatcher"/> </elementTypeConfigurations> - <elementTypeConfigurations description="Creation type only for capsuleParts from UI, like model explorer" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui" name="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui" xmi:id="_Myv-ADeEEeWK7ZUbpAMB-g" xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration"> + <elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_Myv-ADeEEeWK7ZUbpAMB-g" description="Creation type only for capsuleParts from UI, like model explorer" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui" name="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui"> <specializedTypesID>org.eclipse.papyrusrt.umlrt.core.CapsulePart</specializedTypesID> - <matcherConfiguration matcherClassName="org.eclipse.papyrusrt.umlrt.core.types.matcher.NoMatcher" xmi:id="_Myv-ATeEEeWK7ZUbpAMB-g" xsi:type="elementtypesconfigurations:MatcherConfiguration"/> + <matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_Myv-ATeEEeWK7ZUbpAMB-g" matcherClassName="org.eclipse.papyrusrt.umlrt.core.types.matcher.NoMatcher"/> </elementTypeConfigurations> - <adviceBindingsConfigurations description="UI configuration for the creation advice of a port" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui.viewconfiguration" inheritance="all" target="_5SPR8DdmEeWK7ZUbpAMB-g" xmi:id="_4UTDADdmEeWK7ZUbpAMB-g" xsi:type="runtimevaluesadvice:RuntimeValuesAdviceConfiguration"> + <adviceBindingsConfigurations xsi:type="runtimevaluesadvice:RuntimeValuesAdviceConfiguration" xmi:id="_4UTDADdmEeWK7ZUbpAMB-g" description="UI configuration for the creation advice of a port" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.rtportcreationwithui.viewconfiguration" target="_5SPR8DdmEeWK7ZUbpAMB-g" inheritance="all"> <viewsToDisplay xmi:id="_hWd_4DdnEeWK7ZUbpAMB-g"> <view href="../dialogs/CreationDialogs.ctx#_F4P60zdoEeWK7ZUbpAMB-g"/> </viewsToDisplay> </adviceBindingsConfigurations> - <adviceBindingsConfigurations description="UI configuration for the creation advice of a capsule part" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui.viewconfiguration" inheritance="all" target="_Myv-ADeEEeWK7ZUbpAMB-g" xmi:id="_MywlEDeEEeWK7ZUbpAMB-g" xsi:type="runtimevaluesadvice:RuntimeValuesAdviceConfiguration"> + <adviceBindingsConfigurations xsi:type="runtimevaluesadvice:RuntimeValuesAdviceConfiguration" xmi:id="_MywlEDeEEeWK7ZUbpAMB-g" description="UI configuration for the creation advice of a capsule part" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulepartcreationwithui.viewconfiguration" target="_Myv-ADeEEeWK7ZUbpAMB-g" inheritance="all"> <viewsToDisplay xmi:id="_MywlETeEEeWK7ZUbpAMB-g"> <view href="../dialogs/CreationDialogs.ctx#CapsulePartDialogView"/> </viewsToDisplay> </adviceBindingsConfigurations> -</elementtypesconfigurations:ElementTypeSetConfiguration>
\ No newline at end of file + <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_hHFLQAClEea4aZHt95fvBQ" description="Configuration of creation request parameters for RTPort" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.rtPortCreationParameters" target="_5SPR8DdmEeWK7ZUbpAMB-g" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrusrt.umlrt.tooling.ui.internal.advice.RTPortCreationParametersAdvice"/> + <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_qvgeEAClEea4aZHt95fvBQ" description="Configuration of creation request parameters for CapsulePart" identifier="org.eclipse.papyrusrt.umlrt.tooling.ui.capsulePartCreationParameters" target="_Myv-ADeEEeWK7ZUbpAMB-g" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrusrt.umlrt.tooling.ui.internal.advice.CapsulePartCreationParametersAdvice"/> +</elementtypesconfigurations:ElementTypeSetConfiguration> diff --git a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/CapsulePartCreationParametersAdvice.java b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/CapsulePartCreationParametersAdvice.java new file mode 100644 index 000000000..a8b0ef60d --- /dev/null +++ b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/CapsulePartCreationParametersAdvice.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrusrt.umlrt.tooling.ui.internal.advice; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeUtils; +import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.CapsulePart; + +/** + * Edit-helper advice that injects parameters into the creation request for a + * {@link CapsulePart}. + */ +public class CapsulePartCreationParametersAdvice extends AbstractEditHelperAdvice { + + public CapsulePartCreationParametersAdvice() { + super(); + } + + @Override + public void configureRequest(IEditCommandRequest request) { + super.configureRequest(request); + + if (request instanceof ConfigureRequest) { + // Configuring the configure request. So meta + configureRequest((ConfigureRequest) request); + } + } + + protected void configureRequest(ConfigureRequest configureRequest) { + // The creation of a CapsulePart is always cancelable. cf. bug 477821 + ElementTypeUtils.setDialogCancellable(configureRequest, true); + } +} diff --git a/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/RTPortCreationParametersAdvice.java b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/RTPortCreationParametersAdvice.java new file mode 100644 index 000000000..59dc7519a --- /dev/null +++ b/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui/src/org/eclipse/papyrusrt/umlrt/tooling/ui/internal/advice/RTPortCreationParametersAdvice.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrusrt.umlrt.tooling.ui.internal.advice; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeUtils; +import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTPort; + +/** + * Edit-helper advice that injects parameters into the creation request for an + * {@link RTPort}. + */ +public class RTPortCreationParametersAdvice extends AbstractEditHelperAdvice { + + public RTPortCreationParametersAdvice() { + super(); + } + + @Override + public void configureRequest(IEditCommandRequest request) { + super.configureRequest(request); + + if (request instanceof ConfigureRequest) { + // Configuring the configure request. So meta + configureRequest((ConfigureRequest) request); + } + } + + protected void configureRequest(ConfigureRequest configureRequest) { + // The creation of an RTPort is always cancelable. cf. bug 477821 + ElementTypeUtils.setDialogCancellable(configureRequest, true); + } +} |
