How to prevent dialogs from being closed on ESC pressed [message #459154] |
Tue, 02 August 2005 17:59 |
Eclipse User |
|
|
|
Originally posted by: sarek.nurfuerspam.de
Hi,
is there a way to prevent dialogs from being closed when the ESC key is
pressed?
I create the dialog with the styles TRIM_DIALOG and APPLICATION_MODAL
and have a table and tableEditor component in it.
Now I want the table editor to react in a certain way when the user
presses the ESC key to discard the changes, he is currently performing
on the table cell. As editor I show a Text component, which has a key
listener attached to it. I tried to catch the ESC key in this listener,
but when the ESC key is pressed, the dialog closes immediately, which is
not what I want.
Can anyone give me any hint?
TIA
Christian
--
To reply to this posting directly use the following address and
remove the 'NO-SPAM' part: Riedel.Christian.NO-SPAM@gmx.net
|
|
|
Re: How to prevent dialogs from being closed on ESC pressed [message #459155 is a reply to message #459154] |
Tue, 02 August 2005 18:19 |
Konstantin Scheglov Messages: 555 Registered: July 2009 |
Senior Member |
|
|
Christian Riedel:
I am not sure, but if you use JFace Dialog, you can try use different
button id than CANCEL_ID.
Hm... May be this will not help...
Look in class Decorations (in Win32 version), method WM_HOTKEY(). It
checks for SWT.CLOSE style of Shell, so create dialog without this style
(setShellStyle() method) and close it yourself using method close().
> is there a way to prevent dialogs from being closed when the ESC key is
> pressed?
>
> I create the dialog with the styles TRIM_DIALOG and APPLICATION_MODAL
> and have a table and tableEditor component in it.
> Now I want the table editor to react in a certain way when the user
> presses the ESC key to discard the changes, he is currently performing
> on the table cell. As editor I show a Text component, which has a key
> listener attached to it. I tried to catch the ESC key in this listener,
> but when the ESC key is pressed, the dialog closes immediately, which is
> not what I want.
>
> Can anyone give me any hint?
>
> TIA
>
> Christian
Konstantin Scheglov,
Google, Inc.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03207 seconds