From: Tuukka Lehtonen Date: Fri, 30 Nov 2018 20:08:02 +0000 (+0200) Subject: Fixed PropertyPageView to publish its selection to the workbench X-Git-Tag: v1.43.0~136^2~249^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=5675f72f9664c8ff275614d1ebe8a5a5d3014a98;hp=502db54a267e8583aef1f57120ddc9ac162fbba9 Fixed PropertyPageView to publish its selection to the workbench Removing the property page view site selection provider caused the workbench to naturally never receive any selections from the view thus breaking any handlers whose activity/functionality relies on the current workbench selection being accurate also with property tabs. gitlab #185 Change-Id: I0d7067a0880486b93d135631baccd14ca613be90 --- diff --git a/bundles/org.simantics.browsing.ui.platform/META-INF/MANIFEST.MF b/bundles/org.simantics.browsing.ui.platform/META-INF/MANIFEST.MF index f70303d53..d95fd417d 100644 --- a/bundles/org.simantics.browsing.ui.platform/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.browsing.ui.platform/META-INF/MANIFEST.MF @@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui, org.simantics.views.swt;bundle-version="1.0.0", org.simantics.selectionview;bundle-version="1.0.0", org.simantics.utils.thread.swt;bundle-version="1.1.0", - org.eclipse.e4.core.contexts;bundle-version="1.1.0" + org.eclipse.e4.core.contexts;bundle-version="1.1.0", + org.slf4j.api;bundle-version="1.7.25" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.simantics.browsing.ui.platform diff --git a/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/PropertyPageView.java b/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/PropertyPageView.java index 05109c813..ed78ebc33 100644 --- a/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/PropertyPageView.java +++ b/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/PropertyPageView.java @@ -43,6 +43,8 @@ import org.simantics.ui.workbench.IPropertyPage; import org.simantics.ui.workbench.ResourceInput; import org.simantics.utils.ui.BundleUtils; import org.simantics.utils.ui.SWTUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This is a version of the standard eclipse PropertySheet view a @@ -83,6 +85,8 @@ import org.simantics.utils.ui.SWTUtils; */ public class PropertyPageView extends PageBookView implements IContributedContentsView { + private static final Logger LOGGER = LoggerFactory.getLogger(PropertyPageView.class); + private static final String PROPERTY_VIEW_CONTEXT = "org.simantics.modeling.ui.properties"; private static final String PROP_PINNED = "pinned"; @@ -192,11 +196,6 @@ public class PropertyPageView extends PageBookView implements IContributedConten //System.out.println("PPV init: " + this); super.init(site); - // This prevents the Properties view from providing a selection to other - // workbench parts, thus making them lose their selections which is not - // desirable. - site.setSelectionProvider(null); - contextProvider = Simantics.getSessionContextProvider(); if (!bootstrapOnly) { @@ -386,6 +385,8 @@ public class PropertyPageView extends PageBookView implements IContributedConten * false otherwise */ boolean doSelectionChanged(IWorkbenchPart part, ISelection sel) { + LOGGER.trace("doSelectionChanged({}): incoming selection {}", part, sel); + // we ignore our own selection or null selection if (isPropertyView(part) || sel == null) { return false; @@ -424,6 +425,7 @@ public class PropertyPageView extends PageBookView implements IContributedConten } if (!sameSelection) { + LOGGER.trace("doSelectionChanged({}): updating page input selection to {}", part, sel); updatePartName(ppage, sel); ppage.selectionChanged(part, sel); return true;