diff options
author | ptessier | 2014-12-09 13:49:55 +0000 |
---|---|---|
committer | ptessier | 2014-12-09 13:49:55 +0000 |
commit | 888c197639e1305146aff6fb9472fec8f74c88e7 (patch) | |
tree | e70210ff5d2946f3ff07866308f7bcb5c5edd2fa | |
parent | 4b4c15d072625b883f7300fda113048dd8f94890 (diff) | |
parent | 93724989af24f40d1bc83fd20c38f9a0d0ededd8 (diff) | |
download | org.eclipse.papyrus-888c197639e1305146aff6fb9472fec8f74c88e7.tar.gz org.eclipse.papyrus-888c197639e1305146aff6fb9472fec8f74c88e7.tar.xz org.eclipse.papyrus-888c197639e1305146aff6fb9472fec8f74c88e7.zip |
Merge branch 'master' of ssh://ptessier@git.eclipse.org:29418/papyrus/org.eclipse.papyrus
51 files changed, 3231 insertions, 1561 deletions
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature/feature.xml index 75a9d81d2e8..10f0f261365 100644 --- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature/feature.xml +++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature/feature.xml @@ -1,30 +1,76 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?><feature id="org.eclipse.papyrus.tests.infra.feature" label="%featureName" provider-name="%providerName" version="1.1.0.qualifier">
-
- <copyright url="http://www.eclipse.org/legal/epl-v10.html">
- Copyright (c) 2008-2014 CEA LIST, Atos Origin, Conselleria de
-Infraestructuras y Transporte, Generalitat de la Comunitat Valenciana
-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
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <plugin download-size="0" id="org.eclipse.papyrus.infra.extendedtypes.tests" install-size="0" unpack="false" version="0.0.0"/>
-
- <plugin download-size="0" fragment="true" id="org.eclipse.papyrus.infra.gmfdiag.commands.tests" install-size="0" unpack="false" version="0.0.0"/>
-
- <plugin download-size="0" fragment="true" id="org.eclipse.papyrus.infra.gmfdiag.common.tests" install-size="0" unpack="false" version="0.0.0"/>
-
- <plugin download-size="0" fragment="true" id="org.eclipse.papyrus.infra.emf.tests" install-size="0" unpack="false" version="0.0.0"/>
-
- <plugin download-size="0" fragment="true" id="org.eclipse.papyrus.infra.emf.readonly.tests" install-size="0" unpack="false" version="0.0.0"/>
-
- <plugin download-size="0" id="org.eclipse.papyrus.infra.tools.tests" install-size="0" unpack="false" version="0.0.0"/>
-
-</feature>
\ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.eclipse.papyrus.tests.infra.feature" + label="%featureName" + version="1.1.0.qualifier" + provider-name="%providerName"> + + <copyright url="http://www.eclipse.org/legal/epl-v10.html"> + Copyright (c) 2008-2014 CEA LIST, Atos Origin, Conselleria de +Infraestructuras y Transporte, Generalitat de la Comunitat Valenciana +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 + </copyright> + + <license url="%licenseURL"> + %license + </license> + + <plugin + id="org.eclipse.papyrus.infra.extendedtypes.tests" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.gmfdiag.commands.tests" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.gmfdiag.common.tests" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.emf.tests" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.emf.readonly.tests" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.tools.tests" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.papyrus.infra.gmfdiag.menu.tests" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/META-INF/MANIFEST.MF index 0691beb14d7..0921d9e4a7a 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/META-INF/MANIFEST.MF +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/META-INF/MANIFEST.MF @@ -1,22 +1,23 @@ -Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.emf.common,
- org.eclipse.emf.ecore,
- org.eclipse.gmf.runtime.common.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.1.0"
-Bundle-Vendor: Eclipse Modeling Project
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.1.0.qualifier
-Bundle-Name: GMF-specific control mode behavior
-Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.controlmode.Activa
- tor
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.controlmode;sin
- gleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.common, + org.eclipse.emf.ecore, + org.eclipse.gmf.runtime.common.core, + org.eclipse.gmf.runtime.emf.commands.core, + org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.1.0", + org.eclipse.papyrus.infra.core;bundle-version="1.1.0", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.1.0" +Bundle-Vendor: Eclipse Modeling Project +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.1.0.qualifier +Bundle-Name: GMF-specific control mode behavior +Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.controlmode.Activa + tor +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.controlmode;sin + gleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.eclipse.papyrus.infra.gmfdiag.controlmode.utils + diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/utils/ControlModeUtil.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/utils/ControlModeUtil.java new file mode 100644 index 00000000000..6eff86b281a --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/utils/ControlModeUtil.java @@ -0,0 +1,69 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation + *****************************************************************************/ + +package org.eclipse.papyrus.infra.gmfdiag.controlmode.utils; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.services.controlmode.ControlModeManager; +import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest; +import org.eclipse.papyrus.infra.services.controlmode.IControlModeManager; +import org.eclipse.papyrus.infra.services.controlmode.util.ControlHelper; + +/** + * Utility class to manage Control Mode request in a GMF diagram context. + * + * @author Gabriel Pascual + * + */ +public final class ControlModeUtil { + + /** + * Constructor. + * + */ + private ControlModeUtil() { + } + + + /** + * Gets the uncontrolled command. + * + * @param editPart + * the edit part + * @param editingDomain + * the editing domain + * @return the uncontrolled command + */ + public static ICommand getUncontrolledCommand(IGraphicalEditPart editPart, TransactionalEditingDomain editingDomain) { + ICommand uncontrolCommand = null; + if (!(editPart instanceof DiagramEditPart)) { + + // Look for uncontrol mode command + EObject eObjectToControl = EMFHelper.getEObject(editPart); + if (eObjectToControl != null && ControlHelper.isRootControlledObject(eObjectToControl)) { + ControlModeRequest controlRequest = ControlModeRequest.createUIUncontrolModelRequest(editingDomain, eObjectToControl); + IControlModeManager controlMng = ControlModeManager.getInstance(); + ICommand controlModeCommand = controlMng.getUncontrolCommand(controlRequest); + + if (controlModeCommand.canExecute()) { + uncontrolCommand = controlModeCommand; + } + } + } + return uncontrolCommand; + } +} diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF index 0349a8d1f97..2425bf7f977 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF @@ -1,25 +1,28 @@ -Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
- org.eclipse.emf.transaction;bundle-version="1.4.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0",
- org.eclipse.core.expressions,
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
- org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.7.0"
-Export-Package: org.eclipse.papyrus.infra.gmfdiag.menu,
- org.eclipse.papyrus.infra.gmfdiag.menu.handlers
-Bundle-Vendor: %Bundle-Vendor
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.1.0.qualifier
-Bundle-Name: %Bundle-Name
-Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.menu.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.menu;singleton:
- =true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0", + org.eclipse.emf.transaction;bundle-version="1.4.0", + org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0", + org.eclipse.core.expressions, + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.1.0", + org.eclipse.papyrus.infra.tools;bundle-version="1.1.0", + org.eclipse.papyrus.infra.core;bundle-version="1.1.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.1.0", + org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.7.0", + com.google.guava, + org.eclipse.papyrus.infra.emf.readonly, + org.eclipse.papyrus.infra.gmfdiag.controlmode +Export-Package: org.eclipse.papyrus.infra.gmfdiag.menu, + org.eclipse.papyrus.infra.gmfdiag.menu.handlers, + org.eclipse.papyrus.infra.gmfdiag.menu.utils +Bundle-Vendor: %Bundle-Vendor +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.1.0.qualifier +Bundle-Name: %Bundle-Name +Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.menu.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.menu;singleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 + diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/icons/obj16/eraser.gif b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/icons/obj16/eraser.gif Binary files differnew file mode 100644 index 00000000000..6bc10f9d07c --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/icons/obj16/eraser.gif diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/plugin.xml index 12f86d94d1e..d3c96d59a4e 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/plugin.xml +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/plugin.xml @@ -55,6 +55,63 @@ </command> </menu> </menuContribution> + <menuContribution + allPopups="false" + locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=editMenu"> + <command + commandId="org.eclipse.ui.edit.delete" + disabledIcon="IMG_TOOL_DELETE_DISABLED" + icon="IMG_TOOL_DELETE" + label="Delete Selected Element" + style="push"> + <visibleWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <with + variable="selection"> + <iterate + ifEmpty="false" + operator="and"> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + </iterate> + </with> + </and> + </visibleWhen> + </command> + <command + commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" + icon="icons/obj16/eraser.gif" + label="Delete From diagram" + style="push"> + <visibleWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <with + variable="selection"> + <iterate + ifEmpty="false" + operator="and"> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + </iterate> + </with> + </and> + </visibleWhen> + </command> + </menuContribution> </extension> <extension point="org.eclipse.ui.handlers"> @@ -219,6 +276,124 @@ </with> --> </and> </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromModelCommandHandler" + commandId="org.eclipse.ui.edit.delete"> + <activeWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <with + variable="selection"> + <iterate + ifEmpty="false" + operator="and"> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + <test + property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" + value="true"> + </test> + </iterate> + </with> + </and> + </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler" + commandId="org.eclipse.ui.edit.delete"> + <activeWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <with + variable="selection"> + <iterate + ifEmpty="false" + operator="and"> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + <test + property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" + value="false"> + </test> + </iterate> + </with> + </and> + </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler" + commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"> + <activeWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <with + variable="selection"> + <iterate + ifEmpty="false" + operator="and"> + <test + property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" + value="true"> + </test> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + </iterate> + </with> + </and> + </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.infra.gmfdiag.menu.handlers.HeterogeneousDeleteCommandHandler" + commandId="org.eclipse.ui.edit.delete"> + <activeWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <reference + definitionId="org.eclipse.papyrus.infra.gmfdiag.menu.isHeterogeneousMultiSelection"> + </reference> + </and> + </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler" + commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"> + <activeWhen> + <and> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + <reference + definitionId="org.eclipse.papyrus.infra.gmfdiag.menu.isHeterogeneousMultiSelection"> + </reference> + </and> + </activeWhen> </handler> </extension> <extension @@ -250,6 +425,12 @@ description="Cut the elements in the current diagram" id="org.eclipse.papyrus.cut.diagram" name="Graphical Cut"> + </command> + <command + categoryId="org.eclipse.papyrus.editor.category" + description="Delete the selection from diagram" + id="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" + name="Delete From Diagram Command"> </command> </extension> <extension @@ -295,7 +476,40 @@ contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+M2+X"> + </key> + <key + commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" + contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext" + schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" + sequence="M2+DEL"> </key> </extension> + <extension + point="org.eclipse.core.expressions.definitions"> + <definition + id="org.eclipse.papyrus.infra.gmfdiag.menu.isHeterogeneousMultiSelection"> + <with + variable="selection"> + <not> + <iterate + ifEmpty="false" + operator="and"> + <test + property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" + value="false"> + </test> + <instanceof + value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </instanceof> + </iterate> + </not> + <not> + <count + value="1"> + </count> + </not> + </with> + </definition> + </extension> </plugin> diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromDiagramCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromDiagramCommandHandler.java new file mode 100644 index 00000000000..95ec5bf5e72 --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromDiagramCommandHandler.java @@ -0,0 +1,65 @@ +/***************************************************************************** + * Copyright (c) 2010 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: + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 411570 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.menu.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.CompoundCommand; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtil; + +/** + * Command handler for delete from diagram. + */ +public class DeleteFromDiagramCommandHandler extends AbstractGraphicalCommandHandler implements IHandler { + + /** Label for command handler. */ + private static final String COMMAND_LABEL = "Delete From Diagram"; + + /** + * + * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand() + * + * @return the deletion command + * @throws ExecutionException + */ + @Override + protected Command getCommand() { + + // Retrieve currently selected IGraphicalEditPart(s) + List<IGraphicalEditPart> editParts = getSelectedElements(); + if (editParts.isEmpty()) { + return UnexecutableCommand.INSTANCE; + } + + if (!DeleteActionUtil.isSupportView(editParts) || DeleteActionUtil.isCanonical(editParts)) { + return UnexecutableCommand.INSTANCE; + } + + CompoundCommand command = new CompoundCommand(COMMAND_LABEL); + for (Iterator<IGraphicalEditPart> iter = editParts.iterator(); iter.hasNext();) { + IGraphicalEditPart editPart = iter.next(); + /* Send the request to the edit part */ + command.add(DeleteActionUtil.getDeleteFromDiagramCommand(editPart)); + } + return command; + } + +} diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromModelCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromModelCommandHandler.java new file mode 100644 index 00000000000..89d00f052de --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/DeleteFromModelCommandHandler.java @@ -0,0 +1,88 @@ +/***************************************************************************** + * Copyright (c) 2010, 2014 CEA LIST 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: + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 429826 + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436952 + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 411570 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.menu.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; +import org.eclipse.papyrus.infra.gmfdiag.controlmode.utils.ControlModeUtil; +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtil; + +/** + * Command handler for delete from diagram. + */ +public class DeleteFromModelCommandHandler extends AbstractGraphicalCommandHandler implements IHandler { + + /** Command label. */ + private static final String COMMAND_LABEL = "Delete From Model"; + + @Override + protected Command getCommand() { + + TransactionalEditingDomain editingDomain = getEditingDomain(); + + if (editingDomain == null) { + return UnexecutableCommand.INSTANCE; + } + + // Retrieve currently selected IGraphicalEditPart(s) + List<IGraphicalEditPart> editParts = getSelectedElements(); + if (editParts.isEmpty()) { + return UnexecutableCommand.INSTANCE; + } + + // Iterate over selection and retrieve the deletion command from each + // edit part + // Add each returned command to the composite command + CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, COMMAND_LABEL); + + Iterator<IGraphicalEditPart> it = editParts.iterator(); + while (it.hasNext()) { + IGraphicalEditPart editPart = it.next(); + + ICommand controlCommand = ControlModeUtil.getUncontrolledCommand(editPart, editingDomain); + if (controlCommand != null) { + command.compose(controlCommand); + } + + Command curCommand = DeleteActionUtil.getDeleteFromModelCommand(editPart, editingDomain); + if (curCommand != null) { + command.compose(new CommandProxy(curCommand)); + } + } + + if (command.isEmpty()) { + return UnexecutableCommand.INSTANCE; + } + + + + return new ICommandProxy(command); + } + + + +} diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/HeterogeneousDeleteCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/HeterogeneousDeleteCommandHandler.java new file mode 100644 index 00000000000..78924554da4 --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/HeterogeneousDeleteCommandHandler.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation + *****************************************************************************/ + +package org.eclipse.papyrus.infra.gmfdiag.menu.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.CompoundCommand; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.papyrus.infra.gmfdiag.controlmode.utils.ControlModeUtil; +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtil; + +/** + * The Class HeterogeneousDeleteCommandHandler. + * + * @author gpascual + */ +public class HeterogeneousDeleteCommandHandler extends AbstractGraphicalCommandHandler implements IHandler { + + /** Label of Handler command. */ + private static final String COMMAND_LABEL = "Heterogeneous Delete From Model"; + + /** + * Constructor. + * + */ + public HeterogeneousDeleteCommandHandler() { + super(); + } + + /** + * Gets the command. + * + * @return the command + * @see org.eclipse.papyrus.infra.gmfdiag.menu.handlers.AbstractGraphicalCommandHandler#getCommand() + */ + @Override + protected Command getCommand() { + + + // Retrieve currently selected IGraphicalEditPart(s) + List<IGraphicalEditPart> editParts = getSelectedElements(); + if (editParts.isEmpty()) { + return UnexecutableCommand.INSTANCE; + } + + TransactionalEditingDomain editingDomain = getEditingDomain(); + + CompoundCommand command = new CompoundCommand(COMMAND_LABEL); + for (Iterator<IGraphicalEditPart> iter = editParts.iterator(); iter.hasNext();) { + IGraphicalEditPart editPart = iter.next(); + + Command deleteCommand = null; + + if (DeleteActionUtil.isSemanticDeletion(editPart)) { + + // Get delete command + deleteCommand = DeleteActionUtil.getDeleteFromModelCommand(editPart, editingDomain); + + // Get control mode command + ICommand controlCommand = ControlModeUtil.getUncontrolledCommand(editPart, editingDomain); + if (deleteCommand != null && controlCommand != null) { + command.add(new ICommandProxy(controlCommand)); + } + + } else { + if (DeleteActionUtil.isSupportView(editPart) || !(DeleteActionUtil.isCanonicalView(editPart) || DeleteActionUtil.isCanonical(editPart))) { + deleteCommand = DeleteActionUtil.getDeleteFromDiagramCommand(editPart); + } + } + + if (deleteCommand != null) { + command.add(deleteCommand); + } + + } + return command; + } +} diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtil.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtil.java new file mode 100644 index 00000000000..a5ec2339e55 --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtil.java @@ -0,0 +1,246 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation + *****************************************************************************/ + +package org.eclipse.papyrus.infra.gmfdiag.menu.utils; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.RequestConstants; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.requests.GroupRequest; +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.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2; +import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.emf.readonly.ReadOnlyManager; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.gmfdiag.common.helper.NotationHelper; +import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart; + +import com.google.common.base.Optional; + +/** + * Utility class to manage delete action in GMF Diagram context. + * + * @author Gabriel Pascual + * + */ +public final class DeleteActionUtil { + + /** + * Instantiates a new delete action util. + */ + private DeleteActionUtil() { + + } + + /** + * Checks if is semantic deletion. + * + * @param editPart + * the edit part + * @return true, if is semantic deletion + */ + public static boolean isSemanticDeletion(IGraphicalEditPart editPart) { + boolean isSemanticDeletion = false; + TransactionalEditingDomain editingDomain = null; + + // Get Editing Domain + try { + editingDomain = ServiceUtilsForEditPart.getInstance().getTransactionalEditingDomain(editPart); + } catch (ServiceException e) { + + } + + if (editingDomain != null) { + + IReadOnlyHandler2 readOnly = ReadOnlyManager.getReadOnlyHandler(editingDomain); + EObject semantic = EMFHelper.getEObject(editPart); + View graphical = NotationHelper.findView(editPart); + + isSemanticDeletion = !(semantic == null || semantic == graphical || semantic.eContainer() == null); + + + if (isSemanticDeletion && readOnly != null) { + + // Get URIs + List<URI> uris = new LinkedList<URI>(); + uris.add(EcoreUtil.getURI(semantic)); + + if (graphical != null) { + uris.add(EcoreUtil.getURI(graphical)); + } + + // Verify RO properties + Optional<Boolean> result = readOnly.anyReadOnly(ReadOnlyAxis.anyAxis(), uris.toArray(new URI[uris.size()])); + isSemanticDeletion = !(result.isPresent() && result.get()); + + } + } + + + return isSemanticDeletion; + } + + /** + * Gets the delete from model command. + * + * @param editPart + * the edit part + * @param editingDomain + * the editing domain + * @return the delete from model command + */ + public static Command getDeleteFromModelCommand(IGraphicalEditPart editPart, TransactionalEditingDomain editingDomain) { + // Look for the GMF deletion command + return editPart.getCommand(new EditCommandRequestWrapper(new DestroyElementRequest(false))); + + } + + /** + * Gets the delete from diagram command. + * + * @param editPart + * the edit part + * @return the delete from diagram command + */ + public static Command getDeleteFromDiagramCommand(IGraphicalEditPart editPart) { + return editPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE)); + } + + /** + * Copied from {@link org.eclipse.gmf.runtime.diagram.ui.actions.internal.DeleteFromDiagramAction}. + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.internal.DeleteFromDiagramAction + * @param editParts + * the edit parts + * @return true, if is canonical + */ + public static boolean isCanonical(List<IGraphicalEditPart> editParts) { + + boolean isCanonical = false; + if (!editParts.isEmpty()) { + + for (Iterator<IGraphicalEditPart> si = editParts.iterator(); si.hasNext() && !isCanonical;) { + IGraphicalEditPart child = si.next(); + + isCanonical = isCanonicalView(child); + if (isCanonical) { + isCanonical = isCanonicalEditPart(child); + } else { + // If there is no element or the element is a view (e.g. + // diagram + // link) than we want to support delete from diagram. See + // Bug 148453. + continue; + } + + } + } + return isCanonical; + } + + + /** + * Checks if is canonical edit part. + * + * @param editPart + * the edit part + * @return true, if is canonical edit part + */ + public static boolean isCanonicalEditPart(IGraphicalEditPart editPart) { + boolean isCanonical = false; + if (editPart instanceof ConnectionEditPart) { + ConnectionEditPart connection = (ConnectionEditPart) editPart; + isCanonical = (!connection.isSemanticConnection() || (isCanonical(connection.getSource()) && isCanonical(connection.getTarget()))); + } else { + isCanonical = isCanonical(editPart); + } + + return isCanonical; + + } + + /** + * Copied from {@link DeleteFromDiagramAction}. + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.internal.DeleteFromDiagramAction + * @param editParts + * the edit parts + * @return true, if is support view + */ + public static boolean isSupportView(List<IGraphicalEditPart> editParts) { + boolean isSupportted = true; + for (Iterator<IGraphicalEditPart> iter = editParts.iterator(); isSupportted && iter.hasNext();) { + IGraphicalEditPart object = iter.next(); + isSupportted = isSupportView(object); + } + return isSupportted; + } + + /** + * Checks if is support view. + * + * @param object + * the object + * @return true, if is support view + */ + public static boolean isSupportView(IGraphicalEditPart object) { + return !(object instanceof GraphicalEditPart && !((GraphicalEditPart) object).hasNotationView()); + + } + + /** + * Checks if is not canonical view. + * + * @param editpart + * the editpart + * @return true, if is not canonical view + */ + public static boolean isCanonicalView(IGraphicalEditPart editpart) { + View view = (View) editpart.getAdapter(View.class); + return view != null || view.getElement() != null || !(view.getElement() instanceof View); + } + + /** + * Copied from {@link DeleteFromDiagramAction}. + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.internal.DeleteFromDiagramAction + * @param editPart + * the edit part + * @return true, if is canonical + */ + public static boolean isCanonical(EditPart editPart) { + boolean isCanonical = false; + EObject eObject = EMFHelper.getEObject(editPart); + EditPart parent = editPart.getParent(); + if (eObject != null && parent != null) { // sanity checks + CanonicalEditPolicy canonicalEditPolicy = (CanonicalEditPolicy) parent.getEditPolicy(EditPolicyRoles.CANONICAL_ROLE); + isCanonical = canonicalEditPolicy != null && canonicalEditPolicy.isEnabled() && canonicalEditPolicy.canCreate(eObject); + } + return isCanonical; + } +} diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/RootAutoSelect.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/RootAutoSelect.png Binary files differnew file mode 100644 index 00000000000..c4295364c97 --- /dev/null +++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/RootAutoSelect.png diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RootAutoSelectItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RootAutoSelectItemProvider.java index 2626c57d5e9..c520cd4e7ca 100644 --- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RootAutoSelectItemProvider.java +++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RootAutoSelectItemProvider.java @@ -100,11 +100,11 @@ public class RootAutoSelectItemProvider * This returns RootAutoSelect.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @generated + * @generated NOT - Custom Image */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/RootAutoSelect")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/RootAutoSelect.png")); } /** diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ClassDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ClassDiagramDragDropEditPolicy.java index cb68ae7a4d5..239eb4586d0 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ClassDiagramDragDropEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ClassDiagramDragDropEditPolicy.java @@ -19,18 +19,21 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.ecore.EObject; import org.eclipse.gef.EditPart; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.UnexecutableCommand; import org.eclipse.gef.requests.ChangeBoundsRequest; import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; 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.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.notation.Diagram; @@ -414,4 +417,39 @@ public class ClassDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPol return cmd; } } +
+ /**
+ * @Overrided org.eclipse.papyrus.uml.diagram.common.editpolicies.CommonDiagramDragDropEditPolicy to resolve cause of repeated definition
+ * of attributes shown outside classes when dragged back
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param semanticHint
+ * the semantic hint of the view to create
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @param request
+ * the drop request (use to test ctrl key)
+ * @return the creation node command
+ */
+ @Override
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, String semanticHint, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
+ GraphicalEditPart parent = (GraphicalEditPart) getHost();
+ if (parent instanceof ListCompartmentEditPart) {
+ @SuppressWarnings("unchecked")
+ List<EditPart> allChildren = parent.getChildren();
+ for (EditPart nextChild : allChildren) {
+ if (!(nextChild instanceof GraphicalEditPart)) {
+ continue;
+ }
+ EObject nextChildSemantic = ((GraphicalEditPart) nextChild).resolveSemanticElement();
+ if (nextChildSemantic == droppedObject) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ return super.getDefaultDropNodeCommand(hostEP, semanticHint, absoluteLocation, droppedObject, request);
+ }
} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF index 76e63ba1ce0..d64fd94492b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF @@ -99,8 +99,7 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.1.0", org.eclipse.papyrus.infra.tools;bundle-version="1.1.0", org.eclipse.papyrus.uml.modelrepair;bundle-version="1.1.0", org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.1.0", - org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.1.0", - org.eclipse.papyrus.infra.gmfdiag.menu;bundle-version="1.1.0" + org.eclipse.papyrus.infra.gmfdiag.menu Bundle-Vendor: %providerName Ant-Version: Apache Ant 1.7.0 Bundle-Version: 1.1.0.qualifier diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml index f7e68f09e8f..28651d57de3 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml @@ -218,16 +218,6 @@ realization="org.eclipse.papyrus.uml.diagram.common.providers.DefaultPasteCommandProvider"> </PasteCommandProvider> </extension> -<extension - id="update-cmd-binding" - point="org.eclipse.ui.bindings"> - <key - commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" - contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="M2+DEL"> - </key> -</extension> <extension point="org.eclipse.papyrus.infra.core.papyrusDiagram"> <diagramCategory @@ -285,7 +275,7 @@ value="true"> </test> </with> - </definition> + </definition> </extension> <!-- The location is based on menu id defined in GMF runtime @@ -296,59 +286,7 @@ <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=editMenu" allPopups="false"> - <command - commandId="org.eclipse.ui.edit.delete" - disabledIcon="IMG_TOOL_DELETE_DISABLED" - icon="IMG_TOOL_DELETE" - label="Delete Selected Element" - style="push"> - <visibleWhen> - <and> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.infra.core.papyrusEditor"> - </equals> - </with> - <with - variable="selection"> - <iterate - ifEmpty="false" - operator="and"> - <instanceof - value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </instanceof> - </iterate> - </with> - </and> - </visibleWhen> - </command> - <command commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" - icon="icons/obj16/eraser.gif" - label="Delete From diagram" - style="push"> - <visibleWhen> - <and> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.infra.core.papyrusEditor"> - </equals> - </with> - <with - variable="selection"> - <iterate - ifEmpty="false" - operator="and"> - <instanceof - value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </instanceof> - </iterate> - </with> - </and> - </visibleWhen> - </command> <separator name="org.eclipse.papyrus.uml.diagram.common.commands.LoadSeparator"> @@ -424,12 +362,6 @@ <extension point="org.eclipse.ui.commands"> <command - categoryId="org.eclipse.papyrus.editor.category" - description="Delete the selection from diagram" - id="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram" - name="Delete From Diagram Command"> - </command> - <command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.LoadHandler" description="Load the corresponding submodel" @@ -450,10 +382,6 @@ <sourceProvider provider="org.eclipse.papyrus.uml.diagram.common.providers.ActionStateSourceProvider"> <variable - name="deleteInDiagram" - priorityLevel="workbench"> - </variable> - <variable name="renameNamedElement" priorityLevel="workbench"> </variable> @@ -462,62 +390,6 @@ <extension point="org.eclipse.ui.handlers"> <handler - class="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromModelCommandHandler" - commandId="org.eclipse.ui.edit.delete"> - <activeWhen> - <and> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.infra.core.papyrusEditor"> - </equals> - </with> - <with - variable="selection"> - <iterate - ifEmpty="false" - operator="and"> - <instanceof - value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </instanceof> - <test - property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" - value="true"> - </test> - </iterate> - </with> - </and> - </activeWhen> - </handler> - <handler - class="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler" - commandId="org.eclipse.ui.edit.delete"> - <activeWhen> - <and> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.infra.core.papyrusEditor"> - </equals> - </with> - <with - variable="selection"> - <iterate - ifEmpty="false" - operator="and"> - <instanceof - value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </instanceof> - <test - property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" - value="false"> - </test> - </iterate> - </with> - </and> - </activeWhen> - </handler> - <handler class="org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler" commandId="org.eclipse.ui.edit.rename"> <activeWhen> @@ -531,34 +403,6 @@ </and> </activeWhen> </handler> - <handler - class="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler" - commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"> - <activeWhen> - <and> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.infra.core.papyrusEditor"> - </equals> - </with> - <with - variable="selection"> - <iterate - ifEmpty="false" - operator="and"> - <test - property="org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion" - value="true"> - </test> - <instanceof - value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </instanceof> - </iterate> - </with> - </and> - </activeWhen> - </handler> </extension> <!--Declare a property tester. The tested properties allow to enable/disable handlers which listen these properties --> <extension @@ -694,13 +538,13 @@ </initializer> </extension> <extension - point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester - class="org.eclipse.papyrus.uml.diagram.common.propertytester.DeleteActionPropertyTester" - id="org.eclipse.papyrus.uml.diagram.common.deleteActionTester" - namespace="org.eclipse.papyrus.uml.diagram.common" - properties="isSemanticDeletion" - type="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - </propertyTester> -</extension> + point="org.eclipse.core.expressions.propertyTesters"> + <propertyTester + class="org.eclipse.papyrus.uml.diagram.common.propertytester.DeleteActionPropertyTester" + id="org.eclipse.papyrus.uml.diagram.common.propertytester.deleteActionTester" + namespace="org.eclipse.papyrus.uml.diagram.common" + properties="isSemanticDeletion" + type="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + </propertyTester> + </extension> </plugin> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromDiagramCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromDiagramCommandHandler.java index be30a1e888d..96f216c598f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromDiagramCommandHandler.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromDiagramCommandHandler.java @@ -1,7 +1,6 @@ /***************************************************************************** - * Copyright (c) 2010 CEA LIST. - * - * + * Copyright (c) 2014 CEA LIST 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 @@ -12,122 +11,38 @@ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 411570 * *****************************************************************************/ -package org.eclipse.papyrus.uml.diagram.common.handlers; -import java.util.Iterator; -import java.util.List; +package org.eclipse.papyrus.uml.diagram.common.handlers; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.RequestConstants; import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.actions.internal.DeleteFromDiagramAction; -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.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.gmfdiag.menu.handlers.AbstractGraphicalCommandHandler; + /** * Command handler for delete from diagram + * + * @deprecated Since 1.1.0 and the moving of handler to org.eclipse.papyrus.infra.gmfdiag.menu plugin. Use {@link org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler}. */ -public class DeleteFromDiagramCommandHandler extends AbstractGraphicalCommandHandler implements IHandler { +@Deprecated +public class DeleteFromDiagramCommandHandler extends org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler { /** + * Constructor. * - * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand() - * - * @return the deletion command - * @throws ExecutionException */ - @Override - protected Command getCommand() { - - // Retrieve currently selected IGraphicalEditPart(s) - List<IGraphicalEditPart> editParts = getSelectedElements(); - if (editParts.isEmpty()) { - return UnexecutableCommand.INSTANCE; - } - - if (!supportViews(editParts) || isCanonical(editParts)) { - return UnexecutableCommand.INSTANCE; - } - - CompoundCommand command = new CompoundCommand("Delete From Diagram"); - for (Iterator<IGraphicalEditPart> iter = editParts.iterator(); iter.hasNext();) { - IGraphicalEditPart editPart = iter.next(); - /* Send the request to the edit part */ - command.add(editPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE))); - } - return command; + public DeleteFromDiagramCommandHandler() { + super(); } /** - * Copied from {@link DeleteFromDiagramAction} - */ - private boolean supportViews(List<IGraphicalEditPart> editParts) { - for (Iterator<IGraphicalEditPart> iter = editParts.iterator(); iter.hasNext();) { - IGraphicalEditPart object = iter.next(); - if (object instanceof GraphicalEditPart && !((GraphicalEditPart) object).hasNotationView()) { - return false; - } - } - return true; - } - - /** - * Copied from {@link DeleteFromDiagramAction} + * @see org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromDiagramCommandHandler#getCommand() + * + * @return */ - protected boolean isCanonical(List<IGraphicalEditPart> editParts) { - - boolean isCanonical = false; - if (!editParts.isEmpty()) { - - for (Iterator<IGraphicalEditPart> si = editParts.iterator(); si.hasNext() && !isCanonical;) { - IGraphicalEditPart child = si.next(); - - View view = (View) child.getAdapter(View.class); - if (view == null || view.getElement() == null || view.getElement() instanceof View) { - // If there is no element or the element is a view (e.g. - // diagram - // link) than we want to support delete from diagram. See - // bugzilla#148453. - isCanonical = false; - continue; - } - - if (child instanceof ConnectionEditPart) { - ConnectionEditPart connection = (ConnectionEditPart) child; - isCanonical = (!connection.isSemanticConnection() || (isCanonical(connection.getSource()) && isCanonical(connection.getTarget()))); - } else { - isCanonical = isCanonical(child); - } - } - } - return isCanonical; + @Override + protected Command getCommand() { + return super.getCommand(); } - /** - * Copied from {@link DeleteFromDiagramAction} - */ - protected boolean isCanonical(EditPart ep) { - EObject eObject = EMFHelper.getEObject(ep); - EditPart parent = ep.getParent(); - if (eObject != null && parent != null) { // sanity checks - CanonicalEditPolicy cep = (CanonicalEditPolicy) parent.getEditPolicy(EditPolicyRoles.CANONICAL_ROLE); - return cep != null && cep.isEnabled() && cep.canCreate(eObject); - } - return false; - } - private static final String DISPLAY_MESSAGE_FOR_HIDE_ACTION_PREFERENCE_KEY = "displayMessageForHideActionPreferenceKey"; } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java index f69267f9fc4..af0e0ebdff8 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java @@ -1,7 +1,6 @@ /***************************************************************************** - * Copyright (c) 2010, 2014 CEA LIST and others. - * - * + * Copyright (c) 2014 CEA LIST 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 @@ -14,93 +13,36 @@ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 411570 * *****************************************************************************/ -package org.eclipse.papyrus.uml.diagram.common.handlers; -import java.util.Iterator; -import java.util.List; +package org.eclipse.papyrus.uml.diagram.common.handlers; -import org.eclipse.core.commands.IHandler; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.gmfdiag.menu.handlers.AbstractGraphicalCommandHandler; -import org.eclipse.papyrus.infra.services.controlmode.ControlModeManager; -import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest; -import org.eclipse.papyrus.infra.services.controlmode.IControlModeManager; -import org.eclipse.papyrus.infra.services.controlmode.util.ControlHelper; + /** * Command handler for delete from diagram + * + * @deprecated Since 1.1.0 and the moving of handler to org.eclipse.papyrus.infra.gmfdiag.menu plugin. Use {@link org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromModelCommandHandler}. */ -public class DeleteFromModelCommandHandler extends AbstractGraphicalCommandHandler implements IHandler { +@Deprecated +public class DeleteFromModelCommandHandler extends org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromModelCommandHandler { + + /** + * Constructor. + * + */ + public DeleteFromModelCommandHandler() { + super(); + } + /** + * @see org.eclipse.papyrus.infra.gmfdiag.menu.handlers.DeleteFromModelCommandHandler#getCommand() + * + * @return + */ @Override protected Command getCommand() { - - TransactionalEditingDomain editingDomain = getEditingDomain(); - - if (editingDomain == null) { - return UnexecutableCommand.INSTANCE; - } - - // Retrieve currently selected IGraphicalEditPart(s) - List<IGraphicalEditPart> editParts = getSelectedElements(); - if (editParts.isEmpty()) { - return UnexecutableCommand.INSTANCE; - } - - // Iterate over selection and retrieve the deletion command from each - // edit part - // Add each returned command to the composite command - CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Delete From Model"); - - Iterator<IGraphicalEditPart> it = editParts.iterator(); - while (it.hasNext()) { - IGraphicalEditPart editPart = it.next(); - - if (!(editPart instanceof DiagramEditPart)) { - - // Look for uncontrol mode command - EObject eObjectToControl = EMFHelper.getEObject(editPart); - if (eObjectToControl != null && ControlHelper.isRootControlledObject(eObjectToControl)) { - ControlModeRequest controlRequest = ControlModeRequest.createUIUncontrolModelRequest(getEditingDomain(), eObjectToControl); - IControlModeManager controlMng = ControlModeManager.getInstance(); - ICommand controlCommand = controlMng.getUncontrolCommand(controlRequest); - command.compose(controlCommand); - } - - // Look for the GMF deletion command - Command curCommand = editPart.getCommand(new EditCommandRequestWrapper(new DestroyElementRequest(false))); - - - if (curCommand != null) { - command.compose(new CommandProxy(curCommand)); - } - - - - - } - } - - if (command.isEmpty()) { - return UnexecutableCommand.INSTANCE; - } - - - - return new ICommandProxy(command); + return super.getCommand(); } - } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/propertytester/DeleteActionPropertyTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/propertytester/DeleteActionPropertyTester.java index d70ae29325f..65879af7706 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/propertytester/DeleteActionPropertyTester.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/propertytester/DeleteActionPropertyTester.java @@ -13,25 +13,9 @@ package org.eclipse.papyrus.uml.diagram.common.propertytester; -import java.util.LinkedList; -import java.util.List; - import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2; -import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.emf.readonly.ReadOnlyManager; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.gmfdiag.common.helper.NotationHelper; -import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart; - -import com.google.common.base.Optional; +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtil; /** * Property tester to enable different delete actions in Diagram. @@ -61,60 +45,11 @@ public class DeleteActionPropertyTester extends PropertyTester { * @param expectedValue * @return */ - @Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (SEMANTIC_DELETION_PROPERTY.equals(property)) { - return expectedValue.equals(isSemanticDeletion((IGraphicalEditPart) receiver)); + return expectedValue.equals(DeleteActionUtil.isSemanticDeletion((IGraphicalEditPart) receiver)); } return false; } - - /** - * Checks if is semantic deletion. - * - * @param editPart - * the edit part - * @return true, if is semantic deletion - */ - private boolean isSemanticDeletion(IGraphicalEditPart editPart) { - boolean isSemanticDeletion = false; - TransactionalEditingDomain editingDomain = null; - - // Get Editing Domain - try { - editingDomain = ServiceUtilsForEditPart.getInstance().getTransactionalEditingDomain(editPart); - } catch (ServiceException e) { - - } - - if (editingDomain != null) { - - IReadOnlyHandler2 readOnly = ReadOnlyManager.getReadOnlyHandler(editingDomain); - EObject semantic = EMFHelper.getEObject(editPart); - View graphical = NotationHelper.findView(editPart); - - isSemanticDeletion = !(semantic == null || semantic == graphical || semantic.eContainer() == null); - - - if (isSemanticDeletion && readOnly != null) { - - // Get URIs - List<URI> uris = new LinkedList<URI>(); - uris.add(EcoreUtil.getURI(semantic)); - - if (graphical != null) { - uris.add(EcoreUtil.getURI(graphical)); - } - - // Verify RO properties - Optional<Boolean> result = readOnly.anyReadOnly(ReadOnlyAxis.anyAxis(), uris.toArray(new URI[uris.size()])); - isSemanticDeletion = !(result.isPresent() && result.get()); - - } - } - - - return isSemanticDeletion; - } } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java index 71dbcdd03aa..203625eb354 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java @@ -13,7 +13,6 @@ *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.common.providers; -import org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler; import org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler; import org.eclipse.ui.ISources; @@ -31,7 +30,6 @@ public class ActionStateSourceProvider extends AbstractActionStateSourceProvider /** * The name of the variables to check. */ - public static final String DELETE_IN_DIAGRAM = "deleteInDiagram"; //$NON-NLS-1$ public static final String RENAME_NAMED_ELEMENT = "renameNamedElement";//$NON-NLS-1$ @@ -42,7 +40,6 @@ public class ActionStateSourceProvider extends AbstractActionStateSourceProvider */ public ActionStateSourceProvider() { super(); - currentState.put(DELETE_IN_DIAGRAM, DISABLED); currentState.put(RENAME_NAMED_ELEMENT, DISABLED); } @@ -54,33 +51,9 @@ public class ActionStateSourceProvider extends AbstractActionStateSourceProvider */ @Override public String[] getProvidedSourceNames() { - return new String[] { DELETE_IN_DIAGRAM, RENAME_NAMED_ELEMENT }; + return new String[] { RENAME_NAMED_ELEMENT }; } - /** - * Refresh the state of the Delete Action - */ - protected void refreshDeleteAction() { - String oldState = currentState.get(DELETE_IN_DIAGRAM); - String newState = (testDeleteFromDiagram() ? ENABLED : DISABLED); - - if (oldState != newState) { - currentState.put(DELETE_IN_DIAGRAM, newState); - fireSourceChanged(ISources.WORKBENCH, currentState); - } - } - - /** - * Tests if the action DeleteFromDiagram (now called Delete Selected Element - * can be executed - * - * @return <code>true</code> if the action DeleteFromDiagram (now called - * Delete Selected Element can be executed <code>false</code> if not - */ - protected boolean testDeleteFromDiagram() { - DeleteFromDiagramCommandHandler handler = new DeleteFromDiagramCommandHandler(); - return isSelectionInDiagram() && handler.isEnabled(); - } /** * @@ -89,7 +62,6 @@ public class ActionStateSourceProvider extends AbstractActionStateSourceProvider */ @Override protected void refreshActions() { - refreshDeleteAction(); refreshRenamedNamedElement(); } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java index 133f497f541..e83df0eae9f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java @@ -53,6 +53,7 @@ public class CustomMessage4CreateCommand extends Message4CreateCommand { */
@Override
public boolean canExecute() {
+ // #445271: we don't care about CommandHelper.hasValidContainer()
if (source == null && target == null) {
return false;
}
@@ -69,11 +70,6 @@ public class CustomMessage4CreateCommand extends Message4CreateCommand { if (getContainer() == null) {
return false;
}
- if (getSource() != null && getTarget() != null) {
- if (!CommandHelper.hasValidContainer(getRequest())) {
- return false;
- }
- }
if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4006(getContainer(), getSource(), getTarget())) {
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java index 7b9a6cd47c7..16810656d28 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java @@ -51,14 +51,10 @@ public class CustomMessage6CreateCommand extends Message6CreateCommand { */
@Override
public boolean canExecute() {
+ // #445271: we don't care about CommandHelper.hasValidContainer()
if (!super.canExecute()) {
return false;
}
- if (getSource() != null && getTarget() != null) {
- if (!CommandHelper.hasValidContainer(getRequest())) {
- return false;
- }
- }
return MessageConnectionHelper.canExist(MessageSort.ASYNCH_SIGNAL_LITERAL, getSource(), null);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java index deea9551273..88e70cb33cd 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java @@ -51,14 +51,10 @@ public class CustomMessage7CreateCommand extends Message7CreateCommand { */
@Override
public boolean canExecute() {
+ // #445271: we don't care about CommandHelper.hasValidContainer()
if (!super.canExecute()) {
return false;
}
- if (getSource() != null && getTarget() != null) {
- if (!CommandHelper.hasValidContainer(getRequest())) {
- return false;
- }
- }
return MessageConnectionHelper.canExist(MessageSort.ASYNCH_SIGNAL_LITERAL, null, getTarget());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java index 89261bad068..8a03aae6d43 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java @@ -104,6 +104,10 @@ public class OccurrenceSpecificationHelper { execution.setFinish(newEnd);
}
if (canBeRemoved(oldEnd, newEnd, isStart)) {
+ // "coveredBy" is bidirectional so must be cleaned prior to deletion of element itself
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=451320
+ oldEnd.getCovereds().clear();
+
EcoreUtil.remove(oldEnd);
}
return true;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java b/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java index 4227f714cfa..452a7c3d9fc 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java +++ b/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java @@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.papyrus.uml.extensionpoints.Activator;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
* Some utils extracted from com.cea.utils classes (package and element)
@@ -40,10 +41,10 @@ public class Util { boolean has = false;
if (elt != null) {
- Iterator i = elt.getAppliedStereotypes().iterator();
+ Iterator<Stereotype> i = elt.getAppliedStereotypes().iterator();
Stereotype currentStereotype;
while (i.hasNext() && !has) {
- currentStereotype = (Stereotype) i.next();
+ currentStereotype = i.next();
if (currentStereotype.getName().equals(stereotypeName)) {
has = true;
}
@@ -101,6 +102,8 @@ public class Util { tmpResourceSet.getLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
tmpResourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
+ UMLUtil.init(tmpResourceSet);
+
return tmpResourceSet;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.navigation/plugin.xml index 96d67cb38f9..a3dc19593a7 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.navigation/plugin.xml +++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/plugin.xml @@ -9,6 +9,12 @@ id="org.eclipse.papyrus.uml.navigation.typedElement"
label="UML Typed Element navigation">
</contributor>
+ <contributor
+ contributor="org.eclipse.papyrus.uml.navigation.contributor.CBANavigationContributor"
+ description="Navigates to the Behavior linked to the current UML CallBehaviourAction"
+ id="org.eclipse.papyrus.uml.navigation.callBehaviorAction"
+ label="UML Call Behavior Action navigation">
+ </contributor>
</extension>
</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigableElement.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigableElement.java new file mode 100644 index 00000000000..8de6f1aaadf --- /dev/null +++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigableElement.java @@ -0,0 +1,98 @@ +/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST, 2014 Flanders' Make.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Klaas Gadeyne (Flanders' Make) klaas.gadeyne@flandersmake.be - Extended for CallBehaviorActions,
+ * see bug 453721
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.navigation.contributor;
+
+import java.util.Collections;
+
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.papyrus.infra.services.navigation.service.NavigableElement;
+import org.eclipse.papyrus.infra.widgets.util.IRevealSemanticElement;
+import org.eclipse.papyrus.infra.widgets.util.NavigationTarget;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Behavior;
+
+/**
+ * Navigates from a CallBehaviorAction to its Behavior declaration
+ *
+ * @author Klaas Gadeyne
+ */
+public class CBANavigableElement implements NavigableElement {
+
+ protected final Behavior behavior;
+
+ /**
+ *
+ * @param type
+ * The Type to navigate to. May be null.
+ */
+ public CBANavigableElement(Behavior behavior) {
+ this.behavior = behavior;
+ }
+
+ public String getLabel() {
+ String label = "Go to behavior" + getCBALabel();
+ return label;
+ }
+
+ public String getDescription() {
+ return "Go to the Behavior linked with to this CallBehaviorAction" + getCBALabel();
+ }
+
+ protected String getCBALabel() {
+ if (behavior == null) {
+ return " (Undefined)";
+ } else {
+ return " (" + behavior.getName() + ")";
+ }
+ }
+
+ @Deprecated
+ public void navigate(IRevealSemanticElement navigationContext) {
+ if (!isEnabled()) {
+ return;
+ }
+
+ navigationContext.revealSemanticElement(Collections.singletonList(behavior));
+ }
+
+ public Image getImage() {
+ if (behavior == null) {
+ return null;
+ }
+
+ try {
+ return ServiceUtilsForEObject.getInstance().getServiceRegistry(behavior).getService(LabelProviderService.class).getLabelProvider().getImage(behavior);
+ } catch (Exception ex) {
+ return null;
+ }
+ }
+
+ /**
+ * Enabled when the behavior is defined
+ */
+ public boolean isEnabled() {
+ return behavior != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean navigate(NavigationTarget navigationContext) {
+ if (!isEnabled()) {
+ return false;
+ }
+ return navigationContext.revealElement(behavior);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigationContributor.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigationContributor.java new file mode 100644 index 00000000000..d9d2c3e1303 --- /dev/null +++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/contributor/CBANavigationContributor.java @@ -0,0 +1,42 @@ +/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST, 2014 Flanders' Make.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Klaas Gadeyne (Flanders' Make) klaas.gadeyne@flandersmake.be - Extended for CallBehaviorActions,
+ * see bug 453721
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.navigation.contributor;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.services.navigation.service.NavigableElement;
+import org.eclipse.papyrus.infra.services.navigation.service.NavigationContributor;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+
+/**
+ * NavigationContributor to navigate from a CallBehaviorAction to its Behavior declaration
+ *
+ * @author Klaas Gadeyne
+ *
+ */
+public class CBANavigationContributor implements NavigationContributor {
+
+ public List<NavigableElement> getNavigableElements(Object fromElement) {
+ List<NavigableElement> result = new LinkedList<NavigableElement>();
+
+ Element element = UMLUtil.resolveUMLElement(fromElement);
+ if (element instanceof CallBehaviorAction) {
+ result.add(new CBANavigableElement(((CallBehaviorAction) element).getBehavior()));
+ }
+ return result;
+ }
+}
\ No newline at end of file diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/AbstractPackageImportSource.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/AbstractPackageImportSource.java index 07f9d717839..13720fb724b 100644 --- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/AbstractPackageImportSource.java +++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/AbstractPackageImportSource.java @@ -108,21 +108,28 @@ public abstract class AbstractPackageImportSource implements IPackageImportSourc validateSelection(model); + URI resourceURI = null; try { if (model instanceof Resource) { resource = (Resource) model; + resourceURI = resource.getURI(); if (!resource.isLoaded()) { - resource.load(null); + resource = resourceSet.getResource(resourceURI, true); } } else if (model instanceof IFile) { IFile file = (IFile) model; - resource = resourceSet.getResource(URI.createPlatformResourceURI(file.getFullPath().toString(), true), true); + resourceURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true); + resource = resourceSet.getResource(resourceURI, true); } else if (model instanceof URI) { - resource = resourceSet.getResource((URI) model, true); + resourceURI = (URI) model; + resource = resourceSet.getResource(resourceURI, true); } } catch (Exception e) { - // resource load failed - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind("Failed to load packages from resource \"{0}\".", getText(model)), e)); + Activator.log.error(e); + // resource load failed, but may still provide a (partially) valid Package. Keep going (We will validate the resource later on) + if (resourceURI != null) { + resource = resourceSet.getResource(resourceURI, false); + } } if (resource == null) { diff --git a/releng/top-pom-main-tests.xml b/releng/top-pom-main-tests.xml index 0a98ba6306f..75f46fbca4d 100644 --- a/releng/top-pom-main-tests.xml +++ b/releng/top-pom-main-tests.xml @@ -1,326 +1,327 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <modules>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.tests</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.core.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.nattable.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.diagram.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.nattable.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.diagram.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.nattable.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.tools.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.views.feature</module>
- <module>../features/papyrus-tests-features/org.eclipse.papyrus.uml.textedit.tests.feature</module>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests</module>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests</module>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests</module>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests</module>
- <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.extendedtypes.tests</module>
- <module>../tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests</module>
- <module>../tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests</module>
- <module>../tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests</module>
- <module>../tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests</module>
- <module>../tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests</module>
- <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests</module>
- <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests</module>
- <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests</module>
- <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests</module>
- <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests</module>
- <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests</module>
- <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests</module>
- <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests</module>
- <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests</module>
- <module>../tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework</module>
- <module>../tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils</module>
- <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests</module>
- <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests</module>
- <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric.tests</module>
- <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests</module>
- <module>../tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests</module>
- <module>../tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.allocation.tests</module>
- <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests</module>
- <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests</module>
- <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests</module>
- <module>../tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests</module>
- <module>../tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests</module>
- <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests</module>
- <module>../tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests</module>
- <module>../tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests</module>
- <module>../tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests</module>
- <module>../tests/junit/plugins/uml/org.eclipse.papyrus.search.tests</module>
- <module>../tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests</module>
- <module>../tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests</module>
- <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests</module>
- <module>../tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests</module>
- <module>../tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests</module>
- <module>../tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests</module>
- <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests</module>
- <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests</module>
- <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests</module>
- <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests</module>
- </modules>
- <properties>
- <tycho-version>0.21.0</tycho-version>
- <tychoExtrasVersion>0.21.0</tychoExtrasVersion>
- <testConfig>CI_TESTS_CONFIG</testConfig> <!-- See org.eclipse.papyrus.junit.framework.classification.ClassificationConfig -->
- </properties>
- <repositories>
- <repository>
- <id>papyrus-main</id>
- <layout>p2</layout>
- <url>${papyrus.repo.main}</url>
- </repository>
- <repository>
- <id>emf-compare</id>
- <layout>p2</layout>
- <!-- updateFrom("EMF COMPARE",0) -->
- <url>http://download.eclipse.org/modeling/emf/compare/updates/milestones/3.1/S201411071344</url>
- </repository>
- <repository>
- <id>emf-emf</id>
- <layout>p2</layout>
- <!-- updateFrom("EMF (Core)",0) -->
- <url>http://download.eclipse.org/modeling/emf/emf/updates/2.11milestones/</url>
- </repository>
- <repository>
- <id>emft-mwe[0]</id>
- <layout>p2</layout>
- <!-- updateFrom("EMFT MWE",0) -->
- <url>http://download.eclipse.org/modeling/emft/mwe/updates/milestones/S201411111017/mwe</url>
- </repository>
- <repository>
- <id>emft-mwe[1]</id>
- <layout>p2</layout>
- <!-- updateFrom("EMFT MWE",1) -->
- <url>http://download.eclipse.org/modeling/emft/mwe/updates/milestones/S201411111103/mwe2lang</url>
- </repository>
- <repository>
- <id>emf-transaction</id>
- <layout>p2</layout>
- <!-- updateFrom("EMF TRANSACTION",0) -->
- <url>http://download.eclipse.org/modeling/emf/transaction/updates/milestones/S201411230352</url>
- </repository>
- <repository>
- <id>emf-validation</id>
- <layout>p2</layout>
- <!-- updateFrom("EMF VALIDATION",0) -->
- <url>http://download.eclipse.org/modeling/emf/validation/updates/milestones/S201411230228</url>
- </repository>
- <repository>
- <id>ep</id>
- <layout>p2</layout>
- <!-- updateFrom("Eclipse",0) -->
- <url>http://download.eclipse.org/eclipse/updates/4.5milestones/S-4.5M3-201410292000/</url>
- </repository>
- <repository>
- <id>gef</id>
- <layout>p2</layout>
- <!-- updateFrom("GEF",0) -->
- <url>http://download.eclipse.org/tools/gef/updates/milestones</url>
- </repository>
- <repository>
- <id>gmp-gmf-notation</id>
- <layout>p2</layout>
- <!-- updateFrom("GMF Notation",0) -->
- <url>http://download.eclipse.org/modeling/gmp/gmf-notation/updates/milestones/S201411230248</url>
- </repository>
- <repository>
- <id>gmp-gmf-runtime</id>
- <layout>p2</layout>
- <!-- updateFrom("GMF Runtime",0) -->
- <url>http://download.eclipse.org/modeling/gmp/gmf-runtime/updates/milestones/S201411230102</url>
- </repository>
- <repository>
- <id>gmf-tooling</id>
- <layout>p2</layout>
- <!-- updateFrom("GMF Tooling",0) -->
- <url>http://download.eclipse.org/modeling/gmp/gmf-tooling/updates/milestones-3.2.RC4a</url>
- </repository>
- <repository>
- <id>m2t-acceleo</id>
- <layout>p2</layout>
- <!-- updateFrom("M2T ACCELEO",0) -->
- <url>http://download.eclipse.org/acceleo/updates/milestones/3.6/S201408190816</url>
- </repository>
- <repository>
- <id>m2t-xpand</id>
- <layout>p2</layout>
- <!-- updateFrom("M2T XPAND",0) -->
- <url>http://download.eclipse.org/modeling/m2t/xpand/updates/milestones/S201411111024/</url>
- </repository>
- <repository>
- <id>mdt-ocl</id>
- <layout>p2</layout>
- <!-- updateFrom("MDT OCL 5.1",0) -->
- <url>http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/5.1.0/S201411101552</url>
- </repository>
- <repository>
- <id>mdt-uml2</id>
- <layout>p2</layout>
- <!-- updateFrom("MDT UML2",0) -->
- <url>http://download.eclipse.org/modeling/mdt/uml2/updates/5.1milestones</url>
- </repository>
- <repository>
- <id>mmt-qvto</id>
- <layout>p2</layout>
- <!-- updateFrom("QVT Operational",0) -->
- <url>http://download.eclipse.org/mmt/qvto/updates/milestones/3.5.0/S201411111552</url>
- </repository>
- <repository>
- <id>nattable</id>
- <layout>p2</layout>
- <url>http://download.eclipse.org/nattable/releases/1.1.0/repository/</url>
- </repository>
- <repository>
- <id>orbit</id>
- <layout>p2</layout>
- <url>http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository</url>
- </repository>
- <repository>
- <id>subversive</id>
- <layout>p2</layout>
- <!-- updateFrom("Subversive",0) -->
- <url>http://download.eclipse.org/technology/subversive/2.0/luna-site/</url>
- </repository>
- <repository>
- <id>tmf-xtext</id>
- <layout>p2</layout>
- <!-- updateFrom("Xtext, Xtend",0) -->
- <url>http://download.eclipse.org/modeling/tmf/xtext/updates/milestones/head/S201411111037/</url>
- </repository>
- <repository>
- <id>swtbot</id>
- <layout>p2</layout>
- <url>http://download.eclipse.org/technology/swtbot/snapshots</url>
- </repository>
- <repository>
- <id>webtools</id>
- <layout>p2</layout>
- <!-- updateFrom("WebTools",0) -->
- <url>http://download.eclipse.org/webtools/downloads/drops/R3.7.0/S-3.7.0M3-20141111153131/repository/</url>
- </repository>
- </repositories>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-compiler-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <optimize>true</optimize>
- <showWarnings>true</showWarnings>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-maven-plugin</artifactId>
- <version>${tycho-version}</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <environments>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-p2-repository-plugin</artifactId>
- <version>${tycho-version}</version>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <testSuite>org.eclipse.papyrus.tests</testSuite>
- <testClass>org.eclipse.papyrus.tests.AllTests</testClass>
- <useUIHarness>true</useUIHarness>
- <useUIThread>true</useUIThread>
- <testFailureIgnore>true</testFailureIgnore>
- <argLine>-Xms512m -Xmx2048m -XX:MaxPermSize=512M -XX:SoftRefLRUPolicyMSPerMB=100</argLine>
- <appArgLine>-testConfig=${testConfig}</appArgLine>
- <product>org.eclipse.sdk.ide</product>
-
- <dependencies>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.sdk.feature.group</artifactId>
- <version>0.0.0</version>
- </dependency>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.papyrus.sdk.feature.feature.group</artifactId>
- <version>0.0.0</version>
- </dependency>
- </dependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus</artifactId> + <version>1.1.0-SNAPSHOT</version> + <packaging>pom</packaging> + <modules> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.tests</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.core.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.nattable.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.diagram.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.sysml.nattable.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.diagram.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.nattable.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.tools.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.tests.views.feature</module> + <module>../features/papyrus-tests-features/org.eclipse.papyrus.uml.textedit.tests.feature</module> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests</module> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests</module> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests</module> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests</module> + <module>../tests/junit/plugins/core/org.eclipse.papyrus.infra.extendedtypes.tests</module> + <module>../tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests</module> + <module>../tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests</module> + <module>../tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests</module> + <module>../tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests</module> + <module>../tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests</module> + <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests</module> + <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests</module> + <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests</module> + <module>../tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests</module> + <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests</module> + <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests</module> + <module>../tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests</module> + <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests</module> + <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests</module> + <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests</module> + <module>../tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework</module> + <module>../tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils</module> + <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests</module> + <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests</module> + <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric.tests</module> + <module>../tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests</module> + <module>../tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests</module> + <module>../tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.allocation.tests</module> + <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests</module> + <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests</module> + <module>../tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests</module> + <module>../tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests</module> + <module>../tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests</module> + <module>../tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests</module> + <module>../tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests</module> + <module>../tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests</module> + <module>../tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests</module> + <module>../tests/junit/plugins/uml/org.eclipse.papyrus.search.tests</module> + <module>../tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests</module> + <module>../tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests</module> + <module>../tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests</module> + <module>../tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests</module> + <module>../tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests</module> + <module>../tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests</module> + <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests</module> + <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests</module> + <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests</module> + <module>../tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests</module> + </modules> + <properties> + <tycho-version>0.21.0</tycho-version> + <tychoExtrasVersion>0.21.0</tychoExtrasVersion> + <testConfig>CI_TESTS_CONFIG</testConfig> <!-- See org.eclipse.papyrus.junit.framework.classification.ClassificationConfig --> + </properties> + <repositories> + <repository> + <id>papyrus-main</id> + <layout>p2</layout> + <url>${papyrus.repo.main}</url> + </repository> + <repository> + <id>emf-compare</id> + <layout>p2</layout> + <!-- updateFrom("EMF COMPARE",0) --> + <url>http://download.eclipse.org/modeling/emf/compare/updates/milestones/3.1/S201411071344</url> + </repository> + <repository> + <id>emf-emf</id> + <layout>p2</layout> + <!-- updateFrom("EMF (Core)",0) --> + <url>http://download.eclipse.org/modeling/emf/emf/updates/2.11milestones/</url> + </repository> + <repository> + <id>emft-mwe[0]</id> + <layout>p2</layout> + <!-- updateFrom("EMFT MWE",0) --> + <url>http://download.eclipse.org/modeling/emft/mwe/updates/milestones/S201411111017/mwe</url> + </repository> + <repository> + <id>emft-mwe[1]</id> + <layout>p2</layout> + <!-- updateFrom("EMFT MWE",1) --> + <url>http://download.eclipse.org/modeling/emft/mwe/updates/milestones/S201411111103/mwe2lang</url> + </repository> + <repository> + <id>emf-transaction</id> + <layout>p2</layout> + <!-- updateFrom("EMF TRANSACTION",0) --> + <url>http://download.eclipse.org/modeling/emf/transaction/updates/milestones/S201411230352</url> + </repository> + <repository> + <id>emf-validation</id> + <layout>p2</layout> + <!-- updateFrom("EMF VALIDATION",0) --> + <url>http://download.eclipse.org/modeling/emf/validation/updates/milestones/S201411230228</url> + </repository> + <repository> + <id>ep</id> + <layout>p2</layout> + <!-- updateFrom("Eclipse",0) --> + <url>http://download.eclipse.org/eclipse/updates/4.5milestones/S-4.5M3-201410292000/</url> + </repository> + <repository> + <id>gef</id> + <layout>p2</layout> + <!-- updateFrom("GEF",0) --> + <url>http://download.eclipse.org/tools/gef/updates/milestones</url> + </repository> + <repository> + <id>gmp-gmf-notation</id> + <layout>p2</layout> + <!-- updateFrom("GMF Notation",0) --> + <url>http://download.eclipse.org/modeling/gmp/gmf-notation/updates/milestones/S201411230248</url> + </repository> + <repository> + <id>gmp-gmf-runtime</id> + <layout>p2</layout> + <!-- updateFrom("GMF Runtime",0) --> + <url>http://download.eclipse.org/modeling/gmp/gmf-runtime/updates/milestones/S201411230102</url> + </repository> + <repository> + <id>gmf-tooling</id> + <layout>p2</layout> + <!-- updateFrom("GMF Tooling",0) --> + <url>http://download.eclipse.org/modeling/gmp/gmf-tooling/updates/milestones-3.2.RC4a</url> + </repository> + <repository> + <id>m2t-acceleo</id> + <layout>p2</layout> + <!-- updateFrom("M2T ACCELEO",0) --> + <url>http://download.eclipse.org/acceleo/updates/milestones/3.6/S201408190816</url> + </repository> + <repository> + <id>m2t-xpand</id> + <layout>p2</layout> + <!-- updateFrom("M2T XPAND",0) --> + <url>http://download.eclipse.org/modeling/m2t/xpand/updates/milestones/S201411111024/</url> + </repository> + <repository> + <id>mdt-ocl</id> + <layout>p2</layout> + <!-- updateFrom("MDT OCL 5.1",0) --> + <url>http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/5.1.0/S201411101552</url> + </repository> + <repository> + <id>mdt-uml2</id> + <layout>p2</layout> + <!-- updateFrom("MDT UML2",0) --> + <url>http://download.eclipse.org/modeling/mdt/uml2/updates/5.1milestones</url> + </repository> + <repository> + <id>mmt-qvto</id> + <layout>p2</layout> + <!-- updateFrom("QVT Operational",0) --> + <url>http://download.eclipse.org/mmt/qvto/updates/milestones/3.5.0/S201411111552</url> + </repository> + <repository> + <id>nattable</id> + <layout>p2</layout> + <url>http://download.eclipse.org/nattable/releases/1.1.0/repository/</url> + </repository> + <repository> + <id>orbit</id> + <layout>p2</layout> + <url>http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository</url> + </repository> + <repository> + <id>subversive</id> + <layout>p2</layout> + <!-- updateFrom("Subversive",0) --> + <url>http://download.eclipse.org/technology/subversive/2.0/luna-site/</url> + </repository> + <repository> + <id>tmf-xtext</id> + <layout>p2</layout> + <!-- updateFrom("Xtext, Xtend",0) --> + <url>http://download.eclipse.org/modeling/tmf/xtext/updates/milestones/head/S201411111037/</url> + </repository> + <repository> + <id>swtbot</id> + <layout>p2</layout> + <url>http://download.eclipse.org/technology/swtbot/snapshots</url> + </repository> + <repository> + <id>webtools</id> + <layout>p2</layout> + <!-- updateFrom("WebTools",0) --> + <url>http://download.eclipse.org/webtools/downloads/drops/R3.7.0/S-3.7.0M3-20141111153131/repository/</url> + </repository> + </repositories> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <configuration> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-compiler-plugin</artifactId> + <version>${tycho-version}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + <optimize>true</optimize> + <showWarnings>true</showWarnings> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-maven-plugin</artifactId> + <version>${tycho-version}</version> + <extensions>true</extensions> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>target-platform-configuration</artifactId> + <version>${tycho-version}</version> + <configuration> + <environments> + <environment> + <os>win32</os> + <ws>win32</ws> + <arch>x86</arch> + </environment> + <environment> + <os>win32</os> + <ws>win32</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>macosx</os> + <ws>cocoa</ws> + <arch>x86_64</arch> + </environment> + </environments> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-p2-repository-plugin</artifactId> + <version>${tycho-version}</version> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-surefire-plugin</artifactId> + <version>${tycho-version}</version> + <configuration> + <testSuite>org.eclipse.papyrus.tests</testSuite> + <testClass>org.eclipse.papyrus.tests.AllTests</testClass> + <useUIHarness>true</useUIHarness> + <useUIThread>true</useUIThread> + <testFailureIgnore>true</testFailureIgnore> + <argLine>-Xms512m -Xmx2048m -XX:MaxPermSize=512M -XX:SoftRefLRUPolicyMSPerMB=100</argLine> + <appArgLine>-testConfig=${testConfig}</appArgLine> + <product>org.eclipse.sdk.ide</product> + + <dependencies> + <dependency> + <type>p2-installable-unit</type> + <artifactId>org.eclipse.sdk.feature.group</artifactId> + <version>0.0.0</version> + </dependency> + <dependency> + <type>p2-installable-unit</type> + <artifactId>org.eclipse.papyrus.sdk.feature.feature.group</artifactId> + <version>0.0.0</version> + </dependency> + </dependencies> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF index e214ba890ce..b082dd5795f 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF @@ -64,7 +64,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.textedit.property.tests;bundle-version="1.1.0", org.eclipse.papyrus.uml.textedit.parameter.tests;bundle-version="1.1.0", org.eclipse.papyrus.uml.decoratormodel.tests;bundle-version="1.1.0", - org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="1.1.0" + org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="1.1.0", + org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="1.1.0" Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy Bundle-Version: 1.1.0.qualifier diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java index 01dcb82374c..b0e8dda5423 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java @@ -89,6 +89,9 @@ public class AllTests { /* css */ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests.class)); + /* menu */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.menu.tests.tests.AllTests.class)); + /* control mode */ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.controlmode.tests.AllTests.class)); diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.classpath b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.project b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.project new file mode 100644 index 00000000000..e6a55ae78db --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.gmfdiag.menu.tests</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..92730f2b7d7 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: GMF Diagram Menu Tests +Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.menu.tests +Bundle-Version: 1.1.0.qualifier +Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.menu.tests.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.gmf.runtime.diagram.ui, + org.junit, + org.eclipse.papyrus.junit.framework;bundle-version="1.1.0", + org.eclipse.papyrus.junit.utils;bundle-version="1.1.0", + org.eclipse.papyrus.infra.gmfdiag.menu;bundle-version="1.1.0", + org.eclipse.papyrus.infra.core;bundle-version="1.1.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.papyrus.infra.gmfdiag.menu.tests.tests diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/about.html b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/about.html new file mode 100644 index 00000000000..598b3684879 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>May 12, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/build.properties b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/build.properties new file mode 100644 index 00000000000..342f3ffdb34 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + resources/ diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch new file mode 100644 index 00000000000..e19502f5363 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="false"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="true"/> +<booleanAttribute key="clearws" value="true"/> +<booleanAttribute key="clearwslog" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> +<booleanAttribute key="default" value="false"/> +<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.papyrus.bundles.tests,org.eclipse.papyrus.customization.properties.tests,org.eclipse.papyrus.editor.integration.tests,org.eclipse.papyrus.infra.extendedtypes.tests,org.eclipse.papyrus.infra.gmfdiag.css.tests,org.eclipse.papyrus.infra.nattable.model.editor.tests,org.eclipse.papyrus.infra.nattable.tests,org.eclipse.papyrus.infra.nattable.views.tests,org.eclipse.papyrus.infra.services.controlmode.tests,org.eclipse.papyrus.infra.services.labelprovider.tests,org.eclipse.papyrus.infra.tools.tests,org.eclipse.papyrus.search.tests,org.eclipse.papyrus.sysml.diagram.requirement.tests,org.eclipse.papyrus.sysml.modelexplorer.tests,org.eclipse.papyrus.sysml.nattable.allocation.tests,org.eclipse.papyrus.sysml.nattable.requirement.tests,org.eclipse.papyrus.sysml.tests,org.eclipse.papyrus.tests,org.eclipse.papyrus.uml.decoratormodel.controlmode.tests,org.eclipse.papyrus.uml.decoratormodel.tests,org.eclipse.papyrus.uml.diagram.activity.tests,org.eclipse.papyrus.uml.diagram.clazz.tests,org.eclipse.papyrus.uml.diagram.common.tests,org.eclipse.papyrus.uml.diagram.communication.tests,org.eclipse.papyrus.uml.diagram.component.tests,org.eclipse.papyrus.uml.diagram.composite.tests,org.eclipse.papyrus.uml.diagram.deployment.tests,org.eclipse.papyrus.uml.diagram.dnd.tests,org.eclipse.papyrus.uml.diagram.interactionoverview.tests,org.eclipse.papyrus.uml.diagram.profile.tests,org.eclipse.papyrus.uml.diagram.sequence.tests,org.eclipse.papyrus.uml.diagram.statemachine.tests,org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests,org.eclipse.papyrus.uml.diagram.tests,org.eclipse.papyrus.uml.diagram.timing.tests,org.eclipse.papyrus.uml.diagram.usecase.tests,org.eclipse.papyrus.uml.diagram.wizards.tests,org.eclipse.papyrus.uml.modelexplorer.tests,org.eclipse.papyrus.uml.nattable.generic.tests,org.eclipse.papyrus.uml.nattable.tests,org.eclipse.papyrus.uml.textedit.parameter.tests,org.eclipse.papyrus.uml.textedit.port.tests,org.eclipse.papyrus.uml.textedit.property.tests,org.eclipse.papyrus.uml.textedit.tests,org.eclipse.papyrus.uml.tools.tests,org.eclipse.papyrus.uml.tools.utils.tests,org.eclipse.papyrus.views.modelexplorer.tests"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/tests/AllTests.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<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.MAIN_TYPE" value="org.eclipse.papyrus.infra.gmfdiag.menu.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.menu.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.platform.ide"/> +<booleanAttribute key="run_in_ui_thread" value="true"/> +<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu@default:default,javax.annotation@default:default,javax.inject@default:default,javax.servlet@default:default,javax.xml@default:default,lpg.runtime.java@default:default,org.antlr.runtime@default:default,org.apache.ant@default:default,org.apache.batik.bridge@default:default,org.apache.batik.css*1.6.0.v201011041432@default:default,org.apache.batik.css*1.7.0.v201011041433@default:default,org.apache.batik.dom.svg@default:default,org.apache.batik.dom@default:default,org.apache.batik.ext.awt@default:default,org.apache.batik.parser@default:default,org.apache.batik.pdf@default:default,org.apache.batik.svggen@default:default,org.apache.batik.transcoder@default:default,org.apache.batik.util*1.6.0.v201011041432@default:default,org.apache.batik.util*1.7.0.v201011041433@default:default,org.apache.batik.util.gui*1.6.0.v201011041432@default:default,org.apache.batik.util.gui*1.7.0.v200903091627@default:default,org.apache.batik.xml@default:default,org.apache.commons.cli@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.eclipse.acceleo.common@default:default,org.eclipse.acceleo.engine@default:default,org.eclipse.acceleo.model@default:default,org.eclipse.acceleo.profiler@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.launching@default:default,org.eclipse.ant.ui@default:default,org.eclipse.compare.core@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.java7@default:false,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.converter@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.emf.importer@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.emf.mwe.core@default:default,org.eclipse.emf.mwe.utils@default:default,org.eclipse.emf.mwe2.language@default:default,org.eclipse.emf.mwe2.launch@default:default,org.eclipse.emf.mwe2.lib@default:default,org.eclipse.emf.mwe2.runtime@default:default,org.eclipse.emf.transaction.ui@default:default,org.eclipse.emf.transaction@default:default,org.eclipse.emf.validation.ocl@default:default,org.eclipse.emf.validation.ui@default:default,org.eclipse.emf.validation@default:default,org.eclipse.emf.workspace.ui@default:default,org.eclipse.emf.workspace@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.gef@default:default,org.eclipse.gmf.bridge.trace@default:default,org.eclipse.gmf.bridge.ui.dashboard@default:default,org.eclipse.gmf.bridge.ui@default:default,org.eclipse.gmf.bridge@default:default,org.eclipse.gmf.codegen.edit@default:default,org.eclipse.gmf.codegen.ui@default:default,org.eclipse.gmf.codegen.xtend.ui@default:default,org.eclipse.gmf.codegen.xtend@default:default,org.eclipse.gmf.common@default:default,org.eclipse.gmf.graphdef.codegen.ui@default:default,org.eclipse.gmf.graphdef.codegen@default:default,org.eclipse.gmf.graphdef.edit@default:default,org.eclipse.gmf.graphdef@default:default,org.eclipse.gmf.map.edit@default:default,org.eclipse.gmf.map@default:default,org.eclipse.gmf.runtime.common.core@default:default,org.eclipse.gmf.runtime.common.ui.action.ide@default:default,org.eclipse.gmf.runtime.common.ui.action@default:default,org.eclipse.gmf.runtime.common.ui.printing@default:default,org.eclipse.gmf.runtime.common.ui.services.action@default:default,org.eclipse.gmf.runtime.common.ui.services.properties@default:default,org.eclipse.gmf.runtime.common.ui.services@default:default,org.eclipse.gmf.runtime.common.ui@default:default,org.eclipse.gmf.runtime.diagram.core@default:default,org.eclipse.gmf.runtime.diagram.ui.actions@default:default,org.eclipse.gmf.runtime.diagram.ui.printing.render@default:default,org.eclipse.gmf.runtime.diagram.ui.printing@default:default,org.eclipse.gmf.runtime.diagram.ui.properties@default:default,org.eclipse.gmf.runtime.diagram.ui.providers.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.providers@default:default,org.eclipse.gmf.runtime.diagram.ui.render@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor@default:default,org.eclipse.gmf.runtime.diagram.ui@default:default,org.eclipse.gmf.runtime.draw2d.ui.render.awt@default:default,org.eclipse.gmf.runtime.draw2d.ui.render@default:default,org.eclipse.gmf.runtime.draw2d.ui@default:default,org.eclipse.gmf.runtime.emf.clipboard.core@default:default,org.eclipse.gmf.runtime.emf.commands.core@default:default,org.eclipse.gmf.runtime.emf.core@default:default,org.eclipse.gmf.runtime.emf.type.core@default:default,org.eclipse.gmf.runtime.emf.ui.properties@default:default,org.eclipse.gmf.runtime.emf.ui@default:default,org.eclipse.gmf.runtime.gef.ui@default:default,org.eclipse.gmf.runtime.notation.edit@default:default,org.eclipse.gmf.runtime.notation@default:default,org.eclipse.gmf.tooldef.edit@default:default,org.eclipse.gmf.tooldef@default:default,org.eclipse.gmf.tooling.runtime@default:default,org.eclipse.gmf.validate@default:default,org.eclipse.gmf.xpand.qvtlibrary@default:default,org.eclipse.gmf.xpand@default:default,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit4.runtime@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.m2m.qvt.oml.common@default:default,org.eclipse.m2m.qvt.oml.cst.parser@default:default,org.eclipse.m2m.qvt.oml.ecore.imperativeocl@default:default,org.eclipse.m2m.qvt.oml.emf.util@default:default,org.eclipse.m2m.qvt.oml.project@default:default,org.eclipse.m2m.qvt.oml.runtime@default:default,org.eclipse.m2m.qvt.oml@default:default,org.eclipse.nebula.widgets.nattable.core@default:default,org.eclipse.ocl.common.ui@default:default,org.eclipse.ocl.common@default:default,org.eclipse.ocl.ecore@default:default,org.eclipse.ocl.examples.common@default:default,org.eclipse.ocl.examples.debug.vm@default:default,org.eclipse.ocl.examples.debug@default:default,org.eclipse.ocl.examples.domain@default:default,org.eclipse.ocl.examples.emf.validation.validity.ui@default:default,org.eclipse.ocl.examples.emf.validation.validity@default:default,org.eclipse.ocl.examples.library@default:default,org.eclipse.ocl.examples.pivot@default:default,org.eclipse.ocl.examples.ui@default:default,org.eclipse.ocl.examples.xtext.base.ui@default:default,org.eclipse.ocl.examples.xtext.base@default:default,org.eclipse.ocl.examples.xtext.completeocl@default:default,org.eclipse.ocl.examples.xtext.console@default:default,org.eclipse.ocl.examples.xtext.essentialocl.ui@default:default,org.eclipse.ocl.examples.xtext.essentialocl@default:default,org.eclipse.ocl.examples.xtext.markup.ui@default:default,org.eclipse.ocl.examples.xtext.markup@default:default,org.eclipse.ocl.examples.xtext.oclinecore@default:default,org.eclipse.ocl.examples.xtext.oclstdlib@default:default,org.eclipse.ocl@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.pde.build@default:default,org.eclipse.pde.core@default:default,org.eclipse.pde.launching@default:default,org.eclipse.pde.ui@default:default,org.eclipse.pde@default:default,org.eclipse.platform@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.uml2.codegen.ecore@default:default,org.eclipse.uml2.common.edit@default:default,org.eclipse.uml2.common@default:default,org.eclipse.uml2.types@default:default,org.eclipse.uml2.uml.edit@default:default,org.eclipse.uml2.uml.editor@default:default,org.eclipse.uml2.uml.profile.standard@default:default,org.eclipse.uml2.uml.resources@default:default,org.eclipse.uml2.uml.validation@default:default,org.eclipse.uml2.uml@default:default,org.eclipse.update.configurator@3:true,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.xpand@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtend.typesystem.emf@default:default,org.eclipse.xtend@default:default,org.eclipse.xtext.builder@default:default,org.eclipse.xtext.common.types.edit@default:default,org.eclipse.xtext.common.types.ui@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.ecore@default:default,org.eclipse.xtext.generator@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.ui.codetemplates.ui@default:default,org.eclipse.xtext.ui.codetemplates@default:default,org.eclipse.xtext.ui.shared@default:default,org.eclipse.xtext.ui@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/> +<stringAttribute key="selected_workspace_plugins" value="org.eclipse.gmf.codegen@default:default,org.eclipse.papyrus.cdo.ui.doc@default:default,org.eclipse.papyrus.codegen@default:default,org.eclipse.papyrus.copypaste.ui.doc@default:default,org.eclipse.papyrus.customization.extendedtypes.emf@default:default,org.eclipse.papyrus.customization.extendedtypes.uml@default:default,org.eclipse.papyrus.customization.extendedtypes@default:default,org.eclipse.papyrus.customization.palette@default:default,org.eclipse.papyrus.customization.paletteconfiguration@default:default,org.eclipse.papyrus.customization.properties.generation@default:default,org.eclipse.papyrus.customization.properties.model.xwt@default:default,org.eclipse.papyrus.customization.properties@default:default,org.eclipse.papyrus.customization@default:default,org.eclipse.papyrus.def@default:default,org.eclipse.papyrus.dev.java.utils@default:default,org.eclipse.papyrus.developer.profile@default:default,org.eclipse.papyrus.doc@default:default,org.eclipse.papyrus.documentation.plugin.edit@default:default,org.eclipse.papyrus.documentation.plugin.editor@default:default,org.eclipse.papyrus.documentation.plugin@default:default,org.eclipse.papyrus.domaincodegen.ui@default:default,org.eclipse.papyrus.domaincontextcodegen.edit@default:default,org.eclipse.papyrus.domaincontextcodegen.editor@default:default,org.eclipse.papyrus.domaincontextcodegen@default:default,org.eclipse.papyrus.dsml.validation.doc@default:default,org.eclipse.papyrus.eclipse.project.editors@default:default,org.eclipse.papyrus.editor.perspectiveconfiguration@default:default,org.eclipse.papyrus.editor@default:default,org.eclipse.papyrus.emf.commandstack@default:default,org.eclipse.papyrus.emf.facet.common.core@default:default,org.eclipse.papyrus.emf.facet.common.sdk.core@default:default,org.eclipse.papyrus.emf.facet.common.ui@default:default,org.eclipse.papyrus.emf.facet.custom.core@default:default,org.eclipse.papyrus.emf.facet.custom.doc@default:default,org.eclipse.papyrus.emf.facet.custom.metamodel.edit@default:default,org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc@default:default,org.eclipse.papyrus.emf.facet.custom.metamodel.editor@default:default,org.eclipse.papyrus.emf.facet.custom.metamodel@default:default,org.eclipse.papyrus.emf.facet.custom.sdk.core@default:default,org.eclipse.papyrus.emf.facet.custom.sdk.ui@default:default,org.eclipse.papyrus.emf.facet.custom.ui@default:default,org.eclipse.papyrus.emf.facet.doc@default:default,org.eclipse.papyrus.emf.facet.efacet.catalog@default:default,org.eclipse.papyrus.emf.facet.efacet.core@default:default,org.eclipse.papyrus.emf.facet.efacet.edit@default:default,org.eclipse.papyrus.emf.facet.efacet.editor@default:default,org.eclipse.papyrus.emf.facet.efacet.metamodel.edit@default:default,org.eclipse.papyrus.emf.facet.efacet.metamodel@default:default,org.eclipse.papyrus.emf.facet.efacet.sdk.ui@default:default,org.eclipse.papyrus.emf.facet.efacet.ui@default:default,org.eclipse.papyrus.emf.facet.efacet@default:default,org.eclipse.papyrus.emf.facet.query.java.core@default:default,org.eclipse.papyrus.emf.facet.query.java.metamodel@default:default,org.eclipse.papyrus.emf.facet.query.java.sdk.ui@default:default,org.eclipse.papyrus.emf.facet.query.java@default:default,org.eclipse.papyrus.emf.facet.query.ocl.core@default:default,org.eclipse.papyrus.emf.facet.query.ocl.metamodel@default:default,org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui@default:default,org.eclipse.papyrus.emf.facet.util.core@default:default,org.eclipse.papyrus.emf.facet.util.emf.catalog@default:default,org.eclipse.papyrus.emf.facet.util.emf.core@default:default,org.eclipse.papyrus.emf.facet.util.emf.ui@default:default,org.eclipse.papyrus.emf.facet.util.jface.ui@default:default,org.eclipse.papyrus.emf.facet.util.pde.core@default:default,org.eclipse.papyrus.emf.facet.util.swt@default:default,org.eclipse.papyrus.emf.facet.util.ui@default:default,org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore@default:default,org.eclipse.papyrus.emf.facet.widgets.celleditors@default:default,org.eclipse.papyrus.emf.facet.widgets@default:default,org.eclipse.papyrus.extensionpoints.editors@default:default,org.eclipse.papyrus.gmf.editpartview@default:default,org.eclipse.papyrus.gmf.editpoliciesstates@default:default,org.eclipse.papyrus.gmf.figureview@default:default,org.eclipse.papyrus.gmfgenextension@default:default,org.eclipse.papyrus.infra.constraints.edit@default:default,org.eclipse.papyrus.infra.constraints.editor@default:default,org.eclipse.papyrus.infra.constraints@default:default,org.eclipse.papyrus.infra.core.log@default:default,org.eclipse.papyrus.infra.core.pluginexplorer@default:default,org.eclipse.papyrus.infra.core.sasheditor.di.tests@default:false,org.eclipse.papyrus.infra.core.sasheditor.di@default:default,org.eclipse.papyrus.infra.core.sasheditor.tests@default:false,org.eclipse.papyrus.infra.core.sasheditor@default:default,org.eclipse.papyrus.infra.core.serviceregistry.edit@default:default,org.eclipse.papyrus.infra.core.serviceregistry.editor@default:default,org.eclipse.papyrus.infra.core.serviceregistry.tests@default:false,org.eclipse.papyrus.infra.core.serviceregistry@default:default,org.eclipse.papyrus.infra.core.tests@default:false,org.eclipse.papyrus.infra.core@default:default,org.eclipse.papyrus.infra.discovery.ui.menu@default:default,org.eclipse.papyrus.infra.discovery.ui@default:default,org.eclipse.papyrus.infra.discovery@default:default,org.eclipse.papyrus.infra.doc@default:default,org.eclipse.papyrus.infra.emf.appearance@default:default,org.eclipse.papyrus.infra.emf.diagram.common@default:default,org.eclipse.papyrus.infra.emf.nattable@default:default,org.eclipse.papyrus.infra.emf.newchild@default:default,org.eclipse.papyrus.infra.emf.readonly.tests@default:false,org.eclipse.papyrus.infra.emf.readonly@default:default,org.eclipse.papyrus.infra.emf.tests@default:false,org.eclipse.papyrus.infra.emf@default:default,org.eclipse.papyrus.infra.extendedtypes.edit@default:default,org.eclipse.papyrus.infra.extendedtypes.editor@default:default,org.eclipse.papyrus.infra.extendedtypes.emf@default:default,org.eclipse.papyrus.infra.extendedtypes@default:default,org.eclipse.papyrus.infra.gmfdiag.commands.tests@default:false,org.eclipse.papyrus.infra.gmfdiag.commands@default:default,org.eclipse.papyrus.infra.gmfdiag.common.doc@default:default,org.eclipse.papyrus.infra.gmfdiag.common.tests@default:false,org.eclipse.papyrus.infra.gmfdiag.common@default:default,org.eclipse.papyrus.infra.gmfdiag.controlmode@default:default,org.eclipse.papyrus.infra.gmfdiag.css.configuration@default:default,org.eclipse.papyrus.infra.gmfdiag.css.debug@default:default,org.eclipse.papyrus.infra.gmfdiag.css.doc@default:default,org.eclipse.papyrus.infra.gmfdiag.css.model@default:default,org.eclipse.papyrus.infra.gmfdiag.css.palette@default:default,org.eclipse.papyrus.infra.gmfdiag.css.properties@default:default,org.eclipse.papyrus.infra.gmfdiag.css.theme@default:default,org.eclipse.papyrus.infra.gmfdiag.css.xtext.ui@default:default,org.eclipse.papyrus.infra.gmfdiag.css.xtext@default:default,org.eclipse.papyrus.infra.gmfdiag.css@default:default,org.eclipse.papyrus.infra.gmfdiag.dnd@default:default,org.eclipse.papyrus.infra.gmfdiag.export@default:default,org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter@default:default,org.eclipse.papyrus.infra.gmfdiag.hyperlink@default:default,org.eclipse.papyrus.infra.gmfdiag.menu.tests@default:default,org.eclipse.papyrus.infra.gmfdiag.menu@default:default,org.eclipse.papyrus.infra.gmfdiag.modelexplorer@default:default,org.eclipse.papyrus.infra.gmfdiag.navigation@default:default,org.eclipse.papyrus.infra.gmfdiag.outline@default:default,org.eclipse.papyrus.infra.gmfdiag.preferences@default:default,org.eclipse.papyrus.infra.gmfdiag.properties@default:default,org.eclipse.papyrus.infra.gmfdiag.viewersearcher@default:default,org.eclipse.papyrus.infra.gmfdiag.widgets@default:default,org.eclipse.papyrus.infra.hyperlink@default:default,org.eclipse.papyrus.infra.nattable.common@default:default,org.eclipse.papyrus.infra.nattable.controlmode@default:default,org.eclipse.papyrus.infra.nattable.doc@default:default,org.eclipse.papyrus.infra.nattable.model.edit@default:default,org.eclipse.papyrus.infra.nattable.model.editor@default:default,org.eclipse.papyrus.infra.nattable.model@default:default,org.eclipse.papyrus.infra.nattable.modelexplorer@default:default,org.eclipse.papyrus.infra.nattable.properties@default:default,org.eclipse.papyrus.infra.nattable.views.config@default:default,org.eclipse.papyrus.infra.nattable.views.editor@default:default,org.eclipse.papyrus.infra.nattable@default:default,org.eclipse.papyrus.infra.newchild.doc@default:default,org.eclipse.papyrus.infra.newchild.edit@default:default,org.eclipse.papyrus.infra.newchild.editor@default:default,org.eclipse.papyrus.infra.newchild@default:default,org.eclipse.papyrus.infra.onefile@default:default,org.eclipse.papyrus.infra.psf@default:default,org.eclipse.papyrus.infra.services.controlmode.doc@default:default,org.eclipse.papyrus.infra.services.controlmode.history@default:default,org.eclipse.papyrus.infra.services.controlmode@default:default,org.eclipse.papyrus.infra.services.decoration@default:default,org.eclipse.papyrus.infra.services.edit.tests@default:false,org.eclipse.papyrus.infra.services.edit@default:default,org.eclipse.papyrus.infra.services.labelprovider@default:default,org.eclipse.papyrus.infra.services.localizer@default:default,org.eclipse.papyrus.infra.services.markerlistener@default:default,org.eclipse.papyrus.infra.services.navigation@default:default,org.eclipse.papyrus.infra.services.openelement@default:default,org.eclipse.papyrus.infra.services.resourceloading.preferences@default:default,org.eclipse.papyrus.infra.services.resourceloading.tests@default:false,org.eclipse.papyrus.infra.services.resourceloading@default:default,org.eclipse.papyrus.infra.services.semantic@default:default,org.eclipse.papyrus.infra.services.validation@default:default,org.eclipse.papyrus.infra.services.viewersearch@default:default,org.eclipse.papyrus.infra.services.viewlabelprovider@default:default,org.eclipse.papyrus.infra.tools@default:default,org.eclipse.papyrus.infra.ui.resources@default:default,org.eclipse.papyrus.infra.viewpoints.configuration.edit@default:default,org.eclipse.papyrus.infra.viewpoints.configuration.editor@default:default,org.eclipse.papyrus.infra.viewpoints.configuration@default:default,org.eclipse.papyrus.infra.viewpoints.doc@default:default,org.eclipse.papyrus.infra.viewpoints.iso42010.edit@default:default,org.eclipse.papyrus.infra.viewpoints.iso42010@default:default,org.eclipse.papyrus.infra.viewpoints.policy@default:default,org.eclipse.papyrus.infra.viewpoints.preferences@default:default,org.eclipse.papyrus.infra.widgets.toolbox@default:default,org.eclipse.papyrus.infra.widgets@default:default,org.eclipse.papyrus.junit.framework@default:default,org.eclipse.papyrus.junit.utils@default:default,org.eclipse.papyrus.layers.documentation@default:default,org.eclipse.papyrus.moka.doc@default:default,org.eclipse.papyrus.mwe2.utils@default:default,org.eclipse.papyrus.sysml.diagram.blockdefinition.tests@default:false,org.eclipse.papyrus.sysml.diagram.blockdefinition@default:default,org.eclipse.papyrus.sysml.diagram.common@default:default,org.eclipse.papyrus.sysml.diagram.css@default:default,org.eclipse.papyrus.sysml.diagram.internalblock.tests@default:false,org.eclipse.papyrus.sysml.diagram.internalblock@default:default,org.eclipse.papyrus.sysml.diagram.parametric.tests@default:false,org.eclipse.papyrus.sysml.diagram.parametric@default:default,org.eclipse.papyrus.sysml.diagram.requirement@default:default,org.eclipse.papyrus.sysml.diagram.ui@default:default,org.eclipse.papyrus.sysml.edit@default:default,org.eclipse.papyrus.sysml.modelexplorer@default:default,org.eclipse.papyrus.sysml.nattable.allocation.config@default:default,org.eclipse.papyrus.sysml.nattable.allocation@default:default,org.eclipse.papyrus.sysml.nattable.menu@default:default,org.eclipse.papyrus.sysml.nattable.requirement.config@default:default,org.eclipse.papyrus.sysml.nattable.requirement@default:default,org.eclipse.papyrus.sysml.nattable@default:default,org.eclipse.papyrus.sysml.properties@default:default,org.eclipse.papyrus.sysml.service.types.tests@default:false,org.eclipse.papyrus.sysml.service.types@default:default,org.eclipse.papyrus.sysml@default:default,org.eclipse.papyrus.uml.alf.common.ui@default:default,org.eclipse.papyrus.uml.alf.common@default:default,org.eclipse.papyrus.uml.alf.ui@default:default,org.eclipse.papyrus.uml.alf@default:default,org.eclipse.papyrus.uml.appearance@default:default,org.eclipse.papyrus.uml.commands@default:default,org.eclipse.papyrus.uml.controlmode.profile@default:default,org.eclipse.papyrus.uml.decoratormodel.controlmode@default:default,org.eclipse.papyrus.uml.decoratormodel.doc@default:default,org.eclipse.papyrus.uml.decoratormodel.properties@default:default,org.eclipse.papyrus.uml.decoratormodel.ui@default:default,org.eclipse.papyrus.uml.decoratormodel@default:default,org.eclipse.papyrus.uml.developer.mde@default:default,org.eclipse.papyrus.uml.diagram.activity@default:default,org.eclipse.papyrus.uml.diagram.clazz@default:default,org.eclipse.papyrus.uml.diagram.common.doc@default:default,org.eclipse.papyrus.uml.diagram.common.groups@default:default,org.eclipse.papyrus.uml.diagram.common.palette.customaction@default:default,org.eclipse.papyrus.uml.diagram.common@default:default,org.eclipse.papyrus.uml.diagram.communication@default:default,org.eclipse.papyrus.uml.diagram.component@default:default,org.eclipse.papyrus.uml.diagram.composite@default:default,org.eclipse.papyrus.uml.diagram.css@default:default,org.eclipse.papyrus.uml.diagram.deployment@default:default,org.eclipse.papyrus.uml.diagram.dnd@default:default,org.eclipse.papyrus.uml.diagram.emftree@default:default,org.eclipse.papyrus.uml.diagram.icons@default:default,org.eclipse.papyrus.uml.diagram.interactionoverview@default:default,org.eclipse.papyrus.uml.diagram.menu@default:default,org.eclipse.papyrus.uml.diagram.modelexplorer@default:default,org.eclipse.papyrus.uml.diagram.navigation@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration@default:default,org.eclipse.papyrus.uml.diagram.profile.doc@default:default,org.eclipse.papyrus.uml.diagram.profile@default:default,org.eclipse.papyrus.uml.diagram.sequence@default:default,org.eclipse.papyrus.uml.diagram.statemachine@default:default,org.eclipse.papyrus.uml.diagram.stereotype.edition@default:default,org.eclipse.papyrus.uml.diagram.symbols.properties@default:default,org.eclipse.papyrus.uml.diagram.symbols@default:default,org.eclipse.papyrus.uml.diagram.synchronizeview.test@default:default,org.eclipse.papyrus.uml.diagram.synchronizeview@default:default,org.eclipse.papyrus.uml.diagram.timing@default:default,org.eclipse.papyrus.uml.diagram.usecase@default:default,org.eclipse.papyrus.uml.diagram.wizards@default:default,org.eclipse.papyrus.uml.doc@default:default,org.eclipse.papyrus.uml.documentation.profile@default:default,org.eclipse.papyrus.uml.extensionpoints@default:default,org.eclipse.papyrus.uml.icons@default:default,org.eclipse.papyrus.uml.import@default:default,org.eclipse.papyrus.uml.modelexplorer.widgets@default:default,org.eclipse.papyrus.uml.modelexplorer@default:default,org.eclipse.papyrus.uml.modelrepair.tests@default:false,org.eclipse.papyrus.uml.modelrepair@default:default,org.eclipse.papyrus.uml.nattable.generic.config@default:default,org.eclipse.papyrus.uml.nattable.generic@default:default,org.eclipse.papyrus.uml.nattable.menu@default:default,org.eclipse.papyrus.uml.nattable.xtext.integration@default:default,org.eclipse.papyrus.uml.nattable@default:default,org.eclipse.papyrus.uml.navigation@default:default,org.eclipse.papyrus.uml.oclconstraintevaluation@default:default,org.eclipse.papyrus.uml.perspective@default:default,org.eclipse.papyrus.uml.profile@default:default,org.eclipse.papyrus.uml.properties.xtext@default:default,org.eclipse.papyrus.uml.properties@default:default,org.eclipse.papyrus.uml.resourceloading.profile@default:default,org.eclipse.papyrus.uml.search.ui.doc@default:default,org.eclipse.papyrus.uml.search.ui@default:default,org.eclipse.papyrus.uml.service.types.tests@default:false,org.eclipse.papyrus.uml.service.types@default:default,org.eclipse.papyrus.uml.service.validation@default:default,org.eclipse.papyrus.uml.services.decoration@default:default,org.eclipse.papyrus.uml.templaterepository@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext@default:default,org.eclipse.papyrus.uml.textedit.common.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.common.xtext@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext@default:default,org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext@default:default,org.eclipse.papyrus.uml.textedit.javaconstraint@default:default,org.eclipse.papyrus.uml.textedit.message.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.message.xtext@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext@default:default,org.eclipse.papyrus.uml.textedit.port.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.port.xtext@default:default,org.eclipse.papyrus.uml.textedit.property.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.property.xtext@default:default,org.eclipse.papyrus.uml.textedit.state.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.state.xtext@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext@default:default,org.eclipse.papyrus.uml.tools.extendedtypes@default:default,org.eclipse.papyrus.uml.tools.utils@default:default,org.eclipse.papyrus.uml.tools@default:default,org.eclipse.papyrus.uml.ui.perspectiveconfiguration@default:default,org.eclipse.papyrus.uml.xtext.integration.core@default:default,org.eclipse.papyrus.uml.xtext.integration.ui@default:default,org.eclipse.papyrus.uml.xtext.integration.validation@default:default,org.eclipse.papyrus.views.modelexplorer.newchild@default:default,org.eclipse.papyrus.views.modelexplorer.resourceloading@default:default,org.eclipse.papyrus.views.modelexplorer.widgets@default:default,org.eclipse.papyrus.views.modelexplorer@default:default,org.eclipse.papyrus.views.properties.doc@default:default,org.eclipse.papyrus.views.properties.model.edit@default:default,org.eclipse.papyrus.views.properties.model.editor@default:default,org.eclipse.papyrus.views.properties.model@default:default,org.eclipse.papyrus.views.properties@default:default,org.eclipse.papyrus.views.search@default:default,org.eclipse.papyrus.views.validation@default:default,org.eclipse.papyrus.xwt@default:default"/> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useCustomFeatures" value="false"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="false"/> +<booleanAttribute key="useProduct" value="true"/> +</launchConfiguration> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml new file mode 100644 index 00000000000..e0e2b9f0646 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../../../../../releng/top-pom-main-tests.xml</relativePath> + </parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra.gmfdiag.menu.tests</artifactId> + <version>1.1.0-SNAPSHOT</version> + <packaging>eclipse-test-plugin</packaging> +</project> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.di new file mode 100644 index 00000000000..fca755937b3 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.di @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi"> + <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> + <windows> + <children xsi:type="di:TabFolder"> + <children> + <emfPageIdentifier href="model.notation#_BwdpMG86EeSG_p8PAYDlLg"/> + </children> + <children> + <emfPageIdentifier href="model.notation#_-ZPccG8-EeSkzprKqshrgw"/> + </children> + </children> + </windows> + </sashModel> +</di:SashWindowsMngr> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.notation new file mode 100644 index 00000000000..8cd1edc6f7c --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.notation @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"> + <notation:Diagram xmi:id="_BwdpMG86EeSG_p8PAYDlLg" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_FUB2kG86EeSG_p8PAYDlLg" type="2007"> + <children xmi:type="notation:DecorationNode" xmi:id="_FUrW0G86EeSG_p8PAYDlLg" type="5026"/> + <children xmi:type="notation:DecorationNode" xmi:id="_FUr94G86EeSG_p8PAYDlLg" type="7016"> + <children xmi:type="notation:Shape" xmi:id="_P9U1UHYxEeSbgutMzIJcYw" type="2008"> + <children xmi:type="notation:DecorationNode" xmi:id="_P9WqgHYxEeSbgutMzIJcYw" type="5029"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_P9XRkHYxEeSbgutMzIJcYw" type="7017"> + <styles xmi:type="notation:TitleStyle" xmi:id="_P9XRkXYxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_P9XRknYxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_P9XRk3YxEeSbgutMzIJcYw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P9XRlHYxEeSbgutMzIJcYw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_P9XRlXYxEeSbgutMzIJcYw" type="7018"> + <styles xmi:type="notation:TitleStyle" xmi:id="_P9XRlnYxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_P9XRl3YxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_P9XRmHYxEeSbgutMzIJcYw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P9XRmXYxEeSbgutMzIJcYw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_P9X4oHYxEeSbgutMzIJcYw" type="7019"> + <styles xmi:type="notation:TitleStyle" xmi:id="_P9X4oXYxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_P9X4onYxEeSbgutMzIJcYw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_P9X4o3YxEeSbgutMzIJcYw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P9X4pHYxEeSbgutMzIJcYw"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_P65zcHYxEeSbgutMzIJcYw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P9U1UXYxEeSbgutMzIJcYw" x="89" y="30" width="129" height="87"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_FUr94W86EeSG_p8PAYDlLg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FUr94m86EeSG_p8PAYDlLg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_E9DVEHZNEeSk2da7f_MKTA" type="compartment_shape_display"> + <styles xmi:type="notation:TitleStyle" xmi:id="_E9DVEXZNEeSk2da7f_MKTA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_E9DVEnZNEeSk2da7f_MKTA"/> + </children> + <element xmi:type="uml:Package" href="model.uml#_FME0cG86EeSG_p8PAYDlLg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FUCdoG86EeSG_p8PAYDlLg" x="73" y="29" width="369" height="199"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_E21DMHZLEeS6zJCWmZdMOg" type="Note" fontName="Segoe UI" description="Text" transparency="0" lineColor="6737151" lineWidth="1"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_E21DNHZLEeS6zJCWmZdMOg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DNXZLEeS6zJCWmZdMOg" key="lineColor" value="true"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DNnZLEeS6zJCWmZdMOg" key="fontHeight" value="true"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DN3ZLEeS6zJCWmZdMOg" key="bold" value="true"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DOHZLEeS6zJCWmZdMOg" key="italic" value="true"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DOXZLEeS6zJCWmZdMOg" key="fontColor" value="true"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E21DOnZLEeS6zJCWmZdMOg" key="fillColor" value="true"/> + </eAnnotations> + <children xmi:type="notation:BasicDecorationNode" xmi:id="_E21DO3ZLEeS6zJCWmZdMOg" type="DiagramName"> + <element xsi:nil="true"/> + </children> + <children xmi:type="notation:BasicDecorationNode" xmi:id="_E21DPHZLEeS6zJCWmZdMOg" type="Description"> + <element xsi:nil="true"/> + </children> + <styles xmi:type="notation:TextStyle" xmi:id="_E21DMXZLEeS6zJCWmZdMOg"/> + <styles xmi:type="notation:LineTypeStyle" xmi:id="_E21DMnZLEeS6zJCWmZdMOg"/> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_E21DM3ZLEeS6zJCWmZdMOg" x="512" y="329"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_xN4dgHbVEeST0aHn3TAicw" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_xOHHAHbVEeST0aHn3TAicw" type="5005"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_xOHuEHbVEeST0aHn3TAicw" type="7002"> + <styles xmi:type="notation:TitleStyle" xmi:id="_xOHuEXbVEeST0aHn3TAicw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_xOHuEnbVEeST0aHn3TAicw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_xOHuE3bVEeST0aHn3TAicw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xOHuFHbVEeST0aHn3TAicw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_xOIVIHbVEeST0aHn3TAicw" type="7003"> + <styles xmi:type="notation:TitleStyle" xmi:id="_xOIVIXbVEeST0aHn3TAicw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_xOIVInbVEeST0aHn3TAicw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_xOIVI3bVEeST0aHn3TAicw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xOIVJHbVEeST0aHn3TAicw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_xOIVJXbVEeST0aHn3TAicw" type="7004"> + <styles xmi:type="notation:TitleStyle" xmi:id="_xOIVJnbVEeST0aHn3TAicw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_xOIVJ3bVEeST0aHn3TAicw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_xOIVKHbVEeST0aHn3TAicw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xOIVKXbVEeST0aHn3TAicw"/> + </children> + <element xmi:type="uml:Component" href="model.uml#_B6t_IG8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xN4dgXbVEeST0aHn3TAicw" x="498" y="71" width="232" height="159"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_fHft0Hb_EeSGV47xTootHw" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_fHuXUHb_EeSGV47xTootHw" type="5005"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_fHu-YHb_EeSGV47xTootHw" type="7002"> + <styles xmi:type="notation:TitleStyle" xmi:id="_fHu-YXb_EeSGV47xTootHw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_fHu-Ynb_EeSGV47xTootHw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_fHu-Y3b_EeSGV47xTootHw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fHu-ZHb_EeSGV47xTootHw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_fHvlcHb_EeSGV47xTootHw" type="7003"> + <styles xmi:type="notation:TitleStyle" xmi:id="_fHvlcXb_EeSGV47xTootHw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_fHvlcnb_EeSGV47xTootHw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_fHvlc3b_EeSGV47xTootHw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fHvldHb_EeSGV47xTootHw"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_fHvldXb_EeSGV47xTootHw" type="7004"> + <styles xmi:type="notation:TitleStyle" xmi:id="_fHvldnb_EeSGV47xTootHw"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_fHvld3b_EeSGV47xTootHw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_fHvleHb_EeSGV47xTootHw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fHvleXb_EeSGV47xTootHw"/> + </children> + <element xmi:type="uml:Component" href="model.uml#_fFdtgHb_EeSGV47xTootHw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fHft0Xb_EeSGV47xTootHw" x="149" y="300" width="210" height="133"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_5sP4QHoHEeSPf9bmYWALSA" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_5sSUgHoHEeSPf9bmYWALSA" type="5005"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_5sS7kHoHEeSPf9bmYWALSA" type="7002"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5sS7kXoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5sTioHoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5sTioXoHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5sTionoHEeSPf9bmYWALSA"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_5sTio3oHEeSPf9bmYWALSA" type="7003"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5sTipHoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5sTipXoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5sTipnoHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5sTip3oHEeSPf9bmYWALSA"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_5sUJsHoHEeSPf9bmYWALSA" type="7004"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5sUJsXoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5sUJsnoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5sUJs3oHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5sUJtHoHEeSPf9bmYWALSA"/> + </children> + <element xmi:type="uml:Component" href="model.uml#__SZSAG8-EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5sP4QXoHEeSPf9bmYWALSA" x="908" y="271"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_5sl2gHoHEeSPf9bmYWALSA" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_5smdkHoHEeSPf9bmYWALSA" type="5005"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_5smdkXoHEeSPf9bmYWALSA" type="7002"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5smdknoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5smdk3oHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5smdlHoHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5smdlXoHEeSPf9bmYWALSA"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_5smdlnoHEeSPf9bmYWALSA" type="7003"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5smdl3oHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5smdmHoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5smdmXoHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5smdmnoHEeSPf9bmYWALSA"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_5snEoHoHEeSPf9bmYWALSA" type="7004"> + <styles xmi:type="notation:TitleStyle" xmi:id="_5snEoXoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_5snEonoHEeSPf9bmYWALSA"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_5snEo3oHEeSPf9bmYWALSA"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5snEpHoHEeSPf9bmYWALSA"/> + </children> + <element xmi:type="uml:Component" href="model.uml#_FW6ZMG8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5sl2gXoHEeSPf9bmYWALSA" x="1014" y="81"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_BwdpMW86EeSG_p8PAYDlLg" name="diagram_compatibility_version" stringValue="1.0.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_BwdpMm86EeSG_p8PAYDlLg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_BwdpM286EeSG_p8PAYDlLg"> + <owner xmi:type="uml:Model" href="model.uml#_BnBZUG86EeSG_p8PAYDlLg"/> + </styles> + <element xmi:type="uml:Model" href="model.uml#_BnBZUG86EeSG_p8PAYDlLg"/> + <edges xmi:type="notation:Connector" xmi:id="_5tiRsHoHEeSPf9bmYWALSA" type="4008" source="_5sl2gHoHEeSPf9bmYWALSA" target="_5sP4QHoHEeSPf9bmYWALSA"> + <children xmi:type="notation:DecorationNode" xmi:id="_5ti4wHoHEeSPf9bmYWALSA" type="6026"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_5ti4wXoHEeSPf9bmYWALSA" y="40"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_5ti4wnoHEeSPf9bmYWALSA" type="6027"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_5tjf0HoHEeSPf9bmYWALSA" y="60"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_5tiRsXoHEeSPf9bmYWALSA"/> + <element xmi:type="uml:Dependency" href="model.uml#_HiwlsG8_EeSkzprKqshrgw"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_5tiRsnoHEeSPf9bmYWALSA" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6dkngHoHEeSPf9bmYWALSA" id="(0.2,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6dl1oHoHEeSPf9bmYWALSA" id="(0.79,0.0)"/> + </edges> + </notation:Diagram> + <notation:Diagram xmi:id="_-ZPccG8-EeSkzprKqshrgw" type="PapyrusUMLComponentDiagram" name="NewComponentDiagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="__dqG0G8-EeSkzprKqshrgw" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="__duYQG8-EeSkzprKqshrgw" type="5004"/> + <children xmi:type="notation:BasicCompartment" xmi:id="__du_UG8-EeSkzprKqshrgw" type="7001"> + <styles xmi:type="notation:TitleStyle" xmi:id="__du_UW8-EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__du_Um8-EeSkzprKqshrgw"/> + </children> + <element xmi:type="uml:Component" href="model.uml#__SZSAG8-EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__dqG0W8-EeSkzprKqshrgw" x="211" y="127" width="166" height="139"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_B64-QG8_EeSkzprKqshrgw" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_B66zcG8_EeSkzprKqshrgw" type="5004"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_B67agG8_EeSkzprKqshrgw" type="7001"> + <styles xmi:type="notation:TitleStyle" xmi:id="_B67agW8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_B67agm8_EeSkzprKqshrgw"/> + </children> + <element xmi:type="uml:Component" href="model.uml#_B6t_IG8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_B64-QW8_EeSkzprKqshrgw" x="547" y="164" width="162" height="123"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_FXBt8G8_EeSkzprKqshrgw" type="2002"> + <children xmi:type="notation:DecorationNode" xmi:id="_FXC8EG8_EeSkzprKqshrgw" type="5004"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_FXDjIG8_EeSkzprKqshrgw" type="7001"> + <styles xmi:type="notation:TitleStyle" xmi:id="_FXDjIW8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FXDjIm8_EeSkzprKqshrgw"/> + </children> + <element xmi:type="uml:Component" href="model.uml#_FW6ZMG8_EeSkzprKqshrgw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FXBt8W8_EeSkzprKqshrgw" x="459" y="403" width="186" height="133"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_-ZPccW8-EeSkzprKqshrgw" name="diagram_compatibility_version" stringValue="1.0.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_-ZPccm8-EeSkzprKqshrgw"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_-ZPcc28-EeSkzprKqshrgw"> + <owner xmi:type="uml:Model" href="model.uml#_BnBZUG86EeSG_p8PAYDlLg"/> + </styles> + <element xmi:type="uml:Model" href="model.uml#_BnBZUG86EeSG_p8PAYDlLg"/> + <edges xmi:type="notation:Connector" xmi:id="_HlLAgG8_EeSkzprKqshrgw" type="4010" source="_FXBt8G8_EeSkzprKqshrgw" target="__dqG0G8-EeSkzprKqshrgw"> + <children xmi:type="notation:DecorationNode" xmi:id="_HlNcwG8_EeSkzprKqshrgw" type="6009"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_HlOD0G8_EeSkzprKqshrgw" y="60"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_HlPR8G8_EeSkzprKqshrgw" type="6023"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_HlP5AG8_EeSkzprKqshrgw" y="60"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_HlLnkG8_EeSkzprKqshrgw"/> + <element xmi:type="uml:Dependency" href="model.uml#_HiwlsG8_EeSkzprKqshrgw"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_HlLnkW8_EeSkzprKqshrgw" points="[-17, -16, 170, 161]$[-170, -153, 17, 24]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_HqXpkG8_EeSkzprKqshrgw" id="(0.2956989247311828,0.12030075187969924)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_HqYQoG8_EeSkzprKqshrgw" id="(0.6987951807228916,0.8273381294964028)"/> + </edges> + </notation:Diagram> + <css:ModelStyleSheets xmi:id="_0hVSkHoHEeSPf9bmYWALSA"/> +</xmi:XMI> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.uml new file mode 100644 index 00000000000..d57a164a9cc --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/resources/deleteActionUtil/model.uml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_BnBZUG86EeSG_p8PAYDlLg" name="model"> + <packagedElement xmi:type="uml:Package" xmi:id="_FME0cG86EeSG_p8PAYDlLg" name="Package1"> + <packagedElement xmi:type="uml:Class" xmi:id="_P65zcHYxEeSbgutMzIJcYw" name="Class1"/> + </packagedElement> + <packagedElement xmi:type="uml:Component" xmi:id="__SZSAG8-EeSkzprKqshrgw" name="Component0"/> + <packagedElement xmi:type="uml:Component" xmi:id="_B6t_IG8_EeSkzprKqshrgw" name="Component1"/> + <packagedElement xmi:type="uml:Component" xmi:id="_FW6ZMG8_EeSkzprKqshrgw" name="Component2"/> + <packagedElement xmi:type="uml:Dependency" xmi:id="_HiwlsG8_EeSkzprKqshrgw" name="Connection" client="_FW6ZMG8_EeSkzprKqshrgw" supplier="__SZSAG8-EeSkzprKqshrgw"/> +</uml:Model> diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/Activator.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/Activator.java new file mode 100644 index 00000000000..05721610400 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/Activator.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.infra.gmfdiag.menu.tests; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/tests/AllTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/tests/AllTests.java new file mode 100644 index 00000000000..a3796ad39b7 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/tests/tests/AllTests.java @@ -0,0 +1,23 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.menu.tests.tests; + +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtilTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +@SuiteClasses({ DeleteActionUtilTest.class }) +public class AllTests { + // JUnit 4 test suite +} diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtilTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtilTest.java new file mode 100644 index 00000000000..97e53aaef62 --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/src/org/eclipse/papyrus/infra/gmfdiag/menu/utils/DeleteActionUtilTest.java @@ -0,0 +1,215 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation + *****************************************************************************/ + +package org.eclipse.papyrus.infra.gmfdiag.menu.utils; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.papyrus.infra.gmfdiag.menu.utils.DeleteActionUtil; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; + +/** + * Test of utility class {@link DeleteActionUtil}. + * + * @author Gabriel Pascual + */ +@PluginResource("resources/deleteActionUtil/model.di") +public class DeleteActionUtilTest extends AbstractPapyrusTest { + + /** The Constant CONNECTION_ELEMENT_LABEL. */ + private static final String CONNECTION_ELEMENT_LABEL = "Connection"; + + /** The Constant SEMANTIC_ELEMENT_NAME. */ + private static final String SEMANTIC_ELEMENT_NAME = "Class1"; + + /** The Constant CLASS_DIAGRAM_TITLE. */ + private static final String CLASS_DIAGRAM_TITLE = "NewDiagram"; + + /** The Constant NOTE_NOTATION_TYPE. */ + private static final String NOTE_NOTATION_TYPE = "Note"; + + /** Papyrus editor fixture. */ + @Rule + public PapyrusEditorFixture editorFixture = new PapyrusEditorFixture(); + + /** + * Test of {@link DeleteActionUtil#isSemanticDeletion(IGraphicalEditPart)} with a TextNote element. + */ + @Test + public void testDeleteTextNode() { + editorFixture.open(); + EditPart noteNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + Assert.assertFalse(DeleteActionUtil.isSemanticDeletion((IGraphicalEditPart) noteNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSemanticDeletion(IGraphicalEditPart)} with an Orphan element. + */ + @Test + public void testDeleteOrphan() { + editorFixture.open(); + EditPart orphanNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + + Assert.assertFalse(DeleteActionUtil.isSemanticDeletion((IGraphicalEditPart) orphanNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSemanticDeletion(IGraphicalEditPart)} with not orphan element. + */ + @Test + public void testDeleteNotOrphanElement() { + editorFixture.open(); + EditPart semanticNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + Assert.assertTrue(DeleteActionUtil.isSemanticDeletion((IGraphicalEditPart) semanticNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonical(EditPart)} with a Note. + */ + @Test + public void testIsCanonicalWithNote() { + editorFixture.open(); + EditPart orphanNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + Assert.assertFalse(DeleteActionUtil.isCanonicalEditPart((IGraphicalEditPart) orphanNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonical(EditPart)} with a connection. + */ + @Test + public void testIsCanonicalWithConnection() { + editorFixture.open(); + EditPart connectionNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(CONNECTION_ELEMENT_LABEL, org.eclipse.uml2.uml.Dependency.class); + Assert.assertFalse(DeleteActionUtil.isCanonicalEditPart((IGraphicalEditPart) connectionNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonical(EditPart)} with an orphan view. + */ + @Test + public void testIsCanonicalWithOrphan() { + editorFixture.open(); + EditPart orphanNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + Assert.assertFalse(DeleteActionUtil.isCanonicalEditPart((IGraphicalEditPart) orphanNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonical(EditPart)} with a semantic element. + */ + @Test + public void testIsCanonicalWithNotOrphan() { + editorFixture.open(); + EditPart semanticNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + Assert.assertFalse(DeleteActionUtil.isCanonicalEditPart((IGraphicalEditPart) semanticNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSupportView(IGraphicalEditPart)} with an orphan view. + */ + @Test + public void testIsSupportViewWithOrphan() { + editorFixture.open(); + EditPart orphanNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + Assert.assertTrue(DeleteActionUtil.isSupportView((IGraphicalEditPart) orphanNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSupportView(IGraphicalEditPart)} with a semantic element. + */ + @Test + public void testIsSupportViewWithNotOrphan() { + editorFixture.open(); + EditPart semanticNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + Assert.assertTrue(DeleteActionUtil.isSupportView((IGraphicalEditPart) semanticNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSupportView(IGraphicalEditPart)} with a Note view. + */ + @Test + public void testIsSupportViewWithNote() { + editorFixture.open(); + EditPart noteNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + Assert.assertTrue(DeleteActionUtil.isSupportView((IGraphicalEditPart) noteNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonicalView(IGraphicalEditPart)} with orphan. + */ + @Test + public void testIsCanonicalViewWithOrphan() { + editorFixture.open(); + EditPart orphanNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + Assert.assertTrue(DeleteActionUtil.isCanonicalView((IGraphicalEditPart) orphanNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonicalView(IGraphicalEditPart)} with semantic element. + */ + @Test + public void testIsCanonicalViewWithNotOrphan() { + editorFixture.open(); + EditPart semanticNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + Assert.assertTrue(DeleteActionUtil.isCanonicalView((IGraphicalEditPart) semanticNode)); + } + + /** + * Test of {@link DeleteActionUtil#isCanonicalView(IGraphicalEditPart)} with Note view. + */ + @Test + public void testIsCanonicalViewWithNote() { + editorFixture.open(); + EditPart noteNode = editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + Assert.assertTrue(DeleteActionUtil.isCanonicalView((IGraphicalEditPart) noteNode)); + } + + /** + * Test of {@link DeleteActionUtil#isSupportView(List)}. + */ + @Test + public void testIsSupportViews() { + + editorFixture.open(); + IGraphicalEditPart semanticNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + IGraphicalEditPart noteNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + IGraphicalEditPart orphanNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + List<IGraphicalEditPart> graphicalNodesList = Arrays.asList(new IGraphicalEditPart[] { semanticNode, noteNode, orphanNode }); + + Assert.assertTrue(DeleteActionUtil.isSupportView(graphicalNodesList)); + + } + + /** + * Test of {@link DeleteActionUtil#isCanonical(List)}. + */ + @Test + public void testIsCanonical() { + + editorFixture.open(); + IGraphicalEditPart semanticNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findEditPart(SEMANTIC_ELEMENT_NAME, org.eclipse.uml2.uml.Class.class); + IGraphicalEditPart noteNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(NOTE_NOTATION_TYPE); + IGraphicalEditPart orphanNode = (IGraphicalEditPart) editorFixture.activateDiagram(CLASS_DIAGRAM_TITLE).findOrphanEditPart(); + List<IGraphicalEditPart> graphicalNodesList = Arrays.asList(new IGraphicalEditPart[] { semanticNode, noteNode, orphanNode }); + + Assert.assertFalse(DeleteActionUtil.isCanonical(graphicalNodesList)); + + } + +} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java index de24d1c0d43..ff6f06fa893 100644 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java +++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java @@ -17,6 +17,7 @@ import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -92,13 +93,15 @@ import com.google.common.collect.Lists; /** - * A fixture that presents editors on a model specified via an annotation as for {@link ProjectFixture. The editor is closed automatically upon + * A fixture that presents editors on a model specified via an annotation as for {@link ProjectFixture}. The editor is closed automatically upon * completion of the test. */ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEditingDomain> { private final Collection<IEditorPart> editorsToClose = Lists.newArrayList(); + private final List<String> excludedTypeView = Arrays.asList(new String[] { "Note" }); + private IMultiDiagramEditor editor; private DiagramEditorWithFlyOutPalette activeDiagramEditor; @@ -123,9 +126,9 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit IMultiDiagramEditor result = null; final String fileName = new Path(path).lastSegment(); - for(IEditorReference next : getWorkbenchPage().getEditorReferences()) { - if(PapyrusMultiDiagramEditor.EDITOR_ID.equals(next.getId()) && fileName.equals(next.getName())) { - result = (IMultiDiagramEditor)next.getEditor(true); + for (IEditorReference next : getWorkbenchPage().getEditorReferences()) { + if (PapyrusMultiDiagramEditor.EDITOR_ID.equals(next.getId()) && fileName.equals(next.getName())) { + result = (IMultiDiagramEditor) next.getEditor(true); } } @@ -137,7 +140,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit testClass = description.getTestClass(); testDescription = description; - if(hasRequiredViews()) { + if (hasRequiredViews()) { openRequiredViews(); } @@ -151,17 +154,17 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit try { Exception exception = null; - for(IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { + for (IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { try { close(editor); } catch (Exception e) { - if(exception == null) { + if (exception == null) { exception = e; } } } - if(exception != null) { + if (exception != null) { exception.printStackTrace(); fail("Failed to close an editor: " + exception.getLocalizedMessage()); } @@ -171,7 +174,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit activeDiagramEditor = null; try { - if(hasRequiredViews()) { + if (hasRequiredViews()) { closeRequiredViews(); } } finally { @@ -184,7 +187,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public TransactionalEditingDomain getEditingDomain() { TransactionalEditingDomain result = null; - if(editor != null) { + if (editor != null) { result = getEditingDomain(editor); } @@ -226,18 +229,18 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } }); - if(firstEditor && !editorsToClose.isEmpty()) { + if (firstEditor && !editorsToClose.isEmpty()) { final IWorkbenchPage page = editor.getSite().getPage(); page.addPartListener(new IPartListener() { public void partClosed(IWorkbenchPart part) { editorsToClose.remove(part); - if(part == editor) { + if (part == editor) { editor = null; } - if(editorsToClose.isEmpty()) { + if (editorsToClose.isEmpty()) { page.removePartListener(this); } } @@ -273,7 +276,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit protected Iterable<IMultiDiagramEditor> openAll(Description description) { List<IMultiDiagramEditor> result = Lists.newArrayList(); - for(Resource resource : initModelResources(description)) { + for (Resource resource : initModelResources(description)) { IFile papyrusModel = getProject().getFile(resource.getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); result.add(open(papyrusModel)); } @@ -299,7 +302,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } public void activate() { - if(editor != null) { + if (editor != null) { activate(editor); } } @@ -307,14 +310,14 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public void activate(IWorkbenchPart part) { IWorkbenchPage page = part.getSite().getPage(); - if(page.getActivePart() != part) { + if (page.getActivePart() != part) { page.activate(part); flushDisplayEvents(); } } public void close() { - if(editor != null) { + if (editor != null) { close(editor); editor = null; } @@ -332,16 +335,16 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public void run() { ModelExplorerPageBookView view; try { - view = (ModelExplorerPageBookView)getWorkbenchPage().showView(AbstractEditorTest.MODELEXPLORER_VIEW_ID); + view = (ModelExplorerPageBookView) getWorkbenchPage().showView(AbstractEditorTest.MODELEXPLORER_VIEW_ID); } catch (PartInitException e) { e.printStackTrace(); return; } IPage currentPage = view.getCurrentPage(); - ModelExplorerPage page = (ModelExplorerPage)currentPage; + ModelExplorerPage page = (ModelExplorerPage) currentPage; IViewPart viewer = page.getViewer(); - modelExplorer = (ModelExplorerView)viewer; + modelExplorer = (ModelExplorerView) viewer; } }); @@ -351,7 +354,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit protected final IWorkbenchPage getWorkbenchPage() { IWorkbench bench = PlatformUI.getWorkbench(); IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); - if(window == null) { + if (window == null) { window = bench.getWorkbenchWindows()[0]; } return window.getActivePage(); @@ -388,10 +391,10 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit Package result = null; ModelSet modelSet = getModelSet(editor); - UmlModel uml = (UmlModel)modelSet.getModel(UmlModel.MODEL_ID); + UmlModel uml = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); assertThat("No UML model present in resource set", uml.getResource(), notNullValue()); - result = (Package)EcoreUtil.getObjectByType(uml.getResource().getContents(), UMLPackage.Literals.PACKAGE); + result = (Package) EcoreUtil.getObjectByType(uml.getResource().getContents(), UMLPackage.Literals.PACKAGE); assertThat("Model resource contains no UML Package", result, notNullValue()); return result; @@ -424,9 +427,9 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit sashContainer.visit(new IPageVisitor() { public void accept(IEditorPage page) { - if(name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { + if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { select[0] = page; - activeDiagramEditor = (DiagramEditorWithFlyOutPalette)page.getIEditorPart(); + activeDiagramEditor = (DiagramEditorWithFlyOutPalette) page.getIEditorPart(); } } @@ -435,7 +438,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } }); - if(select[0] != null) { + if (select[0] != null) { sashContainer.selectPage(select[0]); flushDisplayEvents(); } @@ -446,12 +449,12 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public DiagramEditorWithFlyOutPalette getActiveDiagramEditor() { DiagramEditorWithFlyOutPalette result = activeDiagramEditor; - if(result == null) { + if (result == null) { IEditorPart activeEditor = getWorkbenchPage().getActiveEditor(); - if(activeEditor instanceof IMultiDiagramEditor) { - activeEditor = ((IMultiDiagramEditor)activeEditor).getActiveEditor(); - if(activeEditor instanceof DiagramEditorWithFlyOutPalette) { - result = (DiagramEditorWithFlyOutPalette)activeEditor; + if (activeEditor instanceof IMultiDiagramEditor) { + activeEditor = ((IMultiDiagramEditor) activeEditor).getActiveEditor(); + if (activeEditor instanceof DiagramEditorWithFlyOutPalette) { + result = (DiagramEditorWithFlyOutPalette) activeEditor; } } } @@ -468,7 +471,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public EditPart findEditPart(IMultiDiagramEditor editor, EObject modelElement) { IEditorPart activeEditor = editor.getActiveEditor(); assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return findEditPart((DiagramEditor)activeEditor, modelElement); + return findEditPart((DiagramEditor) activeEditor, modelElement); } public EditPart findEditPart(IDiagramWorkbenchPart editor, EObject modelElement) { @@ -476,25 +479,73 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit return findEditPart(diagram, modelElement); } + + /** + * Find orphan edit part with a type. + * + * @param type + * the type + * @return the edits the part + */ + public EditPart findOrphanEditPart(String type) { + IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); + EditPart result = null; + for (Iterator<View> views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { + View next = views.next(); + EObject element = next.getElement(); + if (element == null && type.equals(next.getType())) { + result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + break; + } + } + + return result; + + } + + /** + * Find orphan edit part. + * + * @return the edits the part + */ + public EditPart findOrphanEditPart() { + IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); + EditPart result = null; + for (Iterator<View> views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { + View next = views.next(); + + String type = next.getType(); + EObject element = next.getElement(); + + if (element == null && !excludedTypeView.contains(type)) { + result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + break; + } + } + + return result; + + } + private EditPart findEditPart(EditPart editPart, EObject modelElement) { EditPart result = null; Optional<View> view = AdapterUtils.adapt(editPart, View.class); - if(view.isPresent() && (view.get().getElement() == modelElement)) { + if (view.isPresent() && (view.get().getElement() == modelElement)) { result = editPart; } - if(result == null) { + if (result == null) { // Search children - for(Iterator<?> iter = editPart.getChildren().iterator(); (result == null) && iter.hasNext();) { - result = findEditPart((EditPart)iter.next(), modelElement); + for (Iterator<?> iter = editPart.getChildren().iterator(); (result == null) && iter.hasNext();) { + result = findEditPart((EditPart) iter.next(), modelElement); } } - if((result == null) && (editPart instanceof GraphicalEditPart)) { + if ((result == null) && (editPart instanceof GraphicalEditPart)) { // Search edges - for(Iterator<?> iter = ((GraphicalEditPart)editPart).getSourceConnections().iterator(); (result == null) && iter.hasNext();) { - result = findEditPart((EditPart)iter.next(), modelElement); + for (Iterator<?> iter = ((GraphicalEditPart) editPart).getSourceConnections().iterator(); (result == null) && iter.hasNext();) { + result = findEditPart((EditPart) iter.next(), modelElement); } } @@ -508,17 +559,17 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public EditPart findEditPart(IMultiDiagramEditor editor, String name, Class<? extends NamedElement> type) { IEditorPart activeEditor = editor.getActiveEditor(); assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return findEditPart((DiagramEditor)activeEditor, name, type); + return findEditPart((DiagramEditor) activeEditor, name, type); } public EditPart findEditPart(IDiagramWorkbenchPart editor, String name, Class<? extends NamedElement> type) { EditPart result = null; - for(Iterator<View> views = Iterators.filter(editor.getDiagram().eAllContents(), View.class); views.hasNext();) { + for (Iterator<View> views = Iterators.filter(editor.getDiagram().eAllContents(), View.class); views.hasNext();) { View next = views.next(); EObject element = next.getElement(); - if(type.isInstance(element) && name.equals(type.cast(element).getName())) { - result = (EditPart)editor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + if (type.isInstance(element) && name.equals(type.cast(element).getName())) { + result = (EditPart) editor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); break; } } @@ -537,7 +588,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public PaletteViewer getPalette(IMultiDiagramEditor editor) { IEditorPart activeEditor = editor.getActiveEditor(); assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return getPalette((DiagramEditor)activeEditor); + return getPalette((DiagramEditor) activeEditor); } public PaletteViewer getPalette(IDiagramWorkbenchPart editor) { @@ -545,9 +596,9 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } public void flushDisplayEvents() { - for(;;) { + for (;;) { try { - if(!Display.getCurrent().readAndDispatch()) { + if (!Display.getCurrent().readAndDispatch()) { break; } } catch (Exception e) { @@ -564,11 +615,11 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit try { result = wbPage.findView(id); - if((result == null) && open) { + if ((result == null) && open) { result = wbPage.showView(id); } - if(result != null) { + if (result != null) { result.getSite().getPage().activate(result); flushDisplayEvents(); } @@ -583,7 +634,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } public void save(ISaveablePart part) { - if(part.isDirty()) { + if (part.isDirty()) { try { part.doSave(new NullProgressMonitor()); } catch (Exception e) { @@ -609,9 +660,9 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } public void splitEditorArea(IEditorPart editorToMove, boolean splitHorizontally) { - MPart editorPart = (MPart)editorToMove.getSite().getService(MPart.class); + MPart editorPart = editorToMove.getSite().getService(MPart.class); EModelService modelService = editorPart.getContext().get(EModelService.class); - MPartStack oldStack = (MPartStack)modelService.getContainer(editorPart); + MPartStack oldStack = (MPartStack) modelService.getContainer(editorPart); MPartStack newStack = modelService.createModelElement(MPartStack.class); modelService.insert(newStack, oldStack, splitHorizontally ? EModelService.RIGHT_OF : EModelService.BELOW, 0.5f); newStack.getChildren().add(editorPart); @@ -622,14 +673,14 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit public List<IWorkbenchPart> getPartStack(IWorkbenchPart part) { List<IWorkbenchPart> result; - MPart mpart = (MPart)part.getSite().getService(MPart.class); + MPart mpart = part.getSite().getService(MPart.class); EModelService modelService = mpart.getContext().get(EModelService.class); - MPartStack stack = (MPartStack)modelService.getContainer(mpart); + MPartStack stack = (MPartStack) modelService.getContainer(mpart); result = Lists.newArrayListWithCapacity(stack.getChildren().size()); - for(MPart next : Iterables.filter(stack.getChildren(), MPart.class)) { + for (MPart next : Iterables.filter(stack.getChildren(), MPart.class)) { IWorkbenchPart wbPart = next.getContext().get(IWorkbenchPart.class); - if(wbPart != null) { + if (wbPart != null) { result.add(wbPart); } } @@ -644,8 +695,8 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit protected final ShowView getRequiredViews() { ShowView result = testDescription.getAnnotation(ShowView.class); - if(result == null) { - for(Class<?> clazz = testClass; (result == null) && (clazz != null) && (clazz != Object.class); clazz = clazz.getSuperclass()) { + if (result == null) { + for (Class<?> clazz = testClass; (result == null) && (clazz != null) && (clazz != Object.class); clazz = clazz.getSuperclass()) { result = clazz.getAnnotation(ShowView.class); } } @@ -656,15 +707,15 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit protected void openRequiredViews() { IWorkbenchPage page = getWorkbenchPage(); - for(ShowViewDescriptor next : ShowViewDescriptor.getDescriptors(getRequiredViews())) { + for (ShowViewDescriptor next : ShowViewDescriptor.getDescriptors(getRequiredViews())) { IViewPart part = page.findView(next.viewID()); - if(part == null) { + if (part == null) { // Must open it try { part = page.showView(next.viewID()); movePartRelativeTo(part, next.relativeTo(), next.location()); - if(viewsToClose == null) { + if (viewsToClose == null) { viewsToClose = Lists.newArrayListWithExpectedSize(1); } viewsToClose.add(part); @@ -679,21 +730,21 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit } private void movePartRelativeTo(IWorkbenchPart part, String relativeTo, int where) { - MPart mPart = (MPart)part.getSite().getService(MPart.class); + MPart mPart = part.getSite().getService(MPart.class); EModelService modelService = mPart.getContext().get(EModelService.class); MUIElement relativePart = modelService.find(relativeTo, modelService.getTopLevelWindowFor(mPart)); - if(relativePart instanceof MPartSashContainerElement) { + if (relativePart instanceof MPartSashContainerElement) { MStackElement toMove = mPart; MPlaceholder placeHolder = mPart.getCurSharedRef(); - if(placeHolder != null) { + if (placeHolder != null) { toMove = placeHolder; } - if(where < 0) { + if (where < 0) { // Add it to the relative part's containing stack - if(relativePart instanceof MPart) { - MPart relativeMPart = (MPart)relativePart; - if(relativeMPart.getCurSharedRef() != null) { + if (relativePart instanceof MPart) { + MPart relativeMPart = (MPart) relativePart; + if (relativeMPart.getCurSharedRef() != null) { // This is where the part is stacked relativePart = relativeMPart.getCurSharedRef(); } @@ -703,15 +754,15 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit // Insert it next to the relative part MPartStack newStack = modelService.createModelElement(MPartStack.class); newStack.getChildren().add(toMove); - modelService.insert(newStack, (MPartSashContainerElement)relativePart, where, 0.3f); + modelService.insert(newStack, (MPartSashContainerElement) relativePart, where, 0.3f); } } } protected void closeRequiredViews() { // Only close the Palette view if we opened it - if(viewsToClose != null) { - for(IViewPart closeMe : viewsToClose) { + if (viewsToClose != null) { + for (IViewPart closeMe : viewsToClose) { closeMe.getSite().getPage().hideView(closeMe); } viewsToClose = null; @@ -747,7 +798,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit ImmutableList.Builder<ShowViewDescriptor> result = ImmutableList.builder(); String[] ids = annotation.value(); - for(int i = 0; i < ids.length; i++) { + for (int i = 0; i < ids.length; i++) { result.add(new ShowViewDescriptor(annotation, i)); } diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/AllCanonicalTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/AllCanonicalTests.java index 5e489423ea4..93b1d879550 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/AllCanonicalTests.java +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/AllCanonicalTests.java @@ -39,7 +39,9 @@ TestDropfunction.class, //test is a static operation is underlined
TestStaticFeatureRepresentation.class,
//test nested classifier
-TestClassDiagramNestedClassifier.class,
+TestClassDiagramNestedClassifier.class,
+//test list-compartment child duplicates
+TestListCompartmentNodesChildDuplicates.class,
})
public class AllCanonicalTests {
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/TestListCompartmentNodesChildDuplicates.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/TestListCompartmentNodesChildDuplicates.java new file mode 100644 index 00000000000..45018ff32c5 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/test/canonical/TestListCompartmentNodesChildDuplicates.java @@ -0,0 +1,361 @@ +/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.clazz.test.canonical;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.junit.framework.classification.FailingTest;
+import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNestedClassifierCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentNestedClassifierCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DataTypeAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DataTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DataTypeOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DefaultNamedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.EnumerationEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.EnumerationEnumerationLiteralCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceNestedClassifierCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedClassForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedClassForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedClassForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedDataTypeForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedDataTypeForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedDataTypeForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedEnumerationForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedEnumerationForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedEnumerationForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedInterfaceForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedInterfaceForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedInterfaceForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedPrimitiveTypeForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedPrimitiveTypeForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedPrimitiveTypeForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedSignalForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedSignalForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.NestedSignalForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.OperationForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.OperationForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.OperationForDataTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.OperationForInterfaceEditpart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.OperationForPrimitiveTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PrimitiveTypeAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PrimitiveTypeOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyForClassEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyForComponentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyForInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyForSignalEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyforDataTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PropertyforPrimitiveTypeEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ReceptionEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ReceptionInInterfaceEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.SignalAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.SignalEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.clazz.test.IClassDiagramTestsConstants;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class TestListCompartmentNodesChildDuplicates extends AbstractPapyrusTestCase {
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName()
+ *
+ * @return
+ */
+ @Override
+ protected String getProjectName() {
+ return IClassDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName()
+ *
+ * @return
+ */
+ @Override
+ protected String getFileName() {
+ return IClassDiagramTestsConstants.FILE_NAME;
+ }
+
+ @Override
+ protected ICreationCommand getDiagramCommandCreation() {
+ return new CreateClassDiagramCommand();
+ }
+
+ @Test
+ public void testAssociationClassVsProperty() throws Exception {
+ checkDuplicate(AssociationClassEditPart.VISUAL_ID, AssociationClassAttributeCompartmentEditPart.VISUAL_ID, PropertyForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testAssociationClassVsOperation() throws Exception {
+ checkDuplicate(AssociationClassEditPart.VISUAL_ID, AssociationClassOperationCompartmentEditPart.VISUAL_ID, OperationForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsProperty() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassAttributeCompartmentEditPart.VISUAL_ID, PropertyForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsOperation() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassOperationCompartmentEditPart.VISUAL_ID, OperationForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsClass() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, ClassEditPart.VISUAL_ID, NestedClassForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsDataType() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, DataTypeEditPart.VISUAL_ID, NestedDataTypeForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsEnumeration() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, EnumerationEditPart.VISUAL_ID, NestedEnumerationForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsInterface() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, InterfaceEditPart.VISUAL_ID, NestedInterfaceForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsReception() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassOperationCompartmentEditPart.VISUAL_ID, ReceptionEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsPrimitiveType() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, PrimitiveTypeEditPart.VISUAL_ID, NestedPrimitiveTypeForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testClassVsSignal() throws Exception {
+ checkDuplicate(ClassEditPart.VISUAL_ID, ClassNestedClassifierCompartmentEditPart.VISUAL_ID, SignalEditPart.VISUAL_ID, NestedSignalForClassEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsClass() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, ClassEditPart.VISUAL_ID, NestedClassForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsDataType() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, DataTypeEditPart.VISUAL_ID, NestedDataTypeForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsEnumeration() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, EnumerationEditPart.VISUAL_ID, NestedEnumerationForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsInterface() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, InterfaceEditPart.VISUAL_ID, NestedInterfaceForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsPrimitiveType() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, PrimitiveTypeEditPart.VISUAL_ID, NestedPrimitiveTypeForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsSignal() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID, SignalEditPart.VISUAL_ID, NestedSignalForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsOperation() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentOperationCompartmentEditPart.VISUAL_ID, OperationForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsReception() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentOperationCompartmentEditPart.VISUAL_ID, ReceptionEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testComponentVsProperty() throws Exception {
+ checkDuplicate(ComponentEditPart.VISUAL_ID, ComponentAttributeCompartmentEditPart.VISUAL_ID, PropertyForComponentEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testDataTypeVsProperty() throws Exception {
+ checkDuplicate(DataTypeEditPart.VISUAL_ID, DataTypeAttributeCompartmentEditPart.VISUAL_ID, PropertyforDataTypeEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testDataTypeVsOperation() throws Exception {
+ checkDuplicate(DataTypeEditPart.VISUAL_ID, DataTypeOperationCompartmentEditPart.VISUAL_ID, OperationForDataTypeEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsOperation() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceOperationCompartmentEditPart.VISUAL_ID, OperationForInterfaceEditpart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsReception() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceOperationCompartmentEditPart.VISUAL_ID, ReceptionInInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsClass() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, ClassEditPart.VISUAL_ID, NestedClassForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsDataType() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, DataTypeEditPart.VISUAL_ID, NestedDataTypeForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsEnumeration() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, EnumerationEditPart.VISUAL_ID, NestedEnumerationForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsInterface() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, InterfaceEditPart.VISUAL_ID, NestedInterfaceForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsPrimitiveType() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, PrimitiveTypeEditPart.VISUAL_ID, NestedPrimitiveTypeForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsSignal() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID, SignalEditPart.VISUAL_ID, NestedSignalForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testInterfaceVsProperty() throws Exception {
+ checkDuplicate(InterfaceEditPart.VISUAL_ID, InterfaceAttributeCompartmentEditPart.VISUAL_ID, PropertyForInterfaceEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testPrimitiveTypeVsProperty() throws Exception {
+ checkDuplicate(PrimitiveTypeEditPart.VISUAL_ID, PrimitiveTypeAttributeCompartmentEditPart.VISUAL_ID, PropertyforPrimitiveTypeEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testPrimitiveTypeVsOperation() throws Exception {
+ checkDuplicate(PrimitiveTypeEditPart.VISUAL_ID, PrimitiveTypeOperationCompartmentEditPart.VISUAL_ID, OperationForPrimitiveTypeEditPart.VISUAL_ID);
+ }
+
+ @Test
+ public void testSignalVsProperty() throws Exception {
+ checkDuplicate(SignalEditPart.VISUAL_ID, SignalAttributeCompartmentEditPart.VISUAL_ID, PropertyForSignalEditPart.VISUAL_ID);
+ }
+
+ @FailingTest
+ @Test
+ public void testEnumerationVsEnumerationLiteral() throws Exception {
+ checkDuplicate(EnumerationEditPart.VISUAL_ID, EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID, EnumerationLiteralEditPart.VISUAL_ID);
+ }
+
+ private void checkDuplicate(int parent, int parentContainer, int child) {
+ checkDuplicate(parent, parentContainer, child, 0);
+ }
+
+ private void checkDuplicate(int parent, int parentContainer, int child, int nestedChild) {
+ IGraphicalEditPart parentEP = createChild(parent, getDiagramEditPart(), 0);
+ IGraphicalEditPart targetEP = findChildBySemanticHint(parentEP, parentContainer);
+ IGraphicalEditPart dndEP = createChild(nestedChild > 0 ? nestedChild : child, targetEP, 0);
+ {
+ Command ddCommand = createDropCommand(dndEP, getDiagramEditPart());
+ Assert.assertTrue(ddCommand.canExecute());
+ executeOnUIThread(ddCommand);
+ }
+ IGraphicalEditPart canvasDnDEP = findChildBySemanticHint(getDiagramEditPart(), nestedChild > 0 ? child : DefaultNamedElementEditPart.VISUAL_ID);
+ {
+ Command ddCommand = createDropCommand(canvasDnDEP, targetEP);
+ Assert.assertFalse(canvasDnDEP.getClass().getName() + " can't be dropped to the " + targetEP.getClass().getName() + " due the duplication behavior rule.", ddCommand.canExecute());
+ }
+ }
+
+ private Command createDropCommand(IGraphicalEditPart child, IGraphicalEditPart newParent) {
+ CompoundCommand c = new CompoundCommand();
+ ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DRAG);
+ changeBoundsRequest.setEditParts(child);
+ changeBoundsRequest.setLocation(new Point(15, 15));
+ c.add(child.getCommand(changeBoundsRequest));
+ getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(c));
+ changeBoundsRequest.setType(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DROP);
+ c.add(newParent.getCommand(changeBoundsRequest));
+ return c;
+ }
+
+ private IGraphicalEditPart createChild(int childVID, IGraphicalEditPart container, int number) {
+ final IElementType childType = UMLElementTypes.getElementType(childVID);
+ final CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(childType, container.getDiagramPreferencesHint());
+ requestcreation.setSize(new Dimension(1, 1));
+ requestcreation.setLocation(new Point(10, 10));
+ Command cmd = container.getCommand(requestcreation);
+ executeOnUIThread(cmd);
+ return findChild(container, childVID, number);
+ }
+
+ private IGraphicalEditPart findChild(IGraphicalEditPart parent, int vid, int number) {
+ List<?> children = parent.getChildren();
+ if (number > children.size() - 1) {
+ Assert.fail("Parent " + parent + ", type " + parent.getNotationView() + " hasn't less children then " + number);
+ }
+ IGraphicalEditPart childEP = (IGraphicalEditPart) children.get(number);
+ assertNotNull("Parent " + parent + ", type " + parent.getNotationView() + " looking for: " + vid, childEP);
+ Assert.assertEquals("Parent " + parent + ", type " + parent.getNotationView() + " looking for: " + vid, UMLVisualIDRegistry.getVisualID(childEP.getNotationView()), vid);
+ return childEP;
+ }
+
+ private IGraphicalEditPart findChildBySemanticHint(IGraphicalEditPart parent, int vid) {
+ IGraphicalEditPart childEP = parent.getChildBySemanticHint(Integer.toString(vid));
+ assertNotNull("Parent " + parent + ", type " + parent.getNotationView() + " looking for: " + vid, childEP);
+ return childEP;
+ }
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestParentBarAutoresize_385603.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestParentBarAutoresize_385603.java index c8d44daf201..fdb9df97c85 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestParentBarAutoresize_385603.java +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestParentBarAutoresize_385603.java @@ -50,6 +50,10 @@ public class TestParentBarAutoresize_385603 extends TestTopNode { private static final String MOVE = "Move: ";
+ private final int CHILD_OFFSET = 10;
+
+ private final int SPACING_HEIGHT = 5; // LifelineXYLayoutEditPolicy.SPACING_HEIGHT
+
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateSequenceDiagramCommand();
@@ -91,89 +95,72 @@ public class TestParentBarAutoresize_385603 extends TestTopNode { waitForComplete();
// create nested execution specification
- createNode(elementType, lifeline1, new Point(131, 300), new Dimension(20, 40));
+ createNode(elementType, lifeline1, new Point(131, 200), new Dimension(20, 40));
waitForComplete();
IGraphicalEditPart parent = (IGraphicalEditPart)lifeline1.getChildren().get(1);
Rectangle before = getAbsoluteBounds(parent);
// create child
- /* With location (131, 270), the new Execution will not the child of parent. */
- createNode(elementType, lifeline1, new Point(131, 310), new Dimension(20, 40));
+ createNode(elementType, lifeline1, new Point(131, 200+CHILD_OFFSET), new Dimension(20, 40));
waitForComplete();
IGraphicalEditPart child = (IGraphicalEditPart)lifeline1.getChildren().get(2);
//The parent will not be expand when creation.
assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y == before.getTop().y);
- assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height == before.height);
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height == before.height+CHILD_OFFSET+SPACING_HEIGHT*2);
// move up
before = getAbsoluteBounds(parent);
- Point moveDelta = new Point(0, -20);
+ Point moveDelta = new Point(0, -CHILD_OFFSET*2);
move(child, moveDelta);
- assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y == getAbsoluteBounds(child).getTop().y);
- /*
- * the parent would not be always expanded.
- *
- * assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y - before.getTop().y == moveDelta.y);
- */
+ assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y == getAbsoluteBounds(child).getTop().y-SPACING_HEIGHT);
+ assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y - before.getTop().y == moveDelta.y+SPACING_HEIGHT);
assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y <= getAbsoluteBounds(child).getTop().y);
// resize
before = getAbsoluteBounds(parent);
- Dimension deltaSize = new Dimension(0, 20);
+ Dimension deltaSize = new Dimension(0, CHILD_OFFSET*2);
resize(child, getAbsoluteBounds(child).getTop(), PositionConstants.NORTH, deltaSize);
- assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y == getAbsoluteBounds(child).getTop().y);
+ assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().y == getAbsoluteBounds(child).getTop().y-SPACING_HEIGHT);
assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height - before.height == deltaSize.height);
}
private void moveDown(IElementType elementType) {
- createNode(UMLElementTypes.Lifeline_3001, getRootEditPart(), new Point(100, 100), new Dimension(62, 200));
+ createNode(UMLElementTypes.Lifeline_3001, getRootEditPart(), new Point(100, 100), new Dimension(62, 300));
final LifelineEditPart lifeline1 = (LifelineEditPart)getRootEditPart().getChildren().get(0);
waitForComplete();
// create nested execution specification
- createNode(elementType, lifeline1, new Point(131, 200), new Dimension(20, 50));
+ createNode(elementType, lifeline1, new Point(131, 200), new Dimension(20, 40));
waitForComplete();
IGraphicalEditPart parent = (IGraphicalEditPart)lifeline1.getChildren().get(1);
Rectangle before = getAbsoluteBounds(parent);
// create child
- createNode(elementType, lifeline1, before.getRight().getTranslated(-1, 0), new Dimension(20, 50));
+ createNode(elementType, lifeline1, new Point(131, 200+CHILD_OFFSET), new Dimension(20, 40));
waitForComplete();
IGraphicalEditPart child = (IGraphicalEditPart)lifeline1.getChildren().get(2);
- /*
- * DISABLED: the parent is not always expanded when adding a child.
- *
- * assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y > before.getBottom().y);
- * assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y);
- */
- assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == before.getBottom().y);
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y > before.getBottom().y);
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y+SPACING_HEIGHT*2);
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == before.getBottom().y+CHILD_OFFSET+SPACING_HEIGHT*2);
// move
before = getAbsoluteBounds(parent);
- Point moveDelta = new Point(0, 20);
+ Point moveDelta = new Point(0, CHILD_OFFSET*2);
move(child, moveDelta);
assertTrue(MOVE + TEST_THE_EXECUTION, before.getLocation().equals(getAbsoluteBounds(parent).getLocation()));
-
- /*
- * The height of parent will not be changed when move down child.
- * assertTrue(MOVE + TEST_THE_EXECUTION, before.height + moveDelta.y == getAbsoluteBounds(parent).height);
- * assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y);
- */
- assertTrue(MOVE + TEST_THE_EXECUTION, before.height == getAbsoluteBounds(parent).height);
+ assertTrue(MOVE + TEST_THE_EXECUTION, before.height + moveDelta.y == getAbsoluteBounds(parent).height+SPACING_HEIGHT);
+ assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y+SPACING_HEIGHT);
+ assertTrue(MOVE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height == before.height+CHILD_OFFSET*2-SPACING_HEIGHT);
// resize
before = getAbsoluteBounds(parent);
Dimension deltaSize = new Dimension(0, 30);
resize(child, getAbsoluteBounds(child).getBottom(), PositionConstants.SOUTH, deltaSize);
- /*
- * parent would not be changed.
- *
- * assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y);
- * assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height == before.height + deltaSize.height);
- */
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getBottom().y == getAbsoluteBounds(child).getBottom().y+SPACING_HEIGHT);
+ assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).height == before.height + deltaSize.height);
assertTrue(RESIZE + TEST_THE_EXECUTION, getAbsoluteBounds(parent).getTop().equals(before.getTop()));
// move parent will move child bar
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/pro20130916/Fixbug_OrderFragmentsAfterResizeExecutions_417374.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/pro20130916/Fixbug_OrderFragmentsAfterResizeExecutions_417374.java index 6941374241f..cca0545a425 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/pro20130916/Fixbug_OrderFragmentsAfterResizeExecutions_417374.java +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/pro20130916/Fixbug_OrderFragmentsAfterResizeExecutions_417374.java @@ -73,13 +73,6 @@ public class Fixbug_OrderFragmentsAfterResizeExecutions_417374 extends AbstractN //resize behavior
resize(execution2, SequenceUtil.getAbsoluteBounds(execution2).getLocation(), PositionConstants.SOUTH, new Dimension(0, 100));
//validate
- actualList = new ArrayList<InteractionFragment>();
- actualList.add(actionES.getStart());
- actualList.add(actionES);
- actualList.add(behaviorES.getStart());
- actualList.add(behaviorES);
- actualList.add(actionES.getFinish());
- actualList.add(behaviorES.getFinish());
validateOrders(interaction.getFragments(), actualList);
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/canonical/AbstractTestNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/canonical/AbstractTestNode.java index d23ab380455..e2ab8544fe3 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/canonical/AbstractTestNode.java +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/canonical/AbstractTestNode.java @@ -1,571 +1,557 @@ -/*****************************************************************************
- * Copyright (c) 2013, 2014 CEA LIST 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:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- * Christian W. Damus (CEA) - bug 431618
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.tests.canonical;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLCompartmentEditPart;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.uml2.uml.Element;
-import org.junit.Assert;
-import org.junit.Before;
-
-/**
- * Abstract class to test nodes
- */
-public abstract class AbstractTestNode extends org.eclipse.papyrus.uml.diagram.tests.canonical.AbstractPapyrusTestCase {
-
- /** <code>true</code> if semantic tests should be run on graphical manipulation */
- private boolean testSemantic;
-
- /** command computed on the ui thread */
- protected Command command;
-
- /**
- * @see org.eclipse.papyrus.diagram.clazz.test.canonical.AbstractPapyrusTestCase#setUp()
- *
- * @throws Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
- testSemantic = isSemanticTest();
- }
-
- /**
- * Returns <code>true</code> if semantic tests should be also performed
- *
- * @return <code>true</code> if semantic tests should be also performed
- */
- protected boolean isSemanticTest() {
- return false;
- }
-
- /**
- * @see org.eclipse.papyrus.diagram.clazz.test.canonical.AbstractPapyrusTestCase#getRootView()
- *
- * @return
- */
- @Override
- protected abstract View getRootView();
-
- public abstract DiagramUpdater getDiagramUpdater();
-
- /**
- * Returns the container edit part
- */
- protected abstract IGraphicalEditPart getContainerEditPart();
-
-
-
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, String initialName,int numberSemanticChildreen) {
- // create a node
- testToCreateANode(type, 0, 0, 1, 1, false, initialName, numberSemanticChildreen);
- // creates a second one
- testToCreateANode(type, 1, 1, 1, 1, false, initialName, numberSemanticChildreen);
- // destroy the first element
- testDestroy(type, 2, 2, 1, 1);
- // destroy the second one
- testDestroy(type, 1, 1, 1, 1);
- // the node has been destroyed, the UML element also. restore one element
- undoOnUIThread();
- // the node and the UML element are present
- testViewDeletion(type,1, 1, 1);
- // The node has been deleted, the uml element is still present
- testDrop(type, eClass,0,1,1);
-
- // The element can be dropped several time in the diagrams
- testDrop(type, eClass,1,1,1);
-
- // undo the second drop
- undoOnUIThread();
- // the node and element are present
- if(containerMove) {
- testChangeContainer(type, containerType);
- }
- }
-
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, int numberSemanticChildreen) {
- testToManageNode(type, eClass, containerType, containerMove, null, numberSemanticChildreen);
- }
-
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove) {
- testToManageNode(type, eClass, containerType, containerMove, null, 0);
- }
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testToManageNodeWithMask(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, String initialName,int numberSemanticChildreen) {
- // create a node
- testToCreateANode(type, 0, 0, 1, 1, true, initialName, numberSemanticChildreen);
- // creates a second one
- testToCreateANode(type, 1, 1, 1, 1, true, initialName, numberSemanticChildreen);
- // destroy the first element
- testDestroy(type, 2, 2, 1, 1);
- // destroy the second one
- testDestroy(type, 1, 1, 1, 1);
- // the node has been destroyed, the UML element also. restore one element
- undoOnUIThread();
- // the node and the UML element are present
- testViewDeletion(type,1, 1, 1);
- // The node has been deleted, the uml element is still present
- testDrop(type, eClass,0,1,1);
-
- // The element can be dropped several time in the diagrams
- testDrop(type, eClass,1,1,1);
- // the node and element are present
- if(containerMove) {
- testChangeContainer(type, containerType);
- }
- }
-
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, EReference containmentFeature, boolean maskmanaged, int numberSemanticChildreen) {
- // create a node
- testToCreateANode(type);
- // creates a second one
- testToCreateANode(type, 1, 1, 1, 1, maskmanaged,null, numberSemanticChildreen);
- // destroy the first element
- testDestroy(type, 2, 2, 1, 1);
- // destroy the second one
- testDestroy(type, 1, 1, 1, 1);
- // the node has been destroyed, the UML element also. restore one element
- undoOnUIThread();
- // the node and the UML element are present
- testViewDeletion(type,1, 1, 1);
- // The node has been deleted, the uml element is still present
- testDrop(type, eClass,0,1,1);
- // the node and element are present
- if(containerMove) {
- testChangeContainer(type, containerType);
- }
- }
-
- /**
- * Test to manage child node.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- * @deprecated, @use {@link AbstractTestNode#testToManageNode(IElementType, EClass, IElementType, boolean)}
- */
- @Deprecated
- public void testToManageChildNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, boolean maskmanaged,int numberSemanticChildreen) {
- testToManageNode(type, eClass, containerType, containerMove,null, numberSemanticChildreen);
- }
-
- /**
- * Test destroy.
- *
- * @param type
- * the type
- */
- public void testDestroy(IElementType type) {
- testDestroy(type, 1, 1, 1, 1);
- }
-
- /**
- * Test destroy.
- *
- * @param type
- * the type
- */
- public void testDestroy(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int removedGraphicalChildren, int removedSemanticChildren) {
- // DESTROY SEMANTIC + VIEW
- assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- EditPart currentEditPart= ((GraphicalEditPart)getContainerEditPart().getChildren().get(getContainerEditPart().getChildren().size()-1));
- Command command = currentEditPart.getCommand(deleteViewRequest);
- assertNotNull(DESTROY_DELETION + COMMAND_NULL, command);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
- testEnableForDeleteFromModel();
- executeOnUIThread(command);
- assertEquals(DESTROY_DELETION + TEST_THE_EXECUTION, expectedGraphicalChildren - removedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedSemanticChildren - removedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- undoOnUIThread();
- assertEquals(DESTROY_DELETION + TEST_THE_UNDO, expectedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(DESTROY_DELETION + TEST_THE_UNDO, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- redoOnUIThread();
- assertEquals(DESTROY_DELETION + TEST_THE_REDO, expectedGraphicalChildren - removedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(DESTROY_DELETION + TEST_THE_REDO, expectedSemanticChildren - removedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- }
-
- /**
- * test id the handler delete from model is enable
- */
- protected void testEnableForDeleteFromModel() {
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- org.eclipse.core.commands.Command cmd = commandService.getCommand("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
- IHandler handler = cmd.getHandler();
- if(handler instanceof AbstractHandler) {
- ((AbstractHandler)handler).setEnabled("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
- }
- boolean res = handler.isEnabled();
- assertTrue("Delete from model handler must be enable",res); //$NON-NLS-1$
- }
-
- /**
- * Test drop.
- *
- * @param type
- * the type
- */
- public void testDrop(IElementType type, EClass eClass, int expectedGraphicalChildren, int expectedSemanticChildren, int addedGraphicalChildren) {
- //DROP
- assertEquals(DROP + INITIALIZATION_TEST, expectedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(DROP + INITIALIZATION_TEST, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- DropObjectsRequest dropObjectsRequest = new DropObjectsRequest();
- ArrayList<Element> list = new ArrayList<Element>();
- for(Element element : getRootSemanticModel().getOwnedElements()) {
- if(element != null && element.eClass().equals(eClass)) {
- list.add(element);
- }
- }
- dropObjectsRequest.setObjects(list);
- dropObjectsRequest.setLocation(new Point(40, 40));
- Command command = getContainerEditPart().getCommand(dropObjectsRequest);
- assertNotNull(DROP + COMMAND_NULL, command);
- assertTrue(DROP + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(DROP + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
- // execute the drop
- executeOnUIThread(command);
- Assert.assertEquals(DROP + TEST_THE_EXECUTION,expectedGraphicalChildren+addedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- Assert.assertEquals(DROP + TEST_THE_EXECUTION,expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- // undo the drop
- undoOnUIThread();
- Assert.assertEquals(DROP + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- Assert.assertEquals(DROP + TEST_THE_UNDO, expectedSemanticChildren,getRootSemanticModel().getOwnedElements().size());
- }
- // redo the drop
- redoOnUIThread();
- Assert.assertEquals(DROP + TEST_THE_REDO,expectedGraphicalChildren+addedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- assertTrue(DROP + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() != 0);
- }
- }
-
- /**
- * Test change container.
- *
- * @param type
- * the type
- * @param containerType
- * the container type
- */
- public void testChangeContainer(IElementType type, IElementType containerType) {
- //CHANGE CONTAINER
- assertEquals(CHANGE_CONTAINER + INITIALIZATION_TEST, 1, getContainerEditPart().getChildren().size());
- assertEquals(CHANGE_CONTAINER + INITIALIZATION_TEST, 1, getRootSemanticModel().getOwnedElements().size());
- final Request requestcreation = CreateViewRequestFactory.getCreateShapeRequest(containerType, getContainerEditPart().getDiagramPreferencesHint());
- command = null;
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- command = getContainerEditPart().getCommand(requestcreation);
- }
- });
- assertNotNull(CONTAINER_CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
- executeOnUIThread(command);
- assertEquals(CONTAINER_CREATION + TEST_THE_EXECUTION, 2, getRootView().getChildren().size());
- GraphicalEditPart containerEditPart = (GraphicalEditPart)getContainerEditPart().getChildren().get(1);
- ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD);
- changeBoundsRequest.setEditParts((EditPart)getContainerEditPart().getChildren().get(0));
- changeBoundsRequest.setLocation(new Point(30, 30));
- ShapeCompartmentEditPart compartment = null;
- int index = 0;
- while(compartment == null && index < containerEditPart.getChildren().size()) {
- if((containerEditPart.getChildren().get(index)) instanceof ShapeCompartmentEditPart) {
- compartment = (ShapeCompartmentEditPart)(containerEditPart.getChildren().get(index));
- }
- index++;
- }
- assertTrue("Container not found", compartment != null); //$NON-NLS-1$
- command = compartment.getCommand(changeBoundsRequest);
- assertNotNull(CHANGE_CONTAINER, command);
- assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
- // execute change container
- executeOnUIThread(command);
- assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, getRootView().getChildren().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, getRootSemanticModel().getOwnedElements().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, compartment.getChildren().size());
- // undo change container
- undoOnUIThread();
- assertEquals(CHANGE_CONTAINER + TEST_THE_UNDO, 2, getRootView().getChildren().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_UNDO, 2, getRootSemanticModel().getOwnedElements().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 0, compartment.getChildren().size());
- // redo change container
- redoOnUIThread();
- assertEquals(CHANGE_CONTAINER + TEST_THE_REDO, 1, getRootView().getChildren().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_REDO, 1, getRootSemanticModel().getOwnedElements().size());
- assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, compartment.getChildren().size());
- }
-
- /**
- * Test to create a node.
- *
- * @param type
- * the type
- */
- public void testToCreateANode(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int addedGraphicalChildren, int addedSemanticChildren, boolean maskmanaged, String initialName, int numberSemanticChildreen) {
- command = null;
- //CREATION
- assertEquals(CREATION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size());
- Element root = getRootSemanticModel();
- List<Element> ownedElements = root.getOwnedElements();
- if( isSemanticTest()){
- assertEquals(CREATION + INITIALIZATION_TEST, expectedSemanticChildren, ownedElements.size());
- }
- final CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(type, getContainerEditPart().getDiagramPreferencesHint());
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- command = getContainerEditPart().getCommand(requestcreation);
- }
- });
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); //$NON-NLS-1$
- // execute the creation
- executeOnUIThread(command);
- assertEquals(CREATION + TEST_THE_EXECUTION, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size());
- if(addedGraphicalChildren>=1){
- Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape",getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1) instanceof Shape); //$NON-NLS-1$
- }
-
- if(testSemantic) {
- assertEquals(CREATION + TEST_THE_EXECUTION, expectedSemanticChildren + addedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- // undo the creation
- undoOnUIThread();
- assertEquals(CREATION + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(CREATION + TEST_THE_UNDO, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
- // redo the creation test
- redoOnUIThread();
- assertEquals(CREATION + TEST_THE_REDO, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- assertEquals(CREATION + TEST_THE_REDO, expectedSemanticChildren + addedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
- }
-
- EditPart createdEditPart= (EditPart)getContainerEditPart().getChildren().get((getContainerEditPart().getChildren().size()-1));
- Assert.assertNotNull("The editpart must be created", createdEditPart); //$NON-NLS-1$
- testNodeEditPart(maskmanaged, createdEditPart, initialName);
-
-
- // test diagram updater
- if(getDiagramUpdater()!=null){
- Assert.assertNotEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(getRootView()).size()); //$NON-NLS-1$
- Assert.assertEquals("Diagram updater must detect that no link has been created",0,getDiagramUpdater().getContainedLinks(getRootView()).size()); //$NON-NLS-1$
- Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
- Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
- Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",numberSemanticChildreen,getDiagramUpdater().getSemanticChildren((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
- Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
- }
- createdEditPart.getChildren();
- for(Iterator<?> iteratorEditPart = createdEditPart.getChildren().iterator(); iteratorEditPart.hasNext();) {
- Object subEditPart = iteratorEditPart.next();
- if( subEditPart instanceof UMLCompartmentEditPart){
- Assert.assertEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(((CompartmentEditPart)subEditPart).getNotationView()).size()); //$NON-NLS-1$
- }
-
- }
- }
-
- /**
- * this method is used to test the created editpart
- * @param maskmanaged
- * @param createdEditPart
- */
- protected void testNodeEditPart(boolean maskmanaged, EditPart createdEditPart,String initialName) {
- if( maskmanaged){
- Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY)); //$NON-NLS-1$
- }
- int index=0;
- while(index < createdEditPart.getChildren().size()) {
- if((createdEditPart.getChildren().get(index)) instanceof ResizableCompartmentEditPart ) {
- ResizableCompartmentEditPart compartment = (ResizableCompartmentEditPart)(createdEditPart.getChildren().get(index));
- Assert.assertFalse("compartment must not be selectable",compartment.isSelectable()); //$NON-NLS-1$
- }
- index++;
- }
- testNameLabel(createdEditPart, initialName);
- }
-
- protected void testNameLabel(EditPart createdEditPart, String initialName) {
- if( createdEditPart instanceof NamedElementEditPart){
- GraphicalEditPart namedEditPart=(GraphicalEditPart)((NamedElementEditPart)createdEditPart).getPrimaryChildEditPart();
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof ITextAwareEditPart); //$NON-NLS-1$
- String name=namedEditPart.resolveSemanticElement().eClass().getName();
- if( initialName!=null){
- name=initialName;
- }
- if(name.length()<((ITextAwareEditPart)namedEditPart).getEditText().length()){
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText().substring(0,name.length())); //$NON-NLS-1$
- }
- else{
- //not the same it sure but display the mistake is important
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText()); //$NON-NLS-1$
- }
- if(namedEditPart instanceof CompartmentEditPart ){
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof CompartmentEditPart); //$NON-NLS-1$
- Assert.assertTrue("namelabelEditpart must be editable",((CompartmentEditPart)namedEditPart).isEditModeEnabled());} //$NON-NLS-1$
- else{
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof LabelEditPart); //$NON-NLS-1$
-
- }
- }
- }
-
- /**
- * Test to create a node.
- *
- * @param type
- * the type
- */
- public void testToCreateANode(IElementType type) {
- testToCreateANode(type, 0, getRequiredProfiles().length, 1, 1, false,null,0);
- }
-
- /**
- * Test view deletion.
- *
- * @param type
- * the type
- */
- public void testViewDeletion(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int removedGraphicalChildren) {
- //DELETION OF THE VIEW
- assertEquals(VIEW_DELETION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size());
-
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- Command command = ((IGraphicalEditPart)getContainerEditPart().getChildren().get(getContainerEditPart().getChildren().size()-1)).getCommand(deleteViewRequest);
- assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
- // execute hide the view
- executeOnUIThread(command);
- assertEquals(VIEW_DELETION + TEST_THE_EXECUTION, expectedGraphicalChildren-removedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION,expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size() );
- }
- // undo hide the view
- undoOnUIThread();
- assertEquals(VIEW_DELETION + TEST_THE_UNDO, expectedGraphicalChildren,getRootView().getChildren().size());
- if(testSemantic) {
- Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION,expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size() );
- }
- // redo hide the view
- redoOnUIThread();
- assertEquals(VIEW_DELETION + TEST_THE_REDO, expectedGraphicalChildren-removedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION,expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size() );
- }
- }
-
- protected abstract CreateViewRequest createViewRequestShapeContainer();
-}
+/***************************************************************************** + * Copyright (c) 2013, 2014 CEA LIST 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: + * Remi Schnekenburger (CEA LIST) - Initial API and implementation + * Christian W. Damus (CEA) - bug 431618 + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.tests.canonical; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.RequestConstants; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gef.requests.ChangeBoundsRequest; +import org.eclipse.gef.requests.GroupRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory; +import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; +import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.notation.Shape; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart; +import org.eclipse.papyrus.uml.diagram.common.editparts.UMLCompartmentEditPart; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Element; +import org.junit.Assert; +import org.junit.Before; + +/** + * Abstract class to test nodes + */ +public abstract class AbstractTestNode extends org.eclipse.papyrus.uml.diagram.tests.canonical.AbstractPapyrusTestCase { + + /** <code>true</code> if semantic tests should be run on graphical manipulation */ + private boolean testSemantic; + + /** command computed on the ui thread */ + protected Command command; + + /** + * @see org.eclipse.papyrus.diagram.clazz.test.canonical.AbstractPapyrusTestCase#setUp() + * + * @throws Exception + */ + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + testSemantic = isSemanticTest(); + } + + /** + * Returns <code>true</code> if semantic tests should be also performed + * + * @return <code>true</code> if semantic tests should be also performed + */ + protected boolean isSemanticTest() { + return false; + } + + /** + * @see org.eclipse.papyrus.diagram.clazz.test.canonical.AbstractPapyrusTestCase#getRootView() + * + * @return + */ + @Override + protected abstract View getRootView(); + + public abstract DiagramUpdater getDiagramUpdater(); + + /** + * Returns the container edit part + */ + protected abstract IGraphicalEditPart getContainerEditPart(); + + + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, String initialName, int numberSemanticChildreen) { + // create a node + testToCreateANode(type, 0, 0, 1, 1, false, initialName, numberSemanticChildreen); + // creates a second one + testToCreateANode(type, 1, 1, 1, 1, false, initialName, numberSemanticChildreen); + // destroy the first element + testDestroy(type, 2, 2, 1, 1); + // destroy the second one + testDestroy(type, 1, 1, 1, 1); + // the node has been destroyed, the UML element also. restore one element + undoOnUIThread(); + // the node and the UML element are present + testViewDeletion(type, 1, 1, 1); + // The node has been deleted, the uml element is still present + testDrop(type, eClass, 0, 1, 1); + + // The element can be dropped several time in the diagrams + testDrop(type, eClass, 1, 1, 1); + + // undo the second drop + undoOnUIThread(); + // the node and element are present + if (containerMove) { + testChangeContainer(type, containerType); + } + } + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, int numberSemanticChildreen) { + testToManageNode(type, eClass, containerType, containerMove, null, numberSemanticChildreen); + } + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove) { + testToManageNode(type, eClass, containerType, containerMove, null, 0); + } + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testToManageNodeWithMask(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, String initialName, int numberSemanticChildreen) { + // create a node + testToCreateANode(type, 0, 0, 1, 1, true, initialName, numberSemanticChildreen); + // creates a second one + testToCreateANode(type, 1, 1, 1, 1, true, initialName, numberSemanticChildreen); + // destroy the first element + testDestroy(type, 2, 2, 1, 1); + // destroy the second one + testDestroy(type, 1, 1, 1, 1); + // the node has been destroyed, the UML element also. restore one element + undoOnUIThread(); + // the node and the UML element are present + testViewDeletion(type, 1, 1, 1); + // The node has been deleted, the uml element is still present + testDrop(type, eClass, 0, 1, 1); + + // The element can be dropped several time in the diagrams + testDrop(type, eClass, 1, 1, 1); + // the node and element are present + if (containerMove) { + testChangeContainer(type, containerType); + } + } + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testToManageNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, EReference containmentFeature, boolean maskmanaged, int numberSemanticChildreen) { + // create a node + testToCreateANode(type); + // creates a second one + testToCreateANode(type, 1, 1, 1, 1, maskmanaged, null, numberSemanticChildreen); + // destroy the first element + testDestroy(type, 2, 2, 1, 1); + // destroy the second one + testDestroy(type, 1, 1, 1, 1); + // the node has been destroyed, the UML element also. restore one element + undoOnUIThread(); + // the node and the UML element are present + testViewDeletion(type, 1, 1, 1); + // The node has been deleted, the uml element is still present + testDrop(type, eClass, 0, 1, 1); + // the node and element are present + if (containerMove) { + testChangeContainer(type, containerType); + } + } + + /** + * Test to manage child node. + * + * @param type + * the type + * @param containerType + * the container type + * @deprecated, @use {@link AbstractTestNode#testToManageNode(IElementType, EClass, IElementType, boolean)} + */ + @Deprecated + public void testToManageChildNode(IElementType type, EClass eClass, IElementType containerType, boolean containerMove, boolean maskmanaged, int numberSemanticChildreen) { + testToManageNode(type, eClass, containerType, containerMove, null, numberSemanticChildreen); + } + + /** + * Test destroy. + * + * @param type + * the type + */ + public void testDestroy(IElementType type) { + testDestroy(type, 1, 1, 1, 1); + } + + /** + * Test destroy. + * + * @param type + * the type + */ + public void testDestroy(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int removedGraphicalChildren, int removedSemanticChildren) { + // DESTROY SEMANTIC + VIEW + assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false)); + EditPart currentEditPart = ((GraphicalEditPart) getContainerEditPart().getChildren().get(getContainerEditPart().getChildren().size() - 1)); + Command command = currentEditPart.getCommand(deleteViewRequest); + assertNotNull(DESTROY_DELETION + COMMAND_NULL, command); + assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); + executeOnUIThread(command); + assertEquals(DESTROY_DELETION + TEST_THE_EXECUTION, expectedGraphicalChildren - removedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(DESTROY_DELETION + INITIALIZATION_TEST, expectedSemanticChildren - removedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + undoOnUIThread(); + assertEquals(DESTROY_DELETION + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(DESTROY_DELETION + TEST_THE_UNDO, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + redoOnUIThread(); + assertEquals(DESTROY_DELETION + TEST_THE_REDO, expectedGraphicalChildren - removedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(DESTROY_DELETION + TEST_THE_REDO, expectedSemanticChildren - removedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + } + + + + /** + * Test drop. + * + * @param type + * the type + */ + public void testDrop(IElementType type, EClass eClass, int expectedGraphicalChildren, int expectedSemanticChildren, int addedGraphicalChildren) { + // DROP + assertEquals(DROP + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(DROP + INITIALIZATION_TEST, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + DropObjectsRequest dropObjectsRequest = new DropObjectsRequest(); + ArrayList<Element> list = new ArrayList<Element>(); + for (Element element : getRootSemanticModel().getOwnedElements()) { + if (element != null && element.eClass().equals(eClass)) { + list.add(element); + } + } + dropObjectsRequest.setObjects(list); + dropObjectsRequest.setLocation(new Point(40, 40)); + Command command = getContainerEditPart().getCommand(dropObjectsRequest); + assertNotNull(DROP + COMMAND_NULL, command); + assertTrue(DROP + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(DROP + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); + // execute the drop + executeOnUIThread(command); + Assert.assertEquals(DROP + TEST_THE_EXECUTION, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + Assert.assertEquals(DROP + TEST_THE_EXECUTION, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // undo the drop + undoOnUIThread(); + Assert.assertEquals(DROP + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + Assert.assertEquals(DROP + TEST_THE_UNDO, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // redo the drop + redoOnUIThread(); + Assert.assertEquals(DROP + TEST_THE_REDO, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertTrue(DROP + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() != 0); + } + } + + /** + * Test change container. + * + * @param type + * the type + * @param containerType + * the container type + */ + public void testChangeContainer(IElementType type, IElementType containerType) { + // CHANGE CONTAINER + assertEquals(CHANGE_CONTAINER + INITIALIZATION_TEST, 1, getContainerEditPart().getChildren().size()); + assertEquals(CHANGE_CONTAINER + INITIALIZATION_TEST, 1, getRootSemanticModel().getOwnedElements().size()); + final Request requestcreation = CreateViewRequestFactory.getCreateShapeRequest(containerType, getContainerEditPart().getDiagramPreferencesHint()); + command = null; + Display.getDefault().syncExec(new Runnable() { + + public void run() { + command = getContainerEditPart().getCommand(requestcreation); + } + }); + assertNotNull(CONTAINER_CREATION + COMMAND_NULL, command); + assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); + executeOnUIThread(command); + assertEquals(CONTAINER_CREATION + TEST_THE_EXECUTION, 2, getRootView().getChildren().size()); + GraphicalEditPart containerEditPart = (GraphicalEditPart) getContainerEditPart().getChildren().get(1); + ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD); + changeBoundsRequest.setEditParts((EditPart) getContainerEditPart().getChildren().get(0)); + changeBoundsRequest.setLocation(new Point(30, 30)); + ShapeCompartmentEditPart compartment = null; + int index = 0; + while (compartment == null && index < containerEditPart.getChildren().size()) { + if ((containerEditPart.getChildren().get(index)) instanceof ShapeCompartmentEditPart) { + compartment = (ShapeCompartmentEditPart) (containerEditPart.getChildren().get(index)); + } + index++; + } + assertTrue("Container not found", compartment != null); //$NON-NLS-1$ + command = compartment.getCommand(changeBoundsRequest); + assertNotNull(CHANGE_CONTAINER, command); + assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); + // execute change container + executeOnUIThread(command); + assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, getRootView().getChildren().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, getRootSemanticModel().getOwnedElements().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, compartment.getChildren().size()); + // undo change container + undoOnUIThread(); + assertEquals(CHANGE_CONTAINER + TEST_THE_UNDO, 2, getRootView().getChildren().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_UNDO, 2, getRootSemanticModel().getOwnedElements().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 0, compartment.getChildren().size()); + // redo change container + redoOnUIThread(); + assertEquals(CHANGE_CONTAINER + TEST_THE_REDO, 1, getRootView().getChildren().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_REDO, 1, getRootSemanticModel().getOwnedElements().size()); + assertEquals(CHANGE_CONTAINER + TEST_THE_EXECUTION, 1, compartment.getChildren().size()); + } + + /** + * Test to create a node. + * + * @param type + * the type + */ + public void testToCreateANode(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int addedGraphicalChildren, int addedSemanticChildren, boolean maskmanaged, String initialName, int numberSemanticChildreen) { + command = null; + // CREATION + assertEquals(CREATION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size()); + Element root = getRootSemanticModel(); + List<Element> ownedElements = root.getOwnedElements(); + if (isSemanticTest()) { + assertEquals(CREATION + INITIALIZATION_TEST, expectedSemanticChildren, ownedElements.size()); + } + final CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(type, getContainerEditPart().getDiagramPreferencesHint()); + Display.getDefault().syncExec(new Runnable() { + + public void run() { + command = getContainerEditPart().getCommand(requestcreation); + } + }); + assertNotNull(CREATION + COMMAND_NULL, command); + assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); //$NON-NLS-1$ + // execute the creation + executeOnUIThread(command); + assertEquals(CREATION + TEST_THE_EXECUTION, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size()); + if (addedGraphicalChildren >= 1) { + Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape", getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren - 1) instanceof Shape); //$NON-NLS-1$ + } + + if (testSemantic) { + assertEquals(CREATION + TEST_THE_EXECUTION, expectedSemanticChildren + addedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // undo the creation + undoOnUIThread(); + assertEquals(CREATION + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(CREATION + TEST_THE_UNDO, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // redo the creation test + redoOnUIThread(); + assertEquals(CREATION + TEST_THE_REDO, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + assertEquals(CREATION + TEST_THE_REDO, expectedSemanticChildren + addedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + + EditPart createdEditPart = (EditPart) getContainerEditPart().getChildren().get((getContainerEditPart().getChildren().size() - 1)); + Assert.assertNotNull("The editpart must be created", createdEditPart); //$NON-NLS-1$ + testNodeEditPart(maskmanaged, createdEditPart, initialName); + + + // test diagram updater + if (getDiagramUpdater() != null) { + Assert.assertNotEquals("Diagram updater must detect that children has been created", 0, getDiagramUpdater().getSemanticChildren(getRootView()).size()); //$NON-NLS-1$ + Assert.assertEquals("Diagram updater must detect that no link has been created", 0, getDiagramUpdater().getContainedLinks(getRootView()).size()); //$NON-NLS-1$ + Assert.assertEquals("Diagram updater must detect that no link are incoming", 0, getDiagramUpdater().getIncomingLinks((View) getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren - 1)).size()); //$NON-NLS-1$ + Assert.assertEquals("Diagram updater must detect that no link are outgoing", 0, getDiagramUpdater().getOutgoingLinks((View) getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren - 1)).size()); //$NON-NLS-1$ + Assert.assertEquals( + "Diagram updater must detect that no children has ben created in the new element", numberSemanticChildreen, getDiagramUpdater().getSemanticChildren((View) getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren - 1)).size()); //$NON-NLS-1$ + Assert.assertEquals("Diagram updater must detect that no link has been created in the new element", 0, getDiagramUpdater().getContainedLinks((View) getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren - 1)).size()); //$NON-NLS-1$ + } + createdEditPart.getChildren(); + for (Iterator<?> iteratorEditPart = createdEditPart.getChildren().iterator(); iteratorEditPart.hasNext();) { + Object subEditPart = iteratorEditPart.next(); + if (subEditPart instanceof UMLCompartmentEditPart) { + Assert.assertEquals("Diagram updater must detect that children has been created", 0, getDiagramUpdater().getSemanticChildren(((CompartmentEditPart) subEditPart).getNotationView()).size()); //$NON-NLS-1$ + } + + } + } + + /** + * this method is used to test the created editpart + * + * @param maskmanaged + * @param createdEditPart + */ + protected void testNodeEditPart(boolean maskmanaged, EditPart createdEditPart, String initialName) { + if (maskmanaged) { + Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY)); //$NON-NLS-1$ + } + int index = 0; + while (index < createdEditPart.getChildren().size()) { + if ((createdEditPart.getChildren().get(index)) instanceof ResizableCompartmentEditPart) { + ResizableCompartmentEditPart compartment = (ResizableCompartmentEditPart) (createdEditPart.getChildren().get(index)); + Assert.assertFalse("compartment must not be selectable", compartment.isSelectable()); //$NON-NLS-1$ + } + index++; + } + testNameLabel(createdEditPart, initialName); + } + + protected void testNameLabel(EditPart createdEditPart, String initialName) { + if (createdEditPart instanceof NamedElementEditPart) { + GraphicalEditPart namedEditPart = (GraphicalEditPart) ((NamedElementEditPart) createdEditPart).getPrimaryChildEditPart(); + Assert.assertTrue("the primary editpart must be the namelabelEditpart", namedEditPart instanceof ITextAwareEditPart); //$NON-NLS-1$ + String name = namedEditPart.resolveSemanticElement().eClass().getName(); + if (initialName != null) { + name = initialName; + } + if (name.length() < ((ITextAwareEditPart) namedEditPart).getEditText().length()) { + Assert.assertEquals(" the name must contain the name of the metaclass", name, ((ITextAwareEditPart) namedEditPart).getEditText().substring(0, name.length())); //$NON-NLS-1$ + } + else { + // not the same it sure but display the mistake is important + Assert.assertEquals(" the name must contain the name of the metaclass", name, ((ITextAwareEditPart) namedEditPart).getEditText()); //$NON-NLS-1$ + } + if (namedEditPart instanceof CompartmentEditPart) { + Assert.assertTrue("the primary editpart must be the namelabelEditpart", namedEditPart instanceof CompartmentEditPart); //$NON-NLS-1$ + Assert.assertTrue("namelabelEditpart must be editable", ((CompartmentEditPart) namedEditPart).isEditModeEnabled());} //$NON-NLS-1$ + else { + Assert.assertTrue("the primary editpart must be the namelabelEditpart", namedEditPart instanceof LabelEditPart); //$NON-NLS-1$ + + } + } + } + + /** + * Test to create a node. + * + * @param type + * the type + */ + public void testToCreateANode(IElementType type) { + testToCreateANode(type, 0, getRequiredProfiles().length, 1, 1, false, null, 0); + } + + /** + * Test view deletion. + * + * @param type + * the type + */ + public void testViewDeletion(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int removedGraphicalChildren) { + // DELETION OF THE VIEW + assertEquals(VIEW_DELETION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size()); + + Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE); + Command command = ((IGraphicalEditPart) getContainerEditPart().getChildren().get(getContainerEditPart().getChildren().size() - 1)).getCommand(deleteViewRequest); + assertNotNull(VIEW_DELETION + COMMAND_NULL, command); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); + // execute hide the view + executeOnUIThread(command); + assertEquals(VIEW_DELETION + TEST_THE_EXECUTION, expectedGraphicalChildren - removedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // undo hide the view + undoOnUIThread(); + assertEquals(VIEW_DELETION + TEST_THE_UNDO, expectedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + // redo hide the view + redoOnUIThread(); + assertEquals(VIEW_DELETION + TEST_THE_REDO, expectedGraphicalChildren - removedGraphicalChildren, getRootView().getChildren().size()); + if (testSemantic) { + Assert.assertEquals(VIEW_DELETION + TEST_THE_EXECUTION, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size()); + } + } + + protected abstract CreateViewRequest createViewRequestShapeContainer(); +} |