Commit | Line | Data |
---|---|---|
6e512b93 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009, 2010 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 | * William Bourque - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.lttng.ui.views.project.handlers; | |
14 | ||
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; | |
23 | ||
24 | ||
25 | public class TraceErrorHandler implements IHandler { | |
26 | ||
27 | private String[] messages; | |
28 | ||
29 | public TraceErrorHandler(String[] newMessages) { | |
30 | messages = newMessages; | |
31 | } | |
32 | ||
d4011df2 | 33 | @Override |
6e512b93 ASL |
34 | public boolean isEnabled() { |
35 | return true; | |
36 | } | |
37 | ||
d4011df2 | 38 | @Override |
6e512b93 ASL |
39 | public boolean isHandled() { |
40 | return true; | |
41 | } | |
42 | ||
d4011df2 | 43 | @Override |
6e512b93 ASL |
44 | public Object execute(ExecutionEvent event) throws ExecutionException { |
45 | IWorkbench workbench = PlatformUI.getWorkbench(); | |
46 | Shell shell = workbench.getActiveWorkbenchWindow().getShell(); | |
47 | ||
48 | TraceErrorDialog dialog = new TraceErrorDialog(shell, messages); | |
49 | dialog.open(); | |
50 | ||
51 | return null; | |
52 | } | |
53 | ||
d4011df2 | 54 | @Override |
6e512b93 ASL |
55 | public void dispose() { |
56 | } | |
57 | ||
d4011df2 | 58 | @Override |
6e512b93 ASL |
59 | public void addHandlerListener(IHandlerListener handlerListener) { |
60 | } | |
61 | ||
d4011df2 | 62 | @Override |
6e512b93 ASL |
63 | public void removeHandlerListener(IHandlerListener handlerListener) { |
64 | } | |
65 | ||
66 | } | |
67 |