From: Antti Villberg Date: Fri, 23 Aug 2019 10:52:32 +0000 (+0300) Subject: Improvements to modelled SWT documents (fixed) X-Git-Tag: v1.43.0~136^2~94^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=6f8a2f0b26aeda447ac55ea873a953404c3027a7;p=simantics%2Fplatform.git Improvements to modelled SWT documents (fixed) gitlab #357 Change-Id: Id366f13e6be8b598158e67af5d5a4aeb7644abb3 --- diff --git a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/base/PostEventCommand.java b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/base/PostEventCommand.java index 7214bdd1f..24b6e6111 100644 --- a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/base/PostEventCommand.java +++ b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/base/PostEventCommand.java @@ -13,6 +13,7 @@ package org.simantics.document.swt.core.base; import org.simantics.document.server.io.AbstractEventHandler; import org.simantics.document.server.io.CommandContext; +import org.simantics.document.server.io.CommandContextImpl; import org.simantics.document.server.io.CommandContextMutable; import org.simantics.document.swt.core.SWTDocument; @@ -27,6 +28,7 @@ public class PostEventCommand extends AbstractEventCommand { public PostEventCommand(SWTDocument document, AbstractEventHandler handler, CommandContextMutable context, PostEventCommand next) { super(document); + assert(handler != null); this.handler = handler; this.context = context; this.next = next; @@ -34,7 +36,9 @@ public class PostEventCommand extends AbstractEventCommand { @Override public CommandContext handleCommand(CommandContextMutable context) { - document.post(handler, context); + CommandContextMutable mergedContext = new CommandContextImpl().merge(context) + .merge(this.context); + document.post(handler, mergedContext); return context; } diff --git a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/widget/ButtonWidget.java b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/widget/ButtonWidget.java index 72c7c360b..88afe7b2a 100644 --- a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/widget/ButtonWidget.java +++ b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/widget/ButtonWidget.java @@ -75,6 +75,7 @@ public class ButtonWidget extends LeafWidgetManager