1 /**********************************************************************
2 * Copyright (c) 2013 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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.tracing
.rcp
.ui
;
14 import org
.eclipse
.equinox
.app
.IApplication
;
15 import org
.eclipse
.equinox
.app
.IApplicationContext
;
16 import org
.eclipse
.swt
.widgets
.Display
;
17 import org
.eclipse
.ui
.IWorkbench
;
18 import org
.eclipse
.ui
.PlatformUI
;
21 * This class controls all aspects of the application's execution
22 * @author Bernd Hufmann
24 public class Application
implements IApplication
{
27 public Object
start(IApplicationContext context
) throws Exception
{
28 Display display
= PlatformUI
.createDisplay();
30 int returnCode
= PlatformUI
.createAndRunWorkbench(display
, new ApplicationWorkbenchAdvisor());
31 if (returnCode
== PlatformUI
.RETURN_RESTART
) {
32 return IApplication
.EXIT_RESTART
;
34 return IApplication
.EXIT_OK
;
42 if (!PlatformUI
.isWorkbenchRunning()) {
45 final IWorkbench workbench
= PlatformUI
.getWorkbench();
46 final Display display
= workbench
.getDisplay();
47 display
.syncExec(new Runnable() {
50 if (!display
.isDisposed()) {