Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to display a MessageDialog on startup ?
How to display a MessageDialog on startup ? [message #107735] Thu, 07 August 2003 02: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 08: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 14:04 Go to previous message
Jeff Hunter is currently offline Jeff HunterFriend
Messages: 73
Registered: July 2009
Member
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: Wed Jan 15 10:45:30 GMT 2025

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

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

Back to the top