1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.project
.handlers
;
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
;
24 * Sends the clear signal to the TmfView:s
27 * @author Francois Chouinard
29 public class ClearViewsHandler
extends AbstractHandler
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
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));