Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-12-13 08:24:27 -0500
committerPatrick Tessier2019-01-18 10:09:15 -0500
commit9155f6ef5a453a6af60c5b79349f20c79b5ef2fd (patch)
tree9c71c9c2f6a9e85ac2505fcf5fd12c69358065fa
parentc5b1c370f77fefbbae50542760ebe039bb9b8d35 (diff)
downloadorg.eclipse.papyrus-9155f6ef5a453a6af60c5b79349f20c79b5ef2fd.tar.gz
org.eclipse.papyrus-9155f6ef5a453a6af60c5b79349f20c79b5ef2fd.tar.xz
org.eclipse.papyrus-9155f6ef5a453a6af60c5b79349f20c79b5ef2fd.zip
Bug 542759: Fix architecture provider to take active viewpoints into
account Change-Id: I11212c02f844a27428b68882c1408330f2a75a7e Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java
index 72129b6489d..bcb3cd9b555 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java
@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
@@ -171,7 +172,8 @@ public class ArchitectureExtendedProviderDescriptor extends ExtendedProviderDesc
modelSet = ServiceUtils.getInstance().getModelSet(part.getAdapter(ServicesRegistry.class));
List<?> collect = new ArchitectureDescriptionUtils(modelSet).getArchitectureViewpoints().stream()// gets Viewpoints
.flatMap(p -> p.getRepresentationKinds().stream())// get representation kinds from viewpoint
- .filter(PapyrusDiagram.class::isInstance).map(PapyrusDiagram.class::cast)// filter on diagram type
+ .filter(Predicate.isEqual(getDiagram())) // check that the diagram handled by this descriptor is in an active viewpoint
+ .map(PapyrusDiagram.class::cast)// filter on diagram type
.filter(p -> getDiagram().getQualifiedName().equals(p.getQualifiedName()))
.flatMap(p -> p.getPalettes().stream()).distinct()// Get paletteConf
.collect(Collectors.toList());// as list

Back to the top