Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » SafeRunnerDialog and modality
SafeRunnerDialog and modality [message #326625] Wed, 26 March 2008 16:05 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Hi,

In a preference page, I have this code to show possible exceptions to the
end user:

SafeRunnable.run(new SafeRunnable() {
public void run() throws Exception {
....
});
}

The preference page is inside the preferences dialog, which is modal.

The problem is that the SafeRunnableDialog appears disabled and behind the
preferences dialog.

The cause is probably that the parent of the notifying dialog is the mian
workbench window, instead of the preferences dialog.

I'm using Eclipse 3.3.2, Java 1.6 and Windows XP.

It's impossible for me to solve this from my plugin, as the
SafeRunnableDialog is not public, unless I duplicate all the code.
If accessible, maybe I could try SafeRunnableDialog.configureShell()

Thanks in advance for any help.
Re: SafeRunnerDialog and modality [message #326649 is a reply to message #326625] Thu, 27 March 2008 12:47 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Is there any better alternative to show exceptions to the end user in a
modal dialog?

David Perez wrote:

> In a preference page, I have this code to show possible exceptions to the
> end user:

> SafeRunnable.run(new SafeRunnable() {
> public void run() throws Exception {
> ....
> });
> }

> The preference page is inside the preferences dialog, which is modal.

> The problem is that the SafeRunnableDialog appears disabled and behind the
> preferences dialog.

> The cause is probably that the parent of the notifying dialog is the mian
> workbench window, instead of the preferences dialog.

> I'm using Eclipse 3.3.2, Java 1.6 and Windows XP.

> It's impossible for me to solve this from my plugin, as the
> SafeRunnableDialog is not public, unless I duplicate all the code.
> If accessible, maybe I could try SafeRunnableDialog.configureShell()
Re: SafeRunnerDialog and modality [message #326892 is a reply to message #326649] Wed, 02 April 2008 16:56 Go to previous message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Try StatusManager.getManager().handle(status, StatusManager.SHOW). Usually,
it is not a good idea to open a modal dialog (error dialog or not) from deep
down in your code, because this will run the event loop and therefore any
asyncExecs that may be queued up. These asyncExecs could then change your
environment in drastic ways - for example, think about the case where the
update manager has finished installing new plug-ins and prompts you to
restart the workbench.

Boris

"David Perez" <craquerpro@yahoo.es> wrote in message
news:cd61b897bc7575fa38b10845143a5c8d$1@www.eclipse.org...
> Is there any better alternative to show exceptions to the end user in a
> modal dialog?
>
> David Perez wrote:
>
>> In a preference page, I have this code to show possible exceptions to the
>> end user:
>
>> SafeRunnable.run(new SafeRunnable() {
>> public void run() throws Exception {
>> ....
>> });
>> }
>
>> The preference page is inside the preferences dialog, which is modal.
>
>> The problem is that the SafeRunnableDialog appears disabled and behind
>> the preferences dialog.
>
>> The cause is probably that the parent of the notifying dialog is the mian
>> workbench window, instead of the preferences dialog.
>
>> I'm using Eclipse 3.3.2, Java 1.6 and Windows XP.
>
>> It's impossible for me to solve this from my plugin, as the
>> SafeRunnableDialog is not public, unless I duplicate all the code.
>> If accessible, maybe I could try SafeRunnableDialog.configureShell()
>
>
Previous Topic:Trouble with: "org.osgi.framework.BundleException: The activator X.y for bundle X is invalid&qu
Next Topic:Search step-by-step tutorial for writing web service (and deploy to AppServer)
Goto Forum:
  


Current Time: Thu Dec 26 16:35:02 GMT 2024

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

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

Back to the top