| package org.eclipse.libra.framework.equinox.ui; |
| /******************************************************************************* |
| * Copyright (c) 2010 Eteration A.S. 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: |
| * Naci Dai and Murat Yener, Eteration A.S. - Initial API and implementation |
| *******************************************************************************/ |
| |
| |
| import org.eclipse.core.runtime.ILog; |
| import org.eclipse.core.runtime.IStatus; |
| import org.eclipse.core.runtime.Platform; |
| import org.eclipse.swt.widgets.Display; |
| import org.eclipse.ui.plugin.AbstractUIPlugin; |
| import org.osgi.framework.Bundle; |
| import org.osgi.framework.FrameworkUtil; |
| |
| |
| public class EquinoxUIPlugin extends AbstractUIPlugin { |
| public static final String PLUGIN_ID = "org.eclipse.libra.framework.equinox.ui"; |
| |
| public EquinoxUIPlugin() { |
| super(); |
| } |
| |
| /** |
| * Convenience method for logging. |
| * |
| * @param status org.eclipse.core.runtime.IStatus |
| */ |
| public static void log(IStatus status) { |
| Bundle bdl = FrameworkUtil.getBundle(EquinoxUIPlugin.class); |
| ILog log = bdl==null ? null : Platform.getLog(bdl); |
| if (log!=null) log.log(status); |
| } |
| |
| /** |
| * Convenience method to get a Display. The method first checks, if |
| * the thread calling this method has an associated display. If so, this |
| * display is returned. Otherwise the method returns the default display. |
| * |
| * @return the display |
| */ |
| public static Display getStandardDisplay() { |
| Display display = Display.getCurrent(); |
| if (display == null) |
| display = Display.getDefault(); |
| return display; |
| } |
| |
| } |