Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Closing Dialog with ESC key
Closing Dialog with ESC key [message #26841] Wed, 23 May 2007 06:29 Go to next message
Eclipse UserFriend
Hi all, Can I avoid dialog closing when ESC key is pressed ?

I'm using org.eclipse.swt.widgets.Dialog as parent class for my Dialogs
and in Login Dialog I would like to prevent dialog closing when user
press [ESC] key.

I've tryed to use a callback function in close() method but It doesn't
work, close() method is never called.

My LoginDialog is created without icons:
SWT.APPLICATION_MODAL + SWT.TITLE

Any idea ?

Thanks in advance.
Roberto
Re: Closing Dialog with ESC key [message #26881 is a reply to message #26841] Wed, 23 May 2007 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rsternberg.innoopract.com

Hi Roberto,

Roberto Sá‡nchez schrieb:
> Hi all, Can I avoid dialog closing when ESC key is pressed ?
>
> I'm using org.eclipse.swt.widgets.Dialog as parent class for my Dialogs
> and in Login Dialog I would like to prevent dialog closing when user
> press [ESC] key.
>
> I've tryed to use a callback function in close() method but It doesn't
> work, close() method is never called.
>
> My LoginDialog is created without icons:
> SWT.APPLICATION_MODAL + SWT.TITLE

In SWT, a dialog shell (i.e. every Shell that has another Shell as its
parent), can always be closed with the ESC key.

You can prevent a Shell from closing if you register a ShellListener and
set the doit flag to false. Unfortunately, this is not yet supported by
RAP but we plan to implement the doit flag until the M5 milestone [1].

As a workaround, you could either consider to use a top-level Shell for
your login dialog or to bring the login dialog back to front in the
dialog callback.

Hope this helps,

Ralf

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=187258
Re: Closing Dialog with ESC key [message #26960 is a reply to message #26881] Wed, 23 May 2007 09:50 Go to previous message
Eclipse UserFriend
Hi Ralf, Thank you, It works fine creating a Shell without parent, But I
had to change my Dialog parent class because
org.eclipse.swt.widgets.Dialog doesn't allow null Shell in constructor.

In any case it was easy, I was already using my own DialogBase that
extended from org.eclipse.swt.widgets.Dialog and now It extends from
Object and implements all methods I need from Dialog RAP class.

Regards.
Roberto.



Ralf Sternberg escribió:
> Hi Roberto,
>
> Roberto Sá‡nchez schrieb:
>> Hi all, Can I avoid dialog closing when ESC key is pressed ?
>>
>> I'm using org.eclipse.swt.widgets.Dialog as parent class for my
>> Dialogs and in Login Dialog I would like to prevent dialog closing
>> when user press [ESC] key.
>>
>> I've tryed to use a callback function in close() method but It doesn't
>> work, close() method is never called.
>>
>> My LoginDialog is created without icons:
>> SWT.APPLICATION_MODAL + SWT.TITLE
>
> In SWT, a dialog shell (i.e. every Shell that has another Shell as its
> parent), can always be closed with the ESC key.
>
> You can prevent a Shell from closing if you register a ShellListener and
> set the doit flag to false. Unfortunately, this is not yet supported by
> RAP but we plan to implement the doit flag until the M5 milestone [1].
>
> As a workaround, you could either consider to use a top-level Shell for
> your login dialog or to bring the login dialog back to front in the
> dialog callback.
>
> Hope this helps,
>
> Ralf
>
> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=187258
Previous Topic:How does RAP team automate test RAP ?
Next Topic:How to Center a Button
Goto Forum:
  


Current Time: Mon Jun 16 15:51:15 EDT 2025

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

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

Back to the top