Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java4
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java18
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java4
4 files changed, 27 insertions, 2 deletions
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
index 55efa092d01..0e073e6a5e1 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
@@ -27,4 +27,8 @@ import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
*/
public class PapyrusMultiDiagramEditor extends CoreMultiDiagramEditor {
+ /**
+ * The Papyrus Editor ID
+ */
+ public static final String EDITOR_ID = "org.eclipse.papyrus.infra.core.papyrusEditor"; //$NON-NLS-1$
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
index f8a2129c2d4..1a94add81ee 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core;bundle-version="0.10.0",
org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.0",
- org.eclipse.papyrus.uml.tools;bundle-version="0.10.0"
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.0",
+ org.eclipse.papyrus.editor;bundle-version="0.10.0"
Export-Package: org.eclipse.papyrus.junit.utils
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java
index 87b399f826b..43a386cb2a8 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java
@@ -14,6 +14,8 @@
package org.eclipse.papyrus.junit.utils;
import org.eclipse.core.resources.IFile;
+import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
@@ -49,4 +51,20 @@ public class EditorUtils {
return editor;
}
+ /**
+ * Opens the file with the Papyrus Editor
+ *
+ * @param file
+ * @return
+ * @throws PartInitException
+ */
+ public static final IMultiDiagramEditor openPapyrusEditor(final IFile file) throws PartInitException {
+ GenericUtils.closeIntroPart();
+ final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editor = null;
+ editor = IDE.openEditor(activePage, file, PapyrusMultiDiagramEditor.EDITOR_ID);
+ Assert.assertNotNull(editor);
+ return (IMultiDiagramEditor)editor;
+ }
+
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java
index f065b769fa7..e0ba2a4bc85 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java
@@ -40,7 +40,7 @@ public class PapyrusProjectUtils {
* @throws IOException
* @throws CoreException
*/
- public static final void copyPapyrusModel(final IProject project, final Bundle bundle, final String sourcePath, final String fileRootName) throws CoreException, IOException {
+ public static final IFile copyPapyrusModel(final IProject project, final Bundle bundle, final String sourcePath, final String fileRootName) throws CoreException, IOException {
final IFile emptyModel_di = project.getFile(fileRootName + "." + SashModel.MODEL_FILE_EXTENSION);
final IFile emptyModel_no = project.getFile(fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION);
final IFile emptyModel_uml = project.getFile(fileRootName + "." + UmlModel.UML_FILE_EXTENSION);
@@ -48,5 +48,7 @@ public class PapyrusProjectUtils {
emptyModel_di.create(bundle.getResource(sourcePath + fileRootName + "." + SashModel.MODEL_FILE_EXTENSION).openStream(), true, new NullProgressMonitor());
emptyModel_no.create(bundle.getResource(sourcePath + fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION).openStream(), true, new NullProgressMonitor());
emptyModel_uml.create(bundle.getResource(sourcePath + fileRootName + "." + UmlModel.UML_FILE_EXTENSION).openStream(), true, new NullProgressMonitor());
+
+ return emptyModel_di;
}
}

Back to the top