blob: a9baba2cda295be4adc89579c974ec1d59f36651 [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2012, 2014 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
/**
* <p>
* Command handler implementation to stop one or more trace sessions.
* </p>
*
* @author Bernd Hufmann
*/
public class StopHandler extends ChangeSessionStateHandler {
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
@Override
public TraceSessionState getNewState() {
return TraceSessionState.INACTIVE;
}
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
@Override
public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException {
session.stopSession(monitor);
}
}