Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 0b25c7b8d46..8c1f53ba066 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
@@ -20,6 +20,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;
@@ -169,7 +170,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