import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.swt.widgets.Display;
public class PHPDebugUiPlugin extends AbstractUIPlugin {
public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.debug.ui"; //$NON-NLS-1$
return PLUGIN_ID;
}
return getDefault().getDescriptor().getUniqueIdentifier();
- }
+ }
+
+ /**
+ * Returns the standard display to be used. 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.
+ */
+ public static Display getStandardDisplay() {
+ Display display;
+ display= Display.getCurrent();
+ if (display == null)
+ display= Display.getDefault();
+ return display;
+ }
/**
* Returns the active workbench shell or <code>null</code> if none