summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-04-04 10:17:25 (EDT)
committerLaurent Wouters2014-04-04 10:17:25 (EDT)
commit0ea91ae364d5f65ad0dace367aa3fef7fa8d1377 (patch)
treec8b13edc1e16632aae3d37070f03fb2d4fb1b9b4
parent0e07a6ec6b665e9ae7a31d4b9ac3e962c748c598 (diff)
downloadorg.eclipse.papyrus-0ea91ae364d5f65ad0dace367aa3fef7fa8d1377.zip
org.eclipse.papyrus-0ea91ae364d5f65ad0dace367aa3fef7fa8d1377.tar.gz
org.eclipse.papyrus-0ea91ae364d5f65ad0dace367aa3fef7fa8d1377.tar.bz2
[clean] Retiring org.eclipse.papyrus.views.documentationlast/org.eclipse.papyrus.views.documentation
Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/.classpath7
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/.project28
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/META-INF/MANIFEST.MF17
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/about.html28
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/build.properties7
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/plugin.properties12
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/plugin.xml6
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/schema/documentationManager.exsd100
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Activator.java43
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManager.java131
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManagerRegistry.java148
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationUnsupportedException.java27
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationChangedListener.java32
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationManager.java105
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Messages.java38
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/AddOrRemoveAssociatedResourceCommand.java152
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/ChangeEAnnotationCommand.java150
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/EAnnotationDocumentationManager.java161
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/IEAnnotationConstants.java28
-rw-r--r--deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/messages.properties5
20 files changed, 0 insertions, 1225 deletions
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/.classpath b/deprecated/org.eclipse.papyrus.views.documentation/.classpath
deleted file mode 100644
index 2d1a430..0000000
--- a/deprecated/org.eclipse.papyrus.views.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.views.documentation/.project b/deprecated/org.eclipse.papyrus.views.documentation/.project
deleted file mode 100644
index 6f2cf1d..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.views.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.views.documentation/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.views.documentation/META-INF/MANIFEST.MF
deleted file mode 100644
index c8fbb49..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
- org.eclipse.core.runtime,
- org.eclipse.core.commands
-Export-Package: org.eclipse.papyrus.views.documentation,
- org.eclipse.papyrus.views.documentation.eannotation
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.1.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.views.documentation.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.views.documentation;singleton
- :=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/about.html b/deprecated/org.eclipse.papyrus.views.documentation/about.html
deleted file mode 100644
index 82d49bf..0000000
--- a/deprecated/org.eclipse.papyrus.views.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.views.documentation/build.properties b/deprecated/org.eclipse.papyrus.views.documentation/build.properties
deleted file mode 100644
index fc75f29..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-#Mon Sep 12 09:29:50 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,schema/,plugin.properties,about.html
-output..=bin/
-src.includes = about.html
-source..=src/
-bin..=bin/
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/plugin.properties b/deprecated/org.eclipse.papyrus.views.documentation/plugin.properties
deleted file mode 100644
index 9d6c640..0000000
--- a/deprecated/org.eclipse.papyrus.views.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=Papyrus documentation manager (Incubation)
-providerName=Eclipse Modeling Project
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/plugin.xml b/deprecated/org.eclipse.papyrus.views.documentation/plugin.xml
deleted file mode 100644
index 21020b3..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/plugin.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension-point id="documentationManager" name="documentationManager" schema="schema/documentationManager.exsd"/>
-
-</plugin>
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/schema/documentationManager.exsd b/deprecated/org.eclipse.papyrus.views.documentation/schema/documentationManager.exsd
deleted file mode 100644
index 1ca36d9..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/schema/documentationManager.exsd
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.views.documentation" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.views.documentation" id="modelDocumentationManager" name="modelDocumentationManager"/>
- </appinfo>
- <documentation>
- This extension is used to provide a way to get and set a documentation for an element of a specific meta-model.
-A generic implementation using EAnnotation on EModelElement is used if no other implementation is found for the current meta-model.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="documentationManager" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="documentationManager">
- <complexType>
- <attribute name="modelNsURI" type="string" use="required">
- <annotation>
- <documentation>
- The nsURI of the meta-model for which this implementation applies.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="managerClass" type="string" use="required">
- <annotation>
- <documentation>
- The implementation for the specified meta-model.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.views.documentation.registry.IDocumentationManager"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="priority">
- <annotation>
- <documentation>
- This attribute is used to specify the priority of the contributed documentationManager.
-The documentationManager with the higher priority will be used. The behavior is unspecified if more than one documentationManager have the same modelNsURI and the same priority. Default value is Lowest.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Lowest">
- </enumeration>
- <enumeration value="Low">
- </enumeration>
- <enumeration value="Medium">
- </enumeration>
- <enumeration value="High">
- </enumeration>
- <enumeration value="Highest">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
-
-</schema>
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Activator.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Activator.java
deleted file mode 100644
index fb0b9db..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Activator.java
+++ /dev/null
@@ -1,43 +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.views.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.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManager.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManager.java
deleted file mode 100644
index 0735303..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManager.java
+++ /dev/null
@@ -1,131 +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.views.documentation;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-
-
-/**
- * Helper class to access and modify documentation independently from the meta-model.
- * It also provides an easy way to be notified of documentation change.
- * The default implementation {@link EAnnotationDocumentationManager} uses an EAnnotation if it is available.
- *
- * @author mvelten
- *
- */
-public class DocumentationManager extends DocumentationManagerRegistry implements IDocumentationManager {
-
- private static class DocumentationManagerHolder {
-
- public static final DocumentationManager instance = new DocumentationManager();
- }
-
- public static DocumentationManager getInstance() {
- return DocumentationManagerHolder.instance;
- }
-
- private static Set<IDocumentationChangedListener> documentationChangedListeners = new HashSet<IDocumentationChangedListener>();
-
- /**
- * {@inheritDoc}
- */
- public String getDocumentation(EObject eObject) throws DocumentationUnsupportedException {
- if (eObject != null) {
- IDocumentationManager documentationManager = getDocumentationManager(eObject.eClass().getEPackage().getNsURI());
- if(documentationManager != null) {
- return documentationManager.getDocumentation(eObject);
- }
- }
- throw new DocumentationUnsupportedException(Messages.DocumentationManager_UnsupportedModelType);
- }
-
- /**
- * {@inheritDoc}
- */
- public Command getChangeDocumentationCommand(EObject eObject, String newDocumentation) {
- IDocumentationManager documentationManager = getDocumentationManager(eObject.eClass().getEPackage().getNsURI());
- if(documentationManager != null) {
- return documentationManager.getChangeDocumentationCommand(eObject, newDocumentation);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public Command getAddAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- IDocumentationManager documentationManager = getDocumentationManager(eObject.eClass().getEPackage().getNsURI());
- if(documentationManager != null) {
- return documentationManager.getAddAssociatedResourceCommand(eObject, resourceURI);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public Command getRemoveAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- IDocumentationManager documentationManager = getDocumentationManager(eObject.eClass().getEPackage().getNsURI());
- if(documentationManager != null) {
- return documentationManager.getRemoveAssociatedResourceCommand(eObject, resourceURI);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<URI> getAssociatedResources(EObject eObject) throws DocumentationUnsupportedException {
- IDocumentationManager documentationManager = getDocumentationManager(eObject.eClass().getEPackage().getNsURI());
- if(documentationManager != null) {
- return documentationManager.getAssociatedResources(eObject);
- } else {
- throw new DocumentationUnsupportedException(Messages.DocumentationManager_UnsupportedModelType);
- }
- }
-
- /**
- * {@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;
- }
-
- public void documentationChanged(EObject eObject) {
- for(IDocumentationChangedListener listener : documentationChangedListeners) {
- listener.documentationChanged(eObject);
- }
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManagerRegistry.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManagerRegistry.java
deleted file mode 100644
index c0560d8..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationManagerRegistry.java
+++ /dev/null
@@ -1,148 +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.views.documentation;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.PriorityQueue;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.papyrus.views.documentation.eannotation.EAnnotationDocumentationManager;
-
-public abstract class DocumentationManagerRegistry implements IDocumentationChangedListener {
-
- // extension point ID
- private static final String MODELDOCUMENTATION_EXTENSION_ID = "org.eclipse.papyrus.views.documentation.documentationManager"; //$NON-NLS-1$
-
- private static final String MODELNSURI_ID = "modelNsURI"; //$NON-NLS-1$
-
- private static final String PRIORITY_ID = "priority"; //$NON-NLS-1$
-
- private static final String MODELDOCUMENTATIONCLASS_ID = "managerClass"; //$NON-NLS-1$
-
- // Lowest is default
- private static final Integer DEFAULT_PRIORITY = 0;
-
-
- private Map<String, PriorityQueue<IDocumentationManager>> nsURIDocumentationManagerMap = new HashMap<String, PriorityQueue<IDocumentationManager>>();
-
- private Map<IDocumentationManager, Integer> documentationManagerPriorityMap = new HashMap<IDocumentationManager, Integer>();
-
- private IDocumentationManager eAnnotationDocumentationManager;
-
- public DocumentationManagerRegistry() {
- eAnnotationDocumentationManager = EAnnotationDocumentationManager.getInstance();
- eAnnotationDocumentationManager.registerDocumentationChangedListener(this);
- initializeMap();
- }
-
- protected IDocumentationManager getDocumentationManager(String nsURI) {
- IDocumentationManager documentationManager = null;
-
- PriorityQueue<IDocumentationManager> documentationManagers = nsURIDocumentationManagerMap.get(nsURI);
- if(documentationManagers != null) {
- documentationManager = documentationManagers.peek();
- }
-
- if(documentationManager == null) {
- return eAnnotationDocumentationManager;
- }
-
- return documentationManager;
- }
-
- private void initializeMap() {
- // Reading data from plugins
- IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(MODELDOCUMENTATION_EXTENSION_ID);
- for(int i = 0; i < configElements.length; i++) {
- initializeOne(configElements[i]);
- }
- }
-
- private void initializeOne(IConfigurationElement iConfigurationElement) {
- try {
- String modelNsURI = iConfigurationElement.getAttribute(MODELNSURI_ID);
-
- IDocumentationManager documentationManager = (IDocumentationManager)createExtension(iConfigurationElement, MODELDOCUMENTATIONCLASS_ID);
- documentationManager.registerDocumentationChangedListener(this);
-
- String priority = iConfigurationElement.getAttribute(PRIORITY_ID);
- documentationManagerPriorityMap.put(documentationManager, convertPriorityToInteger(priority));
-
- PriorityQueue<IDocumentationManager> documentationManagers = nsURIDocumentationManagerMap.get(modelNsURI);
- if(documentationManagers == null) {
- documentationManagers = new PriorityQueue<IDocumentationManager>(10, new Comparator<IDocumentationManager>() {
-
- public int compare(IDocumentationManager o1, IDocumentationManager o2) {
- Integer p1 = documentationManagerPriorityMap.get(o1);
- if(p1 == null) {
- p1 = DEFAULT_PRIORITY;
- }
- Integer p2 = documentationManagerPriorityMap.get(o2);
- if(p2 == null) {
- p2 = DEFAULT_PRIORITY;
- }
- return p2 - p1;
- }
- });
-
- nsURIDocumentationManagerMap.put(modelNsURI, documentationManagers);
- }
- documentationManagers.add(documentationManager);
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- private static Integer convertPriorityToInteger(String priorityString) {
- if(priorityString == null) {
- return DEFAULT_PRIORITY;
- }
- if(priorityString.equalsIgnoreCase("Lowest")) { //$NON-NLS-1$
- return 0;
- }
- if(priorityString.equalsIgnoreCase("Low")) { //$NON-NLS-1$
- return 1;
- }
- if(priorityString.equalsIgnoreCase("Medium")) { //$NON-NLS-1$
- return 2;
- }
- if(priorityString.equalsIgnoreCase("High")) { //$NON-NLS-1$
- return 3;
- }
- if(priorityString.equalsIgnoreCase("Highest")) { //$NON-NLS-1$
- return 4;
- }
- return DEFAULT_PRIORITY;
- }
-
- /**
- * Load an instance of a class
- *
- * @param element
- * the extension point
- * @param classAttribute
- * the name of the class to load
- * @return the loaded Class
- * @throws Exception
- * if the class is not loaded
- */
- private static Object createExtension(final IConfigurationElement element, final String classAttribute) throws Exception {
- return element.createExecutableExtension(classAttribute);
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationUnsupportedException.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationUnsupportedException.java
deleted file mode 100644
index 457b78a..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/DocumentationUnsupportedException.java
+++ /dev/null
@@ -1,27 +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.views.documentation;
-
-public class DocumentationUnsupportedException extends Exception {
-
- private static final long serialVersionUID = -5469193051315476642L;
-
- public DocumentationUnsupportedException() {
- super();
- }
-
- public DocumentationUnsupportedException(String message) {
- super(message);
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationChangedListener.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationChangedListener.java
deleted file mode 100644
index dea2e16..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationChangedListener.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.views.documentation;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * Listener interface used to be notified of a change in the documentation.
- *
- * @author mvelten
- *
- */
-public interface IDocumentationChangedListener {
-
- /**
- * This method will be called when the documentation of eObject or its author is modified.
- *
- * @param eObject
- */
- void documentationChanged(EObject eObject);
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationManager.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationManager.java
deleted file mode 100644
index 3a4ea21..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/IDocumentationManager.java
+++ /dev/null
@@ -1,105 +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.views.documentation;
-
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-
-
-/**
- * Interface used to provide a way to get or change the documentation of an element.
- *
- * @author mvelten
- *
- */
-public interface IDocumentationManager {
-
- /**
- * Returns an EMF Command to change the documentation.
- *
- * @param eObject
- * The element where to change the documentation.
- * @param newDocumentation
- * The new value of the documentation or null to remove it.
- * @return the command to execute or null if this element can not host a documentation.
- */
- public Command getChangeDocumentationCommand(EObject eObject, String newDocumentation);
-
- /**
- * Returns an EMF Command to add an associated resource to the element.
- *
- * @param eObject
- * The element where to add the associated resource.
- * @param resourceURI
- * the URI of the resource.
- * @return the command to execute or null if this element can not host a documentation.
- */
- public Command getAddAssociatedResourceCommand(EObject eObject, URI resourceURI);
-
- /**
- * Returns an EMF Command to remove an associated resource from the element.
- *
- * @param eObject
- * The element where to remove the associated resource.
- * @param resourceURI
- * the URI of the resource.
- * @return the command to execute or null if this element can not host a documentation.
- */
- public Command getRemoveAssociatedResourceCommand(EObject eObject, URI resourceURI);
-
- /**
- * Returns the documentation of an element.
- *
- * @param eObject
- * The element where to look for the documentation.
- * @return The documentation or null if there is no documentation.
- * @throws DocumentationUnsupportedException
- * if documentation is not supported on this element.
- */
- public String getDocumentation(EObject eObject) throws DocumentationUnsupportedException;
-
- /**
- * Returns the associated resources of the element.
- *
- * @param eObject
- * The element where to look for the associated resources.
- * @return a list of resource URIs.
- * @throws DocumentationUnsupportedException
- * if documentation is not supported on this element.
- */
- public List<URI> getAssociatedResources(EObject eObject) throws DocumentationUnsupportedException;
-
- /**
- * Register a IDocumentationChangedListener (see {@link IDocumentationChangedListener}).
- *
- * @param listener
- */
- public void registerDocumentationChangedListener(IDocumentationChangedListener listener);
-
- /**
- * Unregister a IDocumentationChangedListener (see {@link IDocumentationChangedListener}).
- *
- * @param listener
- */
- public void unregisterDocumentationChangedListener(IDocumentationChangedListener listener);
-
- /**
- * @return the registered IDocumentationChangedListeners.
- */
- public Set<IDocumentationChangedListener> getRegisteredDocumentationChangedListeners();
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Messages.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Messages.java
deleted file mode 100644
index 4902e80..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/Messages.java
+++ /dev/null
@@ -1,38 +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.views.documentation;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.views.documentation.messages"; //$NON-NLS-1$
-
- public static String AddOrRemoveAssociatedResourceCommandLabel;
-
- public static String ChangeDocCommandLabel;
-
- public static String DocumentationManager_UnsupportedModelType;
-
- public static String EAnnotationDocumentationManager_DocOnDocEAnnotationError;
-
- public static String EAnnotationDocumentationManager_NonEModelElementError;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/AddOrRemoveAssociatedResourceCommand.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/AddOrRemoveAssociatedResourceCommand.java
deleted file mode 100644
index d7c3ddb..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/AddOrRemoveAssociatedResourceCommand.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.views.documentation.eannotation;
-
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.util.EMap;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.papyrus.views.documentation.Messages;
-
-
-public class AddOrRemoveAssociatedResourceCommand extends AbstractCommand {
-
- private boolean remove;
-
- private EModelElement element;
-
- private Set<IDocumentationChangedListener> documentationChangedListeners;
-
- private String prefix;
-
- private String value;
-
- public AddOrRemoveAssociatedResourceCommand(boolean remove, EModelElement element, URI resourceURI, Set<IDocumentationChangedListener> documentationChangedListeners) {
- super(Messages.AddOrRemoveAssociatedResourceCommandLabel);
- this.remove = remove;
- this.element = element;
- this.documentationChangedListeners = documentationChangedListeners;
-
- if(resourceURI.isPlatform()) {
- prefix = IEAnnotationConstants.PREFIX_WORKSPACE_RESOURCE;
- value = resourceURI.toPlatformString(true);
- } else if(resourceURI.isFile()) {
- prefix = IEAnnotationConstants.PREFIX_EXTERNAL_RESOURCE;
- value = resourceURI.toFileString();
- } else {
- prefix = IEAnnotationConstants.PREFIX_REMOTE_RESOURCE;
- value = resourceURI.toString();
- }
- }
-
- private void notifyListeners() {
- for(IDocumentationChangedListener listener : documentationChangedListeners) {
- listener.documentationChanged(element);
- }
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @Override
- public boolean canUndo() {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void execute() {
- redo();
- }
-
- /**
- * {@inheritDoc}
- */
- public void redo() {
- if(remove) {
- removeAssociatedResource();
- } else {
- addAssociatedResource();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void undo() {
- if(remove) {
- addAssociatedResource();
- } else {
- removeAssociatedResource();
- }
- }
-
- private void addAssociatedResource() {
- EAnnotation annotation = element.getEAnnotation(IEAnnotationConstants.ASSOCIATED_RESOURCES_SOURCE);
- if(annotation == null) {
- annotation = EcoreFactory.eINSTANCE.createEAnnotation();
- annotation.setSource(IEAnnotationConstants.ASSOCIATED_RESOURCES_SOURCE);
- element.getEAnnotations().add(annotation);
- }
- if(prefix != null && value != null) {
- annotation.getDetails().put(getNewResourceKey(annotation, prefix, 0), value);
- notifyListeners();
- }
- }
-
- private void removeAssociatedResource() {
- EAnnotation annotation = element.getEAnnotation(IEAnnotationConstants.ASSOCIATED_RESOURCES_SOURCE);
- if(annotation != null && prefix != null && value != null) {
- EMap<String, String> details = annotation.getDetails();
- for(Entry<String, String> detail : details) {
- if(detail.getKey() != null && detail.getKey().startsWith(prefix) && value.equals(detail.getValue())) {
- details.remove(detail);
- break;
- }
- }
- if (details.isEmpty()) {
- element.getEAnnotations().remove(annotation);
- }
- notifyListeners();
- }
- }
-
- /**
- * Recursively compute a new resource key using its prefix, a starting index and a map of resources to create. It
- * also look in the existing resources to find a free index.
- *
- * @param resourcePrefix
- * the resource prefix to use
- * @param startIndex
- * the start index (ie : 0)
- * @return a new resource key
- */
- private String getNewResourceKey(EAnnotation annotation, String resourcePrefix, int startIndex) {
- String key = resourcePrefix + startIndex;
- if(annotation != null && annotation.getDetails().get(key) == null) {
- return key;
- }
-
- return getNewResourceKey(annotation, resourcePrefix, startIndex + 1);
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/ChangeEAnnotationCommand.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/ChangeEAnnotationCommand.java
deleted file mode 100644
index 127a8b1..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/ChangeEAnnotationCommand.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008 Anyware Technologies
- *
- * 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:
- * Jacques Lescot (Anyware Technologies) - initial API and implementation
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com
- **********************************************************************/
-package org.eclipse.papyrus.views.documentation.eannotation;
-
-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.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.papyrus.views.documentation.Messages;
-
-/**
- * A GEF Command use to update documentation EAnnotation when an EModelElement is selected.
- *
- * @author <a href="mailto:jacques.lescot@anyware-tech.com">Jacques LESCOT</a>
- * @author <a href="mailto:sebastien.gabel@c-s.fr">Sebastien GABEL</a>
- * @author Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com
- */
-public class ChangeEAnnotationCommand extends AbstractCommand {
-
- private EModelElement element;
-
- private String newValue;
-
- private String oldValue;
-
- private String source;
-
- private String key;
-
- private Set<IDocumentationChangedListener> documentationChangedListeners;
-
- /**
- * Constructor
- *
- * @param element
- * the EModelElement
- * @param newValue
- * the new documentation as a String
- */
- public ChangeEAnnotationCommand(EModelElement element, String source, String key, String newValue, Set<IDocumentationChangedListener> documentationChangedListeners) {
- super(Messages.ChangeDocCommandLabel);
- this.element = element;
- this.source = source;
- this.key = key;
- this.newValue = newValue;
- this.documentationChangedListeners = documentationChangedListeners;
- }
-
-
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
-
-
- @Override
- public boolean canUndo() {
- return true;
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- public void execute() {
- // stores the previous doc
- oldValue = null;
- EAnnotation annotation = element.getEAnnotation(source);
- if(annotation != null) {
- oldValue = annotation.getDetails().get(key);
- }
-
- redo();
- }
-
- /**
- * {@inheritDoc}
- */
- public void redo() {
- changeDocumentation(element, newValue);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void undo() {
- changeDocumentation(element, oldValue);
- }
-
- private void notifyListeners(String currentDoc) {
- for (IDocumentationChangedListener listener : documentationChangedListeners) {
- listener.documentationChanged(element);
- }
- }
-
- /**
- * Set the documentation for the given Model Element
- *
- * @param elt
- * the element to document
- * @param newDoc
- * the documentation text
- */
- protected IStatus changeDocumentation(EModelElement elt, String newDoc) {
- EAnnotation annotation = elt.getEAnnotation(source);
- if(newDoc != null && !"".equals(newDoc)) { //$NON-NLS-1$
- // creates EAnnotation if needed
- if(annotation == null) {
- annotation = EcoreFactory.eINSTANCE.createEAnnotation();
- annotation.setSource(source);
- elt.getEAnnotations().add(annotation);
- }
-
- annotation.getDetails().put(key, newDoc);
- } else {
- // remove the documentation
- if(annotation != null) {
- annotation.getDetails().remove(key);
-
- // remove the EAnnotation if empty
- if(annotation.getDetails().isEmpty()) {
- elt.getEAnnotations().remove(annotation);
- }
- }
- }
- notifyListeners(newDoc);
-
- return Status.OK_STATUS;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/EAnnotationDocumentationManager.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/EAnnotationDocumentationManager.java
deleted file mode 100644
index 7b2608f..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/EAnnotationDocumentationManager.java
+++ /dev/null
@@ -1,161 +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.views.documentation.eannotation;
-
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.EMap;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.views.documentation.DocumentationUnsupportedException;
-import org.eclipse.papyrus.views.documentation.IDocumentationChangedListener;
-import org.eclipse.papyrus.views.documentation.IDocumentationManager;
-import org.eclipse.papyrus.views.documentation.Messages;
-
-
-public class EAnnotationDocumentationManager implements IDocumentationManager {
-
- private static class EAnnotationDocumentationManagerHolder {
-
- public static final EAnnotationDocumentationManager instance = new EAnnotationDocumentationManager();
- }
-
- public static EAnnotationDocumentationManager getInstance() {
- return EAnnotationDocumentationManagerHolder.instance;
- }
-
- private static Set<IDocumentationChangedListener> documentationChangedListeners = new HashSet<IDocumentationChangedListener>();
-
- /**
- * {@inheritDoc}
- */
- public Command getChangeDocumentationCommand(EObject eObject, String newDocumentation) {
- if(getUnsupportedErrorMessage(eObject) == null) {
- return new ChangeEAnnotationCommand((EModelElement)eObject, IEAnnotationConstants.DOCUMENTATION_SOURCE, IEAnnotationConstants.DOCUMENTATION_KEY, newDocumentation, documentationChangedListeners);
- } else {
- return null;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDocumentation(EObject eObject) throws DocumentationUnsupportedException {
- String errorMsg = getUnsupportedErrorMessage(eObject);
- if(errorMsg == null) {
- EAnnotation annotation = ((EModelElement)eObject).getEAnnotation(IEAnnotationConstants.DOCUMENTATION_SOURCE);
- if(annotation != null) {
- return annotation.getDetails().get(IEAnnotationConstants.DOCUMENTATION_KEY);
- }
- return null;
- } else {
- throw new DocumentationUnsupportedException(errorMsg);
- }
- }
-
- public Command getAddAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- if(getUnsupportedErrorMessage(eObject) == null) {
- return new AddOrRemoveAssociatedResourceCommand(false, (EModelElement)eObject, resourceURI, documentationChangedListeners);
- } else {
- return null;
- }
- }
-
- public Command getRemoveAssociatedResourceCommand(EObject eObject, URI resourceURI) {
- if(getUnsupportedErrorMessage(eObject) == null) {
- return new AddOrRemoveAssociatedResourceCommand(true, (EModelElement)eObject, resourceURI, documentationChangedListeners);
- } else {
- return null;
- }
- }
-
- public List<URI> getAssociatedResources(EObject eObject) throws DocumentationUnsupportedException {
- String errorMsg = getUnsupportedErrorMessage(eObject);
- if(errorMsg == null) {
- EAnnotation annotation = ((EModelElement)eObject).getEAnnotation(IEAnnotationConstants.ASSOCIATED_RESOURCES_SOURCE);
- if(annotation != null) {
- return convertDetailsToURIs(annotation.getDetails());
- }
- return new LinkedList<URI>();
- } 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;
- }
-
- private static List<URI> convertDetailsToURIs(EMap<String, String> details) {
- List<URI> uris = new LinkedList<URI>();
- for(Entry<String, String> detail : details) {
- String value = detail.getValue();
-
- String prefix = detail.getKey().substring(0, 2);
- URI uri = null;
- if(IEAnnotationConstants.PREFIX_REMOTE_RESOURCE.equals(prefix)) {
- uri = URI.createURI(value, false);
- } else if(IEAnnotationConstants.PREFIX_EXTERNAL_RESOURCE.equals(prefix)) {
- uri = URI.createFileURI(value);
- } else if(IEAnnotationConstants.PREFIX_WORKSPACE_RESOURCE.equals(prefix)) {
- uri = URI.createPlatformResourceURI(value, true);
- }
- uris.add(uri);
- }
- return uris;
- }
-
- /**
- * get an error message if eObject is unsupported by this implementation
- *
- * @param eObject
- * @return null if it is ok or an error message if not
- */
- private static String getUnsupportedErrorMessage(EObject eObject) {
- // forbid doc on doc eannotation
- if(eObject instanceof EAnnotation && ((EAnnotation)eObject).getSource().equals(IEAnnotationConstants.DOCUMENTATION_SOURCE)) {
- return Messages.EAnnotationDocumentationManager_DocOnDocEAnnotationError;
- // Check whether the element is an EModelElement
- } else if(eObject instanceof EModelElement) {
- // OK, return null
- return null;
- } else {
- return Messages.EAnnotationDocumentationManager_NonEModelElementError;
- }
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/IEAnnotationConstants.java b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/IEAnnotationConstants.java
deleted file mode 100644
index f8251a7..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/eannotation/IEAnnotationConstants.java
+++ /dev/null
@@ -1,28 +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.views.documentation.eannotation;
-
-public abstract interface IEAnnotationConstants {
- public static final String DOCUMENTATION_SOURCE = "http://www.topcased.org/documentation"; //$NON-NLS-1$
-
- public static final String DOCUMENTATION_KEY = "documentation"; //$NON-NLS-1$
-
- public static final String ASSOCIATED_RESOURCES_SOURCE = "http://www.topcased.org/resources"; //$NON-NLS-1$
-
- public static final String PREFIX_WORKSPACE_RESOURCE = "WR"; //$NON-NLS-1$
-
- public static final String PREFIX_EXTERNAL_RESOURCE = "ER"; //$NON-NLS-1$
-
- public static final String PREFIX_REMOTE_RESOURCE = "RR"; //$NON-NLS-1$
-}
diff --git a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/messages.properties b/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/messages.properties
deleted file mode 100644
index 71288ec..0000000
--- a/deprecated/org.eclipse.papyrus.views.documentation/src/org/eclipse/papyrus/views/documentation/messages.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-AddOrRemoveAssociatedResourceCommandLabel=Add or remove associated resource
-ChangeDocCommandLabel=Change documentation
-DocumentationManager_UnsupportedModelType=Unsupported type of model
-EAnnotationDocumentationManager_DocOnDocEAnnotationError=Documentation on documentation EAnnotation unsupported
-EAnnotationDocumentationManager_NonEModelElementError=Documentation on non EModelElement unsupported by this implementation