blob: 56b184aa255edc35496fc6f3a965ebad91461808 [file] [log] [blame]
package org.eclipse.libra.framework.knopflerfish.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.IStatus;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class KnopflerfishUIPlugin extends AbstractUIPlugin {
protected static KnopflerfishUIPlugin singleton;
public static final String PLUGIN_ID = "org.eclipse.libra.framework.knopflerfish.ui";
public KnopflerfishUIPlugin() {
super();
singleton = this;
}
public static KnopflerfishUIPlugin getInstance() {
return singleton;
}
/**
* Convenience method for logging.
*
* @param status org.eclipse.core.runtime.IStatus
*/
public static void log(IStatus status) {
getInstance().getLog().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;
}
}