2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / project / handlers / TraceErrorHandler.java
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
33 @Override
34 public boolean isEnabled() {
35 return true;
36 }
37
38 @Override
39 public boolean isHandled() {
40 return true;
41 }
42
43 @Override
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
54 @Override
55 public void dispose() {
56 }
57
58 @Override
59 public void addHandlerListener(IHandlerListener handlerListener) {
60 }
61
62 @Override
63 public void removeHandlerListener(IHandlerListener handlerListener) {
64 }
65
66 }
67
This page took 0.031634 seconds and 5 git commands to generate.