From: Tuukka Lehtonen Date: Sun, 25 Aug 2019 21:29:46 +0000 (+0000) Subject: Merge "Improvements to modelled SWT documents (fixed)" X-Git-Tag: v1.43.0~136^2~94 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=bdcccc1cfe2d9bf4822ca5638c61e94b079184ab;hp=dacda910a146ee8dec7e163e35ffae9a72e2b794 Merge "Improvements to modelled SWT documents (fixed)" --- 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