Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to display a MessageDialog on startup ?
How to display a MessageDialog on startup ? [message #107735] Wed, 06 August 2003 22:40 Go to next message
Eclipse UserFriend
Originally posted by: bhavin_r.rediffmail.com

Hi,

I am trying to display a Hello World Dialog Box (something like
tip-of-the-day) on eclipse startup...how can I do that ?

I have attempted to write a plugin implementing IStartup, when I run it in
Workbench I can find it in Preferences > Workbench > Startup. But if I
write
MessageDialog.openInformation( ..) function inside the interface
implemented method earlyStartup()..it gives either NullPointerException or
some Invalid Thread Access SWT related error. I think it is because of the
first argument of openInformation -> Shell (parent) I am not able to
define properly.

How can I get the Shell within earlyStartup method...am I on the right way
or something is missing ..?

Thanks in advance.

Bhavin Raichura
Re: How to display a MessageDialog on startup ? [message #107831 is a reply to message #107735] Thu, 07 August 2003 04:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: boylaboy.hotmail.com

Hi:
You can do that like this:

MessageDialog.openInformation(window.getShell(),"Hello","tip-of-the-day ");
It should be in the Run method.


"Bhavin Raichura" <bhavin_r@rediffmail.com>
??????:bgse7c$hoh$1@eclipse.org...
> Hi,
>
> I am trying to display a Hello World Dialog Box (something like
> tip-of-the-day) on eclipse startup...how can I do that ?
>
> I have attempted to write a plugin implementing IStartup, when I run it in
> Workbench I can find it in Preferences > Workbench > Startup. But if I
> write
> MessageDialog.openInformation( ..) function inside the interface
> implemented method earlyStartup()..it gives either NullPointerException or
> some Invalid Thread Access SWT related error. I think it is because of the
> first argument of openInformation -> Shell (parent) I am not able to
> define properly.
>
> How can I get the Shell within earlyStartup method...am I on the right way
> or something is missing ..?
>
> Thanks in advance.
>
> Bhavin Raichura
>
Re: How to display a MessageDialog on startup ? [message #107975 is a reply to message #107735] Thu, 07 August 2003 10:04 Go to previous message
Eclipse UserFriend
Bhavin Raichura wrote:

> Hi,
>
> I am trying to display a Hello World Dialog Box (something like
> tip-of-the-day) on eclipse startup...how can I do that ?
>
> I have attempted to write a plugin implementing IStartup, when I run it in
> Workbench I can find it in Preferences > Workbench > Startup. But if I
> write
> MessageDialog.openInformation( ..) function inside the interface
> implemented method earlyStartup()..it gives either NullPointerException or
> some Invalid Thread Access SWT related error. I think it is because of the
> first argument of openInformation -> Shell (parent) I am not able to
> define properly.
>
> How can I get the Shell within earlyStartup method...am I on the right way
> or something is missing ..?

The docs for IStartup.earlyStartup() state that is will be called in a
background thread. If you want to do anything UI-related, you will need
to run that code on the UI thread. See Display.syncExec() and
Display.asyncExec().

Jeff
Previous Topic:ant script not executed
Next Topic:Version #'s
Goto Forum:
  


Current Time: Tue Jul 15 22:04:42 EDT 2025

Powered by FUDForum. Page generated in 0.29236 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top