diff options
author | Mickael ADAM | 2017-05-18 12:57:32 +0000 |
---|---|---|
committer | Mickael ADAM | 2017-05-18 12:58:31 +0000 |
commit | ba8c62cf997106121a7fd27b2a7c155bbcac89b4 (patch) | |
tree | a0273f4ad62b81356ff357df806a29bcfcc1749e /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org | |
parent | fe7c81f06836a386d7cc3775e8c9868e808c233f (diff) | |
download | org.eclipse.papyrus-ba8c62cf997106121a7fd27b2a7c155bbcac89b4.tar.gz org.eclipse.papyrus-ba8c62cf997106121a7fd27b2a7c155bbcac89b4.tar.xz org.eclipse.papyrus-ba8c62cf997106121a7fd27b2a7c155bbcac89b4.zip |
Bug 516878 - [Palette] In some case palette does not appears.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=516878
Change-Id: I0065c115f8cf5478f874152e6837a29261a7a750
Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/ArchitectureExtendedProviderDescriptor.java | 12 |
1 files changed, 4 insertions, 8 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 acb05b3f0c7..3bfb2f6e256 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 @@ -38,7 +38,6 @@ import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.ContributeTo import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.papyrus.infra.architecture.ArchitectureDescriptionUtils; -import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind; import org.eclipse.papyrus.infra.core.resource.ModelSet; import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.core.services.ServicesRegistry; @@ -47,8 +46,6 @@ import org.eclipse.papyrus.infra.gmfdiag.common.Activator; import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteService.ExtendedProviderDescriptor; import org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.PaletteConfiguration; import org.eclipse.papyrus.infra.gmfdiag.representation.PapyrusDiagram; -import org.eclipse.papyrus.infra.gmfdiag.style.PapyrusDiagramStyle; -import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype; import org.eclipse.ui.IEditorPart; import org.osgi.framework.Bundle; @@ -147,11 +144,10 @@ public class ArchitectureExtendedProviderDescriptor extends ExtendedProviderDesc ContributeToPaletteOperation o = (ContributeToPaletteOperation) operation; IEditorPart part = o.getEditor(); if (part instanceof DiagramEditorWithFlyOutPalette) { - String diagramName = getDiagram().getName(); // name is the key of modelkind - if (diagramName != null) { - Diagram diagramPalette = ((DiagramEditorWithFlyOutPalette) part).getDiagram(); - PapyrusDiagramStyle papyrusDiagramStyle = org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getPapyrusDiagramStyle(diagramPalette); - if (papyrusDiagramStyle != null && diagramName.equals(papyrusDiagramStyle.getDiagramKind().getName())) { + String diagramId = getDiagram().getImplementationID(); // implementation id is the key of modelkind + if (null != diagramId) { + Diagram currentDiagram = ((DiagramEditorWithFlyOutPalette) part).getDiagram(); + if (currentDiagram != null && diagramId.equals(currentDiagram.getType())) { if (!isHidden(o)) { ModelSet modelSet = null; try { |