blob: bab184cf85906f7a2ad0ca562419f35b592dba3c [file] [log] [blame]
package org.eclipse.libra.framework.jonas.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 JonasUIPlugin extends AbstractUIPlugin {
protected static JonasUIPlugin singleton;
public static final String PLUGIN_ID = "org.eclipse.libra.framework.jonas.ui";
public JonasUIPlugin() {
super();
singleton = this;
}
/**
* Returns the singleton instance of this plugin.
* @return org.eclipse.jst.server.tomcat.internal.TomcatUIPlugin
*/
public static JonasUIPlugin 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;
}
}