First part of LTTng 2.0 support
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / control / handlers / DisconnectHandler.java
CommitLineData
eb1bab5b
BH
1/**********************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12package org.eclipse.linuxtools.lttng.ui.views.control.handlers;
13
14import org.eclipse.core.commands.ExecutionEvent;
15import org.eclipse.core.commands.ExecutionException;
16import org.eclipse.linuxtools.lttng.ui.views.control.model.TargetNodeState;
17
18/**
19 * <b><u>DisconnectHandler</u></b>
20 * <p>
21 * Command handler implementation to disconnect from a target host.
22 * </p>
23 */
24public class DisconnectHandler extends BaseNodeHandler {
25
26 // ------------------------------------------------------------------------
27 // Operations
28 // ------------------------------------------------------------------------
29
30 /*
31 * (non-Javadoc)
32 * @see org.eclipse.linuxtools.lttng.ui.views.control.handlers.BaseNodeHandler#execute(org.eclipse.core.commands.ExecutionEvent)
33 */
34 @Override
35 public Object execute(ExecutionEvent event) throws ExecutionException {
36 fTargetNode.disconnect();
37 return null;
38 }
39
40 /*
41 * (non-Javadoc)
42 * @see org.eclipse.linuxtools.lttng.ui.views.control.handlers.BaseNodeHandler#isEnabled()
43 */
44 @Override
45 public boolean isEnabled() {
46 return super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.CONNECTED);
47 }
48}
This page took 0.025804 seconds and 5 git commands to generate.