summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-04-04 10:14:37 (EDT)
committerLaurent Wouters2014-04-04 10:14:37 (EDT)
commita7be9ef2589bcbee82511664d616e50b29c61ce2 (patch)
treec10939f011ac33616e354f67fc16ac2aae966344
parent91529e93b237ec709adb311593c1f848510f3229 (diff)
downloadorg.eclipse.papyrus-a7be9ef2589bcbee82511664d616e50b29c61ce2.zip
org.eclipse.papyrus-a7be9ef2589bcbee82511664d616e50b29c61ce2.tar.gz
org.eclipse.papyrus-a7be9ef2589bcbee82511664d616e50b29c61ce2.tar.bz2
[clean] Retiring org.eclipse.papyrus.uml.documentationlast/org.eclipse.papyrus.uml.documentation
Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/.classpath7
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/.project28
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/META-INF/MANIFEST.MF16
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/about.html28
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/build.properties7
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/plugin.properties12
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/plugin.xml23
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Activator.java45
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Messages.java32
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLAddOrRemoveAssociatedResourceCommand.java122
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLChangeDocumentationCommand.java193
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLDocumentationManager.java152
-rw-r--r--deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/messages.properties2
13 files changed, 0 insertions, 667 deletions
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/.classpath b/deprecated/org.eclipse.papyrus.uml.documentation/.classpath
deleted file mode 100644
index 2d1a430..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/.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/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/.project b/deprecated/org.eclipse.papyrus.uml.documentation/.project
deleted file mode 100644
index a2dd101..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.documentation</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/deprecated/org.eclipse.papyrus.uml.documentation/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.uml.documentation/META-INF/MANIFEST.MF
deleted file mode 100644
index d984a68..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.papyrus.views.documentation;bundle-version="0.10.1",
- org.eclipse.uml2.uml,
- org.eclipse.papyrus.uml.documentation.profile;bundle-version="0.10.1",
- org.eclipse.core.runtime;bundle-version="3.8.0"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.1.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.documentation.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.documentation;singleton:=
- true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/about.html b/deprecated/org.eclipse.papyrus.uml.documentation/about.html
deleted file mode 100644
index 82d49bf..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/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/deprecated/org.eclipse.papyrus.uml.documentation/build.properties b/deprecated/org.eclipse.papyrus.uml.documentation/build.properties
deleted file mode 100644
index 972de33..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-#Mon Sep 12 09:29:51 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,about.html,plugin.properties
-output..=bin/
-src.includes = about.html
-source..=src/
-bin..=bin/
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/plugin.properties b/deprecated/org.eclipse.papyrus.uml.documentation/plugin.properties
deleted file mode 100644
index 1221470..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#################################################################################
-# Copyright (c) 2010 Atos Origin.
-# 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:
-# Atos Origin - Initial API and Implementation
-##################################################################################
-pluginName=UML implementation of Papyrus Documentation (Incubation)
-providerName=Eclipse Modeling Project
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/plugin.xml b/deprecated/org.eclipse.papyrus.uml.documentation/plugin.xml
deleted file mode 100644
index 27c9a11..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/plugin.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.views.documentation.documentationManager">
- <documentationManager
- managerClass="org.eclipse.papyrus.uml.documentation.UMLDocumentationManager"
- modelNsURI="http://www.eclipse.org/uml2/3.0.0/UML"
- priority="Lowest">
- </documentationManager>
- <documentationManager
- managerClass="org.eclipse.papyrus.uml.documentation.UMLDocumentationManager"
- modelNsURI="http://www.eclipse.org/uml2/2.1.0/UML"
- priority="Lowest">
- </documentationManager>
- <documentationManager
- managerClass="org.eclipse.papyrus.uml.documentation.UMLDocumentationManager"
- modelNsURI="http://www.eclipse.org/uml2/2.0.0/UML"
- priority="Lowest">
- </documentationManager>
- </extension>
-
-</plugin>
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Activator.java b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Activator.java
deleted file mode 100644
index 18e14cb..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Activator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.documentation;
-
-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/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Messages.java b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Messages.java
deleted file mode 100644
index 9933755..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/Messages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.documentation;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.documentation.messages"; //$NON-NLS-1$
-
- public static String UMLDocumentationManager_DocOnDocCommentError;
-
- public static String UMLDocumentationManager_NonUMLElementError;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLAddOrRemoveAssociatedResourceCommand.java b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLAddOrRemoveAssociatedResourceCommand.java
deleted file mode 100644
index 76b799b..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLAddOrRemoveAssociatedResourceCommand.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.documentation;
-
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.papyrus.uml.documentation.profile.IUMLDocumentationConstants;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-@SuppressWarnings("unchecked")
-public class UMLAddOrRemoveAssociatedResourceCommand extends AbstractCommand {
-
- private Element element;
-
- private Comment documentationComment = null;
-
- private Stereotype documentationStereotype = null;
-
- private Set<IDocumentationChangedListener> documentationChangedListeners;
-
- private boolean remove;
-
- private String resourceURIString;
-
- public UMLAddOrRemoveAssociatedResourceCommand(boolean remove, Element element, URI resourceURI, Set<IDocumentationChangedListener> documentationChangedListeners) {
- super(org.eclipse.papyrus.views.documentation.Messages.AddOrRemoveAssociatedResourceCommandLabel);
- this.remove = remove;
- this.element = element;
- this.resourceURIString = resourceURI.toString();
- this.documentationChangedListeners = documentationChangedListeners;
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @Override
- public boolean canUndo() {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void execute() {
- EList<Comment> ownedComments = element.getOwnedComments();
-
- for(Comment comment : ownedComments) {
- documentationStereotype = comment.getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME);
- if(documentationStereotype != null) {
- documentationComment = comment;
- break;
- }
- }
-
- redo();
- }
-
- private void notifyListeners() {
- for(IDocumentationChangedListener listener : documentationChangedListeners) {
- listener.documentationChanged(element);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void redo() {
- if (remove) {
- removeAssociatedResource();
- } else {
- addAssociatedResource();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void undo() {
- if (remove) {
- addAssociatedResource();
- } else {
- removeAssociatedResource();
- }
- }
-
- private void removeAssociatedResource() {
- if(documentationStereotype != null && documentationComment != null) {
- List<String> resourceURIs = (List<String>)documentationComment.getValue(documentationStereotype, IUMLDocumentationConstants.RESOURCE_PROPERTY_NAME);
- resourceURIs.remove(resourceURIString);
- notifyListeners();
- }
- }
-
- private void addAssociatedResource() {
- if(documentationStereotype != null && documentationComment != null) {
- List<String> resourceURIs = (List<String>)documentationComment.getValue(documentationStereotype, IUMLDocumentationConstants.RESOURCE_PROPERTY_NAME);
- resourceURIs.add(resourceURIString);
- notifyListeners();
- }
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLChangeDocumentationCommand.java b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLChangeDocumentationCommand.java
deleted file mode 100644
index cd43fc1..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLChangeDocumentationCommand.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.documentation;
-
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.papyrus.uml.documentation.profile.IUMLDocumentationConstants;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * A GEF Command use to update documentation using profiled Comment.
- *
- */
-public class UMLChangeDocumentationCommand extends AbstractCommand {
-
- private Element element;
-
- private String newComment;
-
- private String oldComment;
-
- private Comment documentationComment = null;
-
- private Stereotype documentationStereotype = null;
-
- private boolean profileWasAlreadyApplied = false;
-
- private Set<IDocumentationChangedListener> documentationChangedListeners;
-
- public UMLChangeDocumentationCommand(Element element, String newDocumentation, Set<IDocumentationChangedListener> documentationChangedListeners) {
- super(org.eclipse.papyrus.views.documentation.Messages.ChangeDocCommandLabel);
- this.element = element;
- this.newComment = newDocumentation;
- this.documentationChangedListeners = documentationChangedListeners;
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @Override
- public boolean canUndo() {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void execute() {
-
- profileWasAlreadyApplied = element.getNearestPackage().getAppliedProfile(IUMLDocumentationConstants.PROFILE_NAME, true) != null;
-
- // stores the previous doc
- oldComment = null;
-
- EList<Comment> ownedComments = element.getOwnedComments();
-
- for(Comment comment : ownedComments) {
- documentationStereotype = comment.getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME);
- if(documentationStereotype != null) {
- documentationComment = comment;
- break;
- }
- }
-
- if(documentationComment != null) {
- oldComment = documentationComment.getBody();
- }
-
- redo();
- }
-
- private void notifyListeners() {
- for(IDocumentationChangedListener listener : documentationChangedListeners) {
- listener.documentationChanged(element);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void redo() {
- changeDocumentation(newComment);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void undo() {
- changeDocumentation(oldComment);
- }
-
- private IStatus changeDocumentation(String newDoc) {
- if(newDoc != null) {
- if(documentationComment == null) {
- documentationComment = UMLFactory.eINSTANCE.createComment();
- element.getOwnedComments().add(documentationComment);
- applyDocumentationStereotype(documentationComment);
- }
-
- documentationComment.setBody(newDoc);
- } else {
- removeDocumentation();
- }
- notifyListeners();
- return Status.OK_STATUS;
- }
-
- private void removeDocumentation() {
- if(documentationComment != null) {
- Stereotype documentationStereotype = documentationComment.getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME);
- if(documentationStereotype != null) {
- documentationComment.unapplyStereotype(documentationStereotype);
- }
- element.getOwnedComments().remove(documentationComment);
- documentationComment = null;
- }
-
- // remove profile application if not applied before
- if(!profileWasAlreadyApplied) {
- Profile documentationProfile = element.getNearestPackage().getAppliedProfile(IUMLDocumentationConstants.PROFILE_NAME, true);
- if(documentationProfile != null) {
- element.getNearestPackage().unapplyProfile(documentationProfile);
- }
- }
- }
-
- public void applyDocumentationStereotype(Comment comment) {
-
- Profile documentationProfile = element.getNearestPackage().getAppliedProfile(IUMLDocumentationConstants.PROFILE_NAME, true);
-
- if(documentationProfile == null) {
- ResourceSet rs = null;
- Resource resource = element.eResource();
- if(resource != null) {
- rs = resource.getResourceSet();
- }
- if (rs == null) {
- rs = new ResourceSetImpl();
- }
-
- Resource papyrusProfileResource = rs.getResource(URI.createURI(IUMLDocumentationConstants.PROFILE_URI), true);
-
- if(papyrusProfileResource != null && !papyrusProfileResource.getContents().isEmpty() && papyrusProfileResource.getContents().get(0) instanceof Profile) {
- Profile papyrusProfile = (Profile)papyrusProfileResource.getContents().get(0);
-
- NamedElement possibleDocumentationProfile = papyrusProfile.getMember(IUMLDocumentationConstants.DOCUMENTATION_SUB_PROFILE_NAME);
-
- if (possibleDocumentationProfile instanceof Profile) {
- documentationProfile = (Profile)possibleDocumentationProfile;
- element.getNearestPackage().applyProfile(documentationProfile);
- }
- }
-
- }
-
- if (documentationProfile != null) {
- Stereotype documentationStereotype = documentationProfile.getOwnedStereotype(IUMLDocumentationConstants.STEREOTYPE_NAME);
-
- if(documentationStereotype != null) {
- comment.applyStereotype(documentationStereotype);
- }
- }
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLDocumentationManager.java b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLDocumentationManager.java
deleted file mode 100644
index 7e98e92..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/UMLDocumentationManager.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.documentation;
-
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.uml.documentation.profile.IUMLDocumentationConstants;
-import org.eclipse.papyrus.views.documentation.DocumentationUnsupportedException;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.papyrus.views.documentation.IDocumentationManager;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-
-public class UMLDocumentationManager implements IDocumentationManager {
-
- private static class UMLDocumentationManagerHolder {
-
- public static final UMLDocumentationManager instance = new UMLDocumentationManager();
- }
-
- public static UMLDocumentationManager getInstance() {
- return UMLDocumentationManagerHolder.instance;
- }
-
- private static Set<IDocumentationChangedListener> documentationChangedListeners = new HashSet<IDocumentationChangedListener>();
-
- /**
- * {@inheritDoc}
- */
- public Command getChangeDocumentationCommand(EObject eObject, String newDocumentation) {
- if (getUnsupportedErrorMessage(eObject) == null) {
- return new UMLChangeDocumentationCommand((Element)eObject, newDocumentation, documentationChangedListeners);
- } else {
- return null;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDocumentation(EObject eObject) throws DocumentationUnsupportedException {
- String errorMsg = getUnsupportedErrorMessage(eObject);
- if (errorMsg == null) {
- EList<Comment> ownedComments = ((Element)eObject).getOwnedComments();
-
- for(Comment comment : ownedComments) {
- if(comment.getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME) != null) {
- return comment.getBody();
- }
- }
- return null;
- } else {
- throw new DocumentationUnsupportedException(errorMsg);
- }
- }
-
- @SuppressWarnings("unchecked")
- public List<URI> getAssociatedResources(EObject eObject) throws DocumentationUnsupportedException {
- String errorMsg = getUnsupportedErrorMessage(eObject);
- if (errorMsg == null) {
- List<URI> URIs = new LinkedList<URI>();
- EList<Comment> ownedComments = ((Element)eObject).getOwnedComments();
-
- for(Comment comment : ownedComments) {
- Stereotype docStereotype = comment.getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME);
- if(docStereotype != null) {
- List<String> stringURIs = (List<String>)comment.getValue(docStereotype, IUMLDocumentationConstants.RESOURCE_PROPERTY_NAME);
- for (String stringURI : stringURIs) {
- URIs.add(URI.createURI(stringURI));
- }
- }
- }
- return URIs;
- } else {
- throw new DocumentationUnsupportedException(errorMsg);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void registerDocumentationChangedListener(IDocumentationChangedListener listener) {
- documentationChangedListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- public void unregisterDocumentationChangedListener(IDocumentationChangedListener listener) {
- documentationChangedListeners.remove(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- public Set<IDocumentationChangedListener> getRegisteredDocumentationChangedListeners() {
- return documentationChangedListeners;
- }
-
- /**
- * get an error message if eObject is unsupported by this implementation
- * @param eObject
- * @return null if documentation is supported or an error message if not
- */
- private static String getUnsupportedErrorMessage(EObject eObject) {
- // can't have a documentation on a documentation comment
- if(eObject instanceof Comment && ((Comment)eObject).getAppliedStereotype(IUMLDocumentationConstants.STEREOTYPE_QUALIFIED_NAME) != null) {
- return Messages.UMLDocumentationManager_DocOnDocCommentError;
- } else if(eObject instanceof Element) {
- // OK, return null
- return null;
- } else {
- return Messages.UMLDocumentationManager_NonUMLElementError;
- }
- }
-
- public Command getAddAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- if (getUnsupportedErrorMessage(eObject) == null) {
- return new UMLAddOrRemoveAssociatedResourceCommand(false, (Element)eObject, resourceURI, documentationChangedListeners);
- } else {
- return null;
- }
- }
-
- public Command getRemoveAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- if (getUnsupportedErrorMessage(eObject) == null) {
- return new UMLAddOrRemoveAssociatedResourceCommand(true, (Element)eObject, resourceURI, documentationChangedListeners);
- } else {
- return null;
- }
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/messages.properties b/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/messages.properties
deleted file mode 100644
index 09c53a6..0000000
--- a/deprecated/org.eclipse.papyrus.uml.documentation/src/org/eclipse/papyrus/uml/documentation/messages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-UMLDocumentationManager_DocOnDocCommentError=Documentation on documentation comment unsupported
-UMLDocumentationManager_NonUMLElementError=Documentation on non UML element unsupported by this implementation