X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.swt.core%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fswt%2Fcore%2Fbase%2FPostEventCommand.java;h=7214bdd1f1691057c25a304621b4112339c9ada9;hp=ff6d4fd13d5aa6d20e0894339c02bee95fc68569;hb=e4ffdffae875e518a4eb070b8bda6ead1a9843d3;hpb=158d6269660a3b415504f1da5a0b8341e761a5be 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 ff6d4fd13..7214bdd1f 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 @@ -1,40 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2019 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Semantum Oy - initial API and implementation + *******************************************************************************/ package org.simantics.document.swt.core.base; -import java.util.Map; - -import org.simantics.document.server.handler.AbstractEventHandler; +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 class PostEventCommand extends AbstractEventCommand { private AbstractEventHandler handler; - private CommandContextImpl parameters; + private CommandContextMutable context; - public PostEventCommand(SWTDocument document, AbstractEventHandler handler, Map parameters) { - this(document, handler, parameters, null); + public PostEventCommand(SWTDocument document, AbstractEventHandler handler, CommandContextMutable context) { + this(document, handler, context, null); } - public PostEventCommand(SWTDocument document, AbstractEventHandler handler, Map parameters, PostEventCommand next) { + public PostEventCommand(SWTDocument document, AbstractEventHandler handler, CommandContextMutable context, PostEventCommand next) { super(document); this.handler = handler; - this.parameters = new CommandContextImpl(); - for(Map.Entry entry : parameters.entrySet()) { - this.parameters.putString(entry.getKey(), entry.getValue()); - } + this.context = context; this.next = next; } @Override - public void handleCommand() { - document.post(handler, parameters); + public CommandContext handleCommand(CommandContextMutable context) { + document.post(handler, context); + return context; } @Override - public void commandSuccess() { + public CommandContext commandSuccess(CommandContextMutable context) { if(next != null) - next.handleCommand(); + return next.handleCommand(context); + return context; } @Override