Add a "Clear Tracing Views" command
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / project / handlers / ClearViewsHandler.java
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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.internal.tmf.ui.project.handlers;
14
15 import org.eclipse.core.commands.AbstractHandler;
16 import org.eclipse.core.commands.ExecutionEvent;
17 import org.eclipse.core.commands.ExecutionException;
18 import org.eclipse.jface.dialogs.MessageDialog;
19 import org.eclipse.linuxtools.tmf.core.signal.TmfClearExperimentSignal;
20 import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
21 import org.eclipse.ui.PlatformUI;
22
23 /**
24 * Sends the clear signal to the TmfView:s
25 *
26 * @version 1.0
27 * @author Francois Chouinard
28 */
29 public class ClearViewsHandler extends AbstractHandler {
30
31 // ------------------------------------------------------------------------
32 // Execution
33 // ------------------------------------------------------------------------
34
35 @Override
36 public Object execute(ExecutionEvent event) throws ExecutionException {
37 boolean clearViewConfirmed = MessageDialog.openConfirm(
38 PlatformUI.getWorkbench().getDisplay().getActiveShell(),
39 Messages.ClearViewsHandler_title, Messages.ClearViewsHandler_message);
40 if (clearViewConfirmed) {
41 TmfSignalManager.dispatchSignal(new TmfClearExperimentSignal(this));
42 }
43 return null;
44 }
45
46 }
This page took 0.030246 seconds and 5 git commands to generate.