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 /plugins/developer
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
Diffstat (limited to 'plugins/developer')
-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
3 files changed, 16 insertions, 37 deletions
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