blob: 11195a1e63211bed2f075f1727e991151a632515 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.stem.ui.launcher;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.stem.core.common.presentation.CoreEditorAdvisor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.WorkbenchAdvisor;
/**
* Standard STEM Workbench launcher. This launches the full
* STEM user interface and workbench, including RCP application.
*
*/
public class WorkbenchLauncher extends Launcher
{
/**
* Default constructor for workbench launcher
*/
public WorkbenchLauncher()
{
super();
}
/* (non-Javadoc)
* @see org.eclipse.stem.core.launcher.Launcher#launch()
*/
public Object launch()
{
WorkbenchAdvisor workbenchAdvisor = new CoreEditorAdvisor();
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
}
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
}