Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre2017-08-28 15:05:56 +0000
committerBenoit Maggi2017-09-26 11:05:43 +0000
commit2682b0033d12617175d0a590766f5c5c55f55ad1 (patch)
tree273d7989c5f64e28be9f97b5f2d35a2b489bbe28 /examples
parent921e050373ff74f9367fb9c9c8ca618b4e97928a (diff)
downloadorg.eclipse.papyrus-2682b0033d12617175d0a590766f5c5c55f55ad1.tar.gz
org.eclipse.papyrus-2682b0033d12617175d0a590766f5c5c55f55ad1.tar.xz
org.eclipse.papyrus-2682b0033d12617175d0a590766f5c5c55f55ad1.zip
Bug 521476: [userxp] plugin that declare a menu not at the right place
- deletion of the plugin - zip the code in bug 521476 Change-Id: Id32f15017393db9ac71005a469573f7ddb72edad Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=521476 Signed-off-by: Francois Le Fevre <francois.le-fevre@cea.fr>
Diffstat (limited to 'examples')
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.classpath7
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.project28
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF22
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/about.html28
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/build.properties7
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.properties12
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.xml63
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml14
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/Activator.java50
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java100
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsHandler.java69
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java201
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsHandler.java69
-rw-r--r--examples/uml/pom.xml1
17 files changed, 0 insertions, 682 deletions
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.classpath b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.classpath
deleted file mode 100644
index 098194ca4b7..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?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/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.project b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.project
deleted file mode 100644
index fa4c72415fb..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.diagram.example.programmaticcreation</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/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.resources.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 896a9a53a53..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8 \ No newline at end of file
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.runtime.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 5a0ad22d2a7..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.jdt.core.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f42de363afa..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-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/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF
deleted file mode 100644
index 9f0de4f0430..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.example.programmaticcreation;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.example.programmaticcreation.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore;bundle-version="2.9.0",
- org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.uml.diagram.composite;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.diagram.sequence;bundle-version="[3.0.0,5.0.0)",
- org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.gmf.runtime.notation;bundle-version="1.7.0",
- org.eclipse.gmf.runtime.diagram.core;bundle-version="1.7.0",
- org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/about.html b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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>
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/build.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/build.properties
deleted file mode 100644
index ae22b3b40a0..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties,\
- plugin.xml
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.properties
deleted file mode 100644
index eb8c55ac7da..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#################################################################################
-# Copyright (c) 2008 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# CEA LIST - initial API and implementation
-##################################################################################
-pluginName=Papyrus Programmatic Sequence
-providerName=Eclipse Modeling Project
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.xml
deleted file mode 100644
index 3aaee74fecf..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/plugin.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="true"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <menu
- id="org.eclipse.papyrus.views.modelexplorer.popup.testSequenceDiag"
- label="Test diagram creation">
- </menu>
- </menuContribution>
- <menuContribution
- allPopups="true"
- locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?after=filtersMenu">
- <menu
- id="org.eclipse.papyrus.views.modelexplorer.popup.testSequenceDiag"
- label="Test diagram creation">
- </menu>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.example.programmaticcreation.CreateCompositeDiagramElementsHandler"
- id="org.eclipse.papyrus.example.programmaticsequence.createCU"
- name="dummy">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.example.programmaticcreation.CreateSequenceDiagramElementsHandler"
- id="org.eclipse.papyrus.example.programmaticsequence.createLifeLine"
- name="dummy">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popup.testSequenceDiag">
- <command
- commandId="org.eclipse.papyrus.example.programmaticsequence.createCU"
- id="org.eclipse.papyrus.example.programmaticsequence.createCU.ID"
- label="Create collaboration use"
- style="push">
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.example.programmaticsequence.createLifeLine"
- id="org.eclipse.papyrus.example.programmaticsequence.createLifeLine.ID"
- label="Create lifelines and message"
- style="push">
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-</plugin>
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml
deleted file mode 100644
index a9dfec414b4..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>
- <parent>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus.uml.diagram.example.programmaticcreation</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-</project> \ No newline at end of file
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/Activator.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/Activator.java
deleted file mode 100644
index 4bfb5b2b9f9..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.papyrus.uml.diagram.example.programmaticcreation;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.example.programmaticcreation"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java
deleted file mode 100644
index 61fad175c9c..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * All rights reserved. This program and the accompanying materials
- * are property of the CEA, their use is subject to specific agreement
- * with the CEA.
- *
- * Contributors:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.example.programmaticcreation;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
-import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
-import org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.CollaborationUse;
-import org.eclipse.uml2.uml.StructuredClassifier;
-
-
-
-public class CreateCompositeDiagramElementsCommand extends AbstractEMFOperation {
-
- public CreateCompositeDiagramElementsCommand(TransactionalEditingDomain domain, ExecutionEvent event, Class context) {
- super(domain, "add collaboration use"); //$NON-NLS-1$
- m_context = context;
- m_event = event;
- }
-
- /**
- * Create a collaboration use element
- *
- * @param m_context
- */
- @Override
- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
-
- ISashWindowsContainer windowsContainer = null;
- //ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
- Object model = windowsContainer.getActiveSashWindowsPage().getRawModel();
- if(model instanceof PageRef) {
- EObject diagramEObj = ((PageRef)model).getEmfPageIdentifier();
- if(diagramEObj instanceof Diagram) {
- Diagram diagram = (Diagram)diagramEObj;
- View view = null;
- // get first view
- for(Object child : diagram.getChildren()) {
- if(child instanceof View) {
- if(((View)child).getElement() == m_context) {
- view = (View)child;
- }
- }
- }
- CollaborationUse cu = ((Class)m_context).createCollaborationUse("testCollaboration"); //$NON-NLS-1$
- addCuToCompositeDiagram((Class) m_context, (Class) m_context, cu, view, diagram);
- }
- }
-
- return Status.OK_STATUS;
- }
-
- public View addCuToCompositeDiagram(Class context, StructuredClassifier solutionClass, CollaborationUse cu, View view, Diagram diagram)
- {
- // add CU to compartment
- Object compartment = view.getChildren().get(1);
- View roleBindingView = compViewProvider.createCollaborationUse_Shape(cu, (BasicCompartment)compartment, -1, true,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- Location location = NotationFactory.eINSTANCE.createLocation();
- location.setX(50);
- location.setY(40);
- if(roleBindingView instanceof Node) {
- ((Node)roleBindingView).setLayoutConstraint(location);
- }
- return roleBindingView;
- }
-
- public static UMLViewProvider compViewProvider = new UMLViewProvider();
-
- protected ExecutionEvent m_event;
-
- protected Class m_context;
-}
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsHandler.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsHandler.java
deleted file mode 100644
index a3a882f47f2..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * All rights reserved. This program and the accompanying materials
- * are property of the CEA, their use is subject to specific agreement
- * with the CEA.
- *
- * Contributors:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.example.programmaticcreation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IOperationHistory;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * Implementation class for ClassAction action
- */
-public class CreateCompositeDiagramElementsHandler extends CmdHandler {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isEnabled() {
- updateSelectedEObject();
- if(selectedEObject instanceof Class) {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- if(!(selectedEObject instanceof NamedElement)) {
- return null;
- }
-
- final NamedElement element = (NamedElement)selectedEObject;
-
- // 1. select possible connectors according to port types
- // (only show compatible connectors check-box?)
- // 2. select implementation group according to connector type
-
- if(element instanceof Class) {
- // container dialog: either extension, rule or interceptor
- // how-to select? which? (and how-to add/remove?) - is standard dialog sufficient?
- IOperationHistory history = OperationHistoryFactory.getOperationHistory();
- try {
- AbstractEMFOperation command = new CreateCompositeDiagramElementsCommand(TransactionUtil.getEditingDomain(selectedEObject), event, (Class) element);
- history.execute(command, new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-}
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java
deleted file mode 100644
index dfc4263ecef..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * All rights reserved. This program and the accompanying materials
- * are property of the CEA, their use is subject to specific agreement
- * with the CEA.
- *
- * Contributors:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.example.programmaticcreation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.IdentityAnchor;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
-import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.DurationConstraint;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLPackage;
-
-
-public class CreateSequenceDiagramElementsCommand extends AbstractEMFOperation {
-
- public CreateSequenceDiagramElementsCommand(TransactionalEditingDomain domain, ExecutionEvent event, Class context) {
- super(domain, "add lifelines and message"); //$NON-NLS-1$
- m_context = context;
- m_event = event;
- }
-
- /**
- * Create a collaboration use element
- *
- * @param m_context
- */
- @Override
- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- //try {
- ISashWindowsContainer windowsContainer = null;
- //ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
- Object model = windowsContainer.getActiveSashWindowsPage().getRawModel();
- if(model instanceof PageRef) {
- EObject diagramEObj = ((PageRef)model).getEmfPageIdentifier();
- if(diagramEObj instanceof Diagram) {
- Diagram diagram = (Diagram)diagramEObj;
- View interactionView = null;
- // get first view
- for(Object child : diagram.getChildren()) {
- if(child instanceof View) {
- if(((View)child).getElement() == m_context) {
- interactionView = (View)child;
- }
- }
- }
-
- // create UML elements first
- Interaction interaction = (Interaction) m_context;
- Lifeline lifeline1 = interaction.createLifeline("TestLifeline1"); //$NON-NLS-1$
- Lifeline lifeline2 = interaction.createLifeline("TestLifeline2"); //$NON-NLS-1$
- MessageOccurrenceSpecification mosSrc = (MessageOccurrenceSpecification)
- interaction.createFragment("source", //$NON-NLS-1$
- UMLPackage.eINSTANCE.getMessageOccurrenceSpecification());
- MessageOccurrenceSpecification mosDst = (MessageOccurrenceSpecification)
- interaction.createFragment("target", //$NON-NLS-1$
- UMLPackage.eINSTANCE.getMessageOccurrenceSpecification());
- Message message = interaction.createMessage("from l1 to l2"); //$NON-NLS-1$
- mosSrc.setMessage(message);
- mosSrc.setCovered(lifeline1);
- mosDst.setMessage(message);
- mosDst.setCovered(lifeline2);
- message.setSendEvent(mosSrc);
- message.setReceiveEvent(mosDst);
-
- DurationConstraint durationConstraint = (DurationConstraint)
- interaction.createOwnedRule("constraint", UMLPackage.eINSTANCE.getDurationConstraint()); //$NON-NLS-1$
- // DurationInterval di = (DurationInterval)
- // durationConstraint.createSpecification("", null, UMLPackage.eINSTANCE.getDurationInterval()); //$NON-NLS-1$
-
- // now add graphical elements
- View lifelineV1 = addLifeline(lifeline1, interactionView, 40, 40);
- View lifelineV2 = addLifeline(lifeline2, interactionView, 170, 40);
- addDurationConstraint(durationConstraint, interactionView, 250, 100);
- addMessage(message, diagram, lifelineV1, lifelineV2);
- }
- }
- /*}
- catch (ServiceException svcE) {
- System.err.println(svcE.toString());
- }*/
- return Status.OK_STATUS;
- }
-
- /**
- * Add a lifeline view for a given UML lifeline within an interaction view
- * @param lifeline the UML lifeline
- * @param interactionView the view associated with the interaction
- * @param x layout hint
- * @param y layout hint
- * @return the created view
- */
- public View addLifeline(Lifeline lifeline, View interactionView, int x, int y)
- {
- // get first compartment of view
- Object compartment = interactionView.getChildren().get(1);
- // use the view service to create the types. This is a bit cleaner than using the sequence-diagram view provider directly
- final String nodeType = UMLVisualIDRegistry.getType( org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart.VISUAL_ID);
- Node lifelineView = ViewService.createNode((View) compartment, lifeline, nodeType, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- Bounds location = NotationFactory.eINSTANCE.createBounds();
- location.setX(x);
- location.setY(y);
- if(lifelineView instanceof Node) {
- ((Node)lifelineView).setLayoutConstraint(location);
- //((Node)lifelineView).setLayoutConstraint(value);(location);
- }
- if(lifelineView instanceof Shape) {
- Shape lifelineShape = (Shape) lifelineView;
- lifelineShape.setLineWidth(2);
- lifelineShape.setLineColor(11579568);
- }
- return lifelineView;
- }
-
- /**
- * Add a duration-constraint view for a given UML constraint within an interaction view
- * @param durationContraint a duration constraint
- * @param interactionView the view associated with the interaction
- * @param x layout hint
- * @param y layout hint
- * @return the created view
- */
- public View addDurationConstraint(DurationConstraint durationContraint, View interactionView, int x, int y)
- {
- // get first compartment of view
- Object compartment = interactionView.getChildren().get(1);
- Node lifelineView = sequenceDiagViewProvider.createDurationConstraint_Shape(durationContraint, (View) compartment, -1, true,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- Bounds location = NotationFactory.eINSTANCE.createBounds();
- location.setX(x);
- location.setY(y);
- if(lifelineView instanceof Node) {
- ((Node)lifelineView).setLayoutConstraint(location);
- }
- return lifelineView;
- }
-
- /**
- * Add a message view for a given UML message within a given diagram
- * @param message UML message
- * @param diagram Sequence diagram
- * @param lifelineSrcV view of source lifeline
- * @param lifelineDstV view of destination lifeline
- */
- public void addMessage(Message message, Diagram diagram, View lifelineSrcV, View lifelineDstV)
- {
- View messageView = sequenceDiagViewProvider.createMessage_AsynchEdge(message, diagram, -1, true,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(messageView instanceof Edge) {
- Edge messageEdge = (Edge) messageView;
- messageEdge.setSource(lifelineSrcV);
- messageEdge.setTarget(lifelineDstV);
- IdentityAnchor sourceAnchor = (IdentityAnchor)
- messageEdge.createSourceAnchor(NotationPackage.eINSTANCE.getIdentityAnchor());
- IdentityAnchor targetAnchor = (IdentityAnchor)
- messageEdge.createSourceAnchor(NotationPackage.eINSTANCE.getIdentityAnchor());
- sourceAnchor.setId("(1.0,0.7){R}"); //$NON-NLS-1$
- targetAnchor.setId("(1.1,0.7){R}"); //$NON-NLS-1$
- }
- }
-
- public static UMLViewProvider sequenceDiagViewProvider = new UMLViewProvider();
-
- protected ExecutionEvent m_event;
-
- protected Class m_context;
-}
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsHandler.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsHandler.java
deleted file mode 100644
index c9d5340a212..00000000000
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * All rights reserved. This program and the accompanying materials
- * are property of the CEA, their use is subject to specific agreement
- * with the CEA.
- *
- * Contributors:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.example.programmaticcreation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IOperationHistory;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * Implementation class for ClassAction action
- */
-public class CreateSequenceDiagramElementsHandler extends CmdHandler {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isEnabled() {
- updateSelectedEObject();
- if(selectedEObject instanceof Class) {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- if(!(selectedEObject instanceof NamedElement)) {
- return null;
- }
-
- final NamedElement element = (NamedElement)selectedEObject;
-
- // 1. select possible connectors according to port types
- // (only show compatible connectors check-box?)
- // 2. select implementation group according to connector type
-
- if(element instanceof Class) {
- // container dialog: either extension, rule or interceptor
- // how-to select? which? (and how-to add/remove?) - is standard dialog sufficient?
- IOperationHistory history = OperationHistoryFactory.getOperationHistory();
- try {
- AbstractEMFOperation command = new CreateSequenceDiagramElementsCommand(TransactionUtil.getEditingDomain(selectedEObject), event, (Class) element);
- history.execute(command, new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-}
diff --git a/examples/uml/pom.xml b/examples/uml/pom.xml
index 7c8dbb2f359..f01d3ece712 100644
--- a/examples/uml/pom.xml
+++ b/examples/uml/pom.xml
@@ -13,7 +13,6 @@
<module>org.eclipse.papyrus.example.uml.comment.editor.newresource</module>
<module>org.eclipse.papyrus.example.uml.comment.editor.sharedresource</module>
<module>org.eclipse.papyrus.uml.diagram.emftree</module>
- <module>org.eclipse.papyrus.uml.diagram.example.programmaticcreation</module>
<module>org.eclipse.papyrus.uml.textual.editors.example</module>
</modules>
</project> \ No newline at end of file

Back to the top