diff options
author | Pauline DEVILLE | 2017-02-22 09:51:29 +0000 |
---|---|---|
committer | Jeremie Tatibouet | 2017-09-01 07:56:06 +0000 |
commit | e212d21d5df7d704df7a5bddfff6de689796fe92 (patch) | |
tree | a4778ec512360964118b55019b3511d7653adab7 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity | |
parent | 9e70a0963a0a8bae6b9acfce7f7eb7672da19948 (diff) | |
download | org.eclipse.papyrus-e212d21d5df7d704df7a5bddfff6de689796fe92.tar.gz org.eclipse.papyrus-e212d21d5df7d704df7a5bddfff6de689796fe92.tar.xz org.eclipse.papyrus-e212d21d5df7d704df7a5bddfff6de689796fe92.zip |
Bug 512415 - [Activity Diagram] The "Synchronize pins and parameters"
command should be deleted
Change-Id: I422a862cc1d3ceb6b3fbdc9645f35d4670e84beb
Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity')
2 files changed, 0 insertions, 206 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/handlers/GlobalSynchronizePinsParametersHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/handlers/GlobalSynchronizePinsParametersHandler.java deleted file mode 100644 index 9d3cb82670a..00000000000 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/handlers/GlobalSynchronizePinsParametersHandler.java +++ /dev/null @@ -1,127 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * 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:
- * Arthur Daussy (Atos) - Initial API and implementation
- * Arthur Daussy - 371712 : [Activitydiagram] Papyrus should provide a way to manually resynchronize pins and parameters on Call Actions
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.activity.handlers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.infra.core.modelsetquery.ModelSetQuery;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.NotificationRunnable;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.IContext;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.uml2.uml.InvocationAction;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Handler to synchronize all call Action of the model
- *
- * @author adaussy
- *
- */
-public class GlobalSynchronizePinsParametersHandler extends AbstractSynchronizePinsAndParameters {
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getActiveMenuSelection(event);
- if (selection instanceof StructuredSelection) {
- StructuredSelection structuredSelection = (StructuredSelection) selection;
- Object obj = structuredSelection.getFirstElement();
- EObject element = null;
- if (obj instanceof IAdaptable) {
- element = (EObject) ((IAdaptable) obj).getAdapter(EObject.class);
- if (element instanceof View) {
- element = ((View) element).getElement();
- }
- if (element instanceof Package) {
- Package pack = (Package) element;
- final Collection<EObject> objectsOfType = ModelSetQuery.getObjectsOfType(pack, UMLPackage.Literals.INVOCATION_ACTION);
- new NotificationBuilder().setAsynchronous(false).setType(Type.WARNING).setHTML(true).setMessage(getCallActionToSync(objectsOfType)).addAction(new NotificationRunnable() {
-
- @Override
- public void run(IContext context) {
- for (EObject ca : objectsOfType) {
- if (ca instanceof InvocationAction) {
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(ca);
- if (!editingDomain.isReadOnly(ca.eResource())) {
- SynchronizePinsParametersHandler.syncInvocationAction((InvocationAction) ca);
- }
- }
- }
- }
-
- @Override
- public String getLabel() {
- return "Synchronize";
- }
- }).addAction(new NotificationRunnable() {
-
- @Override
- public void run(IContext context) {
- // Do Nothing
- }
-
- @Override
- public String getLabel() {
- return "Cancel";
- }
- }).run();
- }
- }
- }
- return null;
- }
-
- protected String getCallActionToSync(Collection<EObject> objectsOfType) {
- StringBuilder builder = new StringBuilder("<form><p>The following Call Actions will be synchronized : </p>");////$NON-NLS-1$
- List<EObject> readOnlyresource = new ArrayList<EObject>();
- for (EObject e : objectsOfType) {
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(e);
- boolean isReadOnly = editingDomain.isReadOnly(e.eResource());
- if (!isReadOnly) {
- if (e instanceof NamedElement) {
- builder.append("<li>");
- builder.append(((NamedElement) e).getQualifiedName());
- builder.append("</li>");
- }
- } else {
- readOnlyresource.add(e);
- }
- }
- if (!readOnlyresource.isEmpty()) {
- builder.append("<p> </p><p>The following Call Actions will not be synchronized because the are is read only mode :</p>");
- for (EObject e : readOnlyresource) {
- if (e instanceof NamedElement) {
- builder.append("<li>").append(((NamedElement) e).getQualifiedName()).append("</li>");
- }
- }
- }
- builder.append("</form>");
- return builder.toString();
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml index a730745f5b9..32234bca65f 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml @@ -1563,43 +1563,6 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]> </viewProvider> </extension> - - <extension - point="org.eclipse.ui.commands"> - <command - description="Synchronize pins and parameters" - categoryId="org.eclipse.papyrus.editor.category" - id="org.eclipse.papyrus.uml.diagram.activity.SynchronizePinsParametersCommand" - name="Synchronize pins and parameters"> - </command> - </extension> - -<extension - point="org.eclipse.ui.commands"> - <command - categoryId="org.eclipse.papyrus.editor.category" - description="Global Synchronize pins and parameters" - id="org.eclipse.papyrus.uml.diagram.activity.GlobalSynchronizePinsParametersCommand" - name="Global Synchronize pins and parameters"> - </command> -</extension> - -<extension - point="org.eclipse.ui.handlers"> - <handler - class="org.eclipse.papyrus.uml.diagram.activity.handlers.SynchronizePinsParametersHandler" - commandId="org.eclipse.papyrus.uml.diagram.activity.SynchronizePinsParametersCommand"> - </handler> - </extension> - -<extension - point="org.eclipse.ui.handlers"> - <handler - class="org.eclipse.papyrus.uml.diagram.activity.handlers.GlobalSynchronizePinsParametersHandler" - commandId="org.eclipse.papyrus.uml.diagram.activity.GlobalSynchronizePinsParametersCommand"> - </handler> -</extension> - <!-- Defnition for seleciton is call action and editor is papyrus --> <extension point="org.eclipse.core.expressions.definitions"> @@ -1628,48 +1591,6 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]> type="org.eclipse.jface.viewers.ISelection"> </propertyTester> </extension> - -<extension - point="org.eclipse.ui.menus"> - - <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=fileMenu" - allPopups="false"> - <command - commandId="org.eclipse.papyrus.uml.diagram.activity.SynchronizePinsParametersCommand" - icon="icons/obj16/RefreshPin.png" - label="Synchronize pins and parameters" - mnemonic="Synchronize pins and parameters of the current selection" - style="push"> - <visibleWhen> - <and> - - <reference - definitionId="org.eclipse.papyrus.diagram.common.IsCallAction"> - </reference> - - </and> - </visibleWhen> - </command> - </menuContribution> - <menuContribution - allPopups="false" - locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup"> - <command - commandId="org.eclipse.papyrus.uml.diagram.activity.SynchronizePinsParametersCommand" - icon="icons/obj16/RefreshPin.png" - label="Synchronize pins and parameters" - mnemonic="Synchronize pins and parameters of the current selection" - style="push"> - <visibleWhen> - <and> - <reference - definitionId="org.eclipse.papyrus.diagram.common.IsCallAction"> - </reference> - </and> - </visibleWhen> - </command> - </menuContribution> -</extension> <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> <propertyTabs |