Search in sources :

Example 1 with ChangeStateCommand

use of org.openlca.app.editors.graphical.command.ChangeStateCommand in project olca-app by GreenDelta.

the class ChangeAllStateAction method run.

@Override
public void run() {
    Command actualCommand = null;
    for (ProcessNode node : editor.getModel().getChildren()) {
        boolean minimize = type == MINIMIZE;
        if (node.isMinimized() == minimize)
            continue;
        ChangeStateCommand newCommand = new ChangeStateCommand(node);
        actualCommand = Commands.chain(newCommand, actualCommand);
    }
    if (actualCommand == null)
        return;
    editor.getCommandStack().execute(actualCommand);
}
Also used : ChangeStateCommand(org.openlca.app.editors.graphical.command.ChangeStateCommand) Command(org.eclipse.gef.commands.Command) ChangeStateCommand(org.openlca.app.editors.graphical.command.ChangeStateCommand) ProcessNode(org.openlca.app.editors.graphical.model.ProcessNode)

Aggregations

Command (org.eclipse.gef.commands.Command)1 ChangeStateCommand (org.openlca.app.editors.graphical.command.ChangeStateCommand)1 ProcessNode (org.openlca.app.editors.graphical.model.ProcessNode)1