1 package org.simantics.modeling.tests.commands;
3 import org.simantics.db.exception.DatabaseException;
4 import org.simantics.db.testing.common.CommandSequenceEnvironment;
5 import org.simantics.db.testing.common.WriteCommand;
7 public class UnloadDiagram extends WriteCommand<CommandSequenceEnvironment> {
9 private LoadDiagram diagram;
11 public UnloadDiagram(LoadDiagram diagram) {
12 this.diagram = diagram;
16 public void run(CommandSequenceEnvironment environment) throws DatabaseException {
18 diagram.getProvider().dispose();
19 diagram.getContext().dispose();
20 diagram.getActivation().deactivate();
21 diagram.getWorkerThread().stopDispatchingEvents(true);