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;
public PostEventCommand(SWTDocument document, AbstractEventHandler handler, CommandContextMutable context, PostEventCommand next) {
super(document);
+ assert(handler != null);
this.handler = handler;
this.context = context;
this.next = next;
@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;
}