Eclipse dialogs (MessageDialog, MessageDialogWithToggle, ...) require the SWT org.eclipse.swt.widgets.Shell class to show themselves. Occasionally I forget how to get the default Shell. Maybe Google will start returning this tip. Here's how to do it:
PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getShell();
Don't forget to add a dependency on org.eclipse.ui to your plugin.
An improvement over this is to subclass your favorite Eclipse dialog and provide a new static "open...()" method that doesn't ask for the Shell param and uses the default.

Effectively, this tip is already appearing in Google :).
Thanks!
Posted by: William Cornejo | May 08, 2008 at 03:21 AM