Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2019-07-05 07:16:13 +0000
committervincent lorenzo2019-07-08 08:18:23 +0000
commitb0360efe8740a4fe6e0baf8d3f15048cce1d0bc0 (patch)
treebd22884cc8e32b800f5ebce3012acd296d45c997 /plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di
parente6b3ee51505c77be27d2e75001033940b314c177 (diff)
downloadorg.eclipse.papyrus-b0360efe8740a4fe6e0baf8d3f15048cce1d0bc0.tar.gz
org.eclipse.papyrus-b0360efe8740a4fe6e0baf8d3f15048cce1d0bc0.tar.xz
org.eclipse.papyrus-b0360efe8740a4fe6e0baf8d3f15048cce1d0bc0.zip
Bug 548998: [PageManager] the page manager looks for pages only in notation file.
Change-Id: Ie7dbd78f3e0014ed37431bcde261f220777ab615 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di')
-rwxr-xr-x[-rw-r--r--]plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalPageManagerImpl.java45
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/pom.xml2
3 files changed, 48 insertions, 4 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
index f3ca82161d8..87e0f1da698 100644..100755
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
@@ -11,9 +11,10 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.papyrus.infra.core.sasheditor;bundle-version="[2.1.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.core.log;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.2.0,2.0.0)";visibility:=reexport
+ org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.core;bundle-version="[3.0.200,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.0.100.qualifier
Bundle-Activator: org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor.di;singleton:=true
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalPageManagerImpl.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalPageManagerImpl.java
index e974c5e8756..4670f4cf8a0 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalPageManagerImpl.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalPageManagerImpl.java
@@ -11,12 +11,21 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 485220
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo - Bug 548998
*****************************************************************************/
package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.ModelsReader;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.Activator;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.utils.TransactionHelper;
import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
@@ -154,4 +163,38 @@ public class TransactionalPageManagerImpl extends PageManagerImpl {
}
}
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.sashwindows.di.service.BasicPageManagerImpl#allPages()
+ *
+ * @return
+ */
+ @Override
+ public List<Object> allPages() {
+ if (false == isLegacyMode()) {
+ final ResourceSet set = this.editingDomain.getResourceSet();
+ if (set instanceof ModelSet) {
+ final ModelSet modelSet = (ModelSet) set;
+ final URI uri = modelSet.getURIWithoutExtension();
+ final ModelsReader reader = new ModelsReader();
+ List<Object> result = new ArrayList<>();
+ for (URI currentURI : reader.getKnownModelURIs(uri)) {
+ final String fileExtension = currentURI.fileExtension();
+ // this filter on uml is not the best solution, but we currently don't have other way to get all pages properly
+ if (!"uml".equals(fileExtension)) {// to avoid to cross all UML contents for nothing (and avoid time consumption) //$NON-NLS-1$
+ List<Resource> notationResources = getResources(fileExtension);
+ for (Resource notationResource : notationResources) {
+ for (EObject content : notationResource.getContents()) {
+ if (isPage(content)) {
+ result.add(content);
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+ }
+ return super.allPages();
+ }
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/pom.xml b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/pom.xml
index 87a59d6f571..5c26d63a24d 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/pom.xml
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.core.sasheditor.di</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file

Back to the top