1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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 * William Bourque - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.project
.handlers
;
15 import org
.eclipse
.core
.commands
.ExecutionEvent
;
16 import org
.eclipse
.core
.commands
.ExecutionException
;
17 import org
.eclipse
.core
.commands
.IHandler
;
18 import org
.eclipse
.core
.commands
.IHandlerListener
;
19 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.project
.dialogs
.TraceErrorDialog
;
20 import org
.eclipse
.swt
.widgets
.Shell
;
21 import org
.eclipse
.ui
.IWorkbench
;
22 import org
.eclipse
.ui
.PlatformUI
;
25 public class TraceErrorHandler
implements IHandler
{
27 private String
[] messages
;
29 public TraceErrorHandler(String
[] newMessages
) {
30 messages
= newMessages
;
33 public boolean isEnabled() {
37 public boolean isHandled() {
41 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
42 IWorkbench workbench
= PlatformUI
.getWorkbench();
43 Shell shell
= workbench
.getActiveWorkbenchWindow().getShell();
45 TraceErrorDialog dialog
= new TraceErrorDialog(shell
, messages
);
51 public void dispose() {
54 public void addHandlerListener(IHandlerListener handlerListener
) {
57 public void removeHandlerListener(IHandlerListener handlerListener
) {