Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-07-03 19:24:11 +0000
committerChristian W. Damus2015-07-03 20:34:36 +0000
commit034320805ee2f44b9487ffb704d240a85fefa569 (patch)
tree399672c01af0faa5fd711e5e730275ffb6a050ad
parent1680f62e487ece46a856ed9b66615c8be3c60f47 (diff)
downloadorg.eclipse.papyrus-034320805ee2f44b9487ffb704d240a85fefa569.tar.gz
org.eclipse.papyrus-034320805ee2f44b9487ffb704d240a85fefa569.tar.xz
org.eclipse.papyrus-034320805ee2f44b9487ffb704d240a85fefa569.zip
Bug 471836: [DevTools] The oep.uml.developer.mde plug-in should be in the developer feature
https://bugs.eclipse.org/bugs/show_bug.cgi?id=471836 Add the developer documentation modeling plug-in to the developer tools feature. Also fix the generation of wiki text to calculate the selected model's project so that it doesn't fail on every attempt to generate. Change-Id: I22eae620ae8707bcc9fb113b158046a6ff4e0d72
-rw-r--r--features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml9
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java19
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java20
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/IDMAbstractHandler.java14
4 files changed, 24 insertions, 38 deletions
diff --git a/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml b/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml
index e9d90665f92..b2857469707 100644
--- a/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml
+++ b/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml
@@ -6,7 +6,7 @@
provider-name="Eclipse Modeling Project">
<copyright url="http://www.eclipse.org/legal/epl-v10.html">
- Copyright (c) 2014, 2014 CEA LIST, Christian W. Damus, and others.
+ Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -120,6 +120,13 @@ http://www.eclipse.org/legal/epl-v10.html
unpack="false"/>
<plugin
+ id="org.eclipse.papyrus.uml.developer.mde"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
id="org.eclipse.b3.aggregator"
download-size="0"
install-size="0"
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
index 3280610d653..fd228189001 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
@@ -10,6 +10,7 @@
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 468079
+ * Christian W. Damus - bug 471836
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.handler;
@@ -17,9 +18,6 @@ package org.eclipse.papyrus.uml.developper.mde.handler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.papyrus.uml.developper.mde.I_DeveloperIDMStereotype;
import org.eclipse.papyrus.uml.developper.mde.command.CreateDocumentModelCommand;
import org.eclipse.papyrus.uml.developper.mde.transcription.HTMLTranscription;
@@ -56,21 +54,6 @@ public class GetHTMLTextHandler extends IDMAbstractHandler {
return null;
}
- private IProject getCurrentProject() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- IProject project = root.getProject();
- String path = getSelection().eResource().getURI().path();
- String tmpPath = path.replaceAll("/resource/", "");
- for (IProject currentProject : root.getProjects()) {
- if (tmpPath.startsWith(currentProject.getName())) {
- project = currentProject;
-
- }
- }
- return project;
- }
-
@Override
public boolean isEnabled() {
if (getSelection() instanceof Model) {
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
index fac26701a59..3c925c0a180 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
@@ -10,6 +10,7 @@
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 468079
+ * Christian W. Damus - bug 471836
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.handler;
@@ -17,9 +18,6 @@ package org.eclipse.papyrus.uml.developper.mde.handler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.papyrus.uml.developper.mde.I_DeveloperIDMStereotype;
import org.eclipse.papyrus.uml.developper.mde.command.CreateDocumentModelCommand;
import org.eclipse.papyrus.uml.developper.mde.transcription.TranscriptionEngine;
@@ -53,22 +51,6 @@ public class GetWikiTextHandler extends IDMAbstractHandler {
return null;
}
-
- private IProject getCurrentProject() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- IProject project = root.getProject();
- String path = getSelection().eResource().getURI().path();
- for (IProject currentProject : root.getProjects()) {
- if (path.contains(currentProject.getName())) {
- project = currentProject;
- }
- }
- return project;
- }
-
-
-
@Override
public boolean isEnabled() {
if (getSelection() instanceof Model) {
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/IDMAbstractHandler.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/IDMAbstractHandler.java
index 9d5ac7d9b6d..6bbd14fe10d 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/IDMAbstractHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/IDMAbstractHandler.java
@@ -10,6 +10,7 @@
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 468079
+ * Christian W. Damus - bug 471836
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.handler;
@@ -22,6 +23,12 @@ import java.util.Map;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ISelection;
@@ -121,6 +128,13 @@ public abstract class IDMAbstractHandler extends AbstractHandler {
return selectedSet;
}
+ protected IProject getCurrentProject() {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IWorkspaceRoot root = workspace.getRoot();
+ IPath path = new Path(getSelection().eResource().getURI().toPlatformString(true));
+ return root.getProject(path.segment(0));
+ }
+
public static void clear() {
elt2DocElt.clear();
href2DocHREF.clear();

Back to the top