(no commit message)
[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 public boolean isEnabled() {
34 return true;
35 }
36
37 public boolean isHandled() {
38 return true;
39 }
40
41 public Object execute(ExecutionEvent event) throws ExecutionException {
42 IWorkbench workbench = PlatformUI.getWorkbench();
43 Shell shell = workbench.getActiveWorkbenchWindow().getShell();
44
45 TraceErrorDialog dialog = new TraceErrorDialog(shell, messages);
46 dialog.open();
47
48 return null;
49 }
50
51 public void dispose() {
52 }
53
54 public void addHandlerListener(IHandlerListener handlerListener) {
55 }
56
57 public void removeHandlerListener(IHandlerListener handlerListener) {
58 }
59
60 }
61
This page took 0.030978 seconds and 5 git commands to generate.