tmf: Fix SD unit tests with GTK3
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / project / model / TraceUtils.java
CommitLineData
05e0d2e9
GB
1/*******************************************************************************
2 * Copyright (c) 2013 École Polytechnique de Montréal
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 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.linuxtools.tmf.ui.project.model;
14
15import org.eclipse.swt.widgets.Display;
16import org.eclipse.swt.widgets.MessageBox;
17import org.eclipse.ui.PlatformUI;
18
19/**
20 * Utility class for common tmf.ui functionalities
21 *
22 * @since 2.1
23 */
24public class TraceUtils {
25
26 /**
27 * Displays an error message in a box
28 *
29 * @param boxTitle
30 * The message box title
31 * @param errorMsg
32 * The error message to display
33 */
34 public static void displayErrorMsg(final String boxTitle, final String errorMsg) {
35 Display.getDefault().asyncExec(new Runnable() {
36 @Override
37 public void run() {
38 final MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
39 mb.setText(boxTitle);
40 mb.setMessage(errorMsg);
41 mb.open();
42 }
43 });
44 }
45}
This page took 0.028248 seconds and 5 git commands to generate.