Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [RWT] Shell defaultButton((re)setting a shells default button to empty)
[RWT] Shell defaultButton [message #660909] Tue, 22 March 2011 10:09 Go to next message
Jens Kreidler is currently offline Jens KreidlerFriend
Messages: 17
Registered: July 2009
Junior Member
Hi rap community and developers,

I've got a question about the shell's setDefaultButton - method in rwt.
Is it possible to clear the default button (to empty, i.e. no button)?

The java-doc for Shell#setDefaultButton( Button button ) states:
Quote:

If the argument is not null, sets the receiver's default button to the argument, and if the argument is null, sets the receiver's default button to the first button which was set as the receiver's default button (called the saved default button). If no default button had previously been set, or the saved default button was disposed, the receiver's default button will be set to null.



I do not exactly understand that doc. So it is not possible to set the default button to 'none'?
Assuming that a shell by default has the save (first) button as default button, all subsecently calls 'setDefaultButton( null )' always set the default button to the previous set button, that is the save button ...

Re: [RWT] Shell defaultButton [message #660918 is a reply to message #660909] Tue, 22 March 2011 11:06 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Jens,

from playing around with the snippet below in SWT, I don't get the right
clue either:
shell.setDefaultButton( savedDefault );
System.out.println( shell.getDefaultButton() ); // savedDefault

shell.setDefaultButton( defaultButton );
System.out.println( shell.getDefaultButton() ); // defaultButton

shell.setDefaultButton( null );
System.out.println( shell.getDefaultButton() ); // defaultButton ???

shell.setDefaultButton( null );
System.out.println( shell.getDefaultButton() ); // null

However, resetting the default button twice or something like
while( shell.getDefaultButton() != null ) {
shell.setDefaultButton( null );
}
should do.

You may ask on the SWT forum get a proper explanation. If you do so,
please let us know the answer here.

HTH
Rüdiger

On 22.03.2011 11:09, Jens Kreidler wrote:
> Hi rap community and developers,
>
> I've got a question about the shell's setDefaultButton - method in rwt.
> Is it possible to clear the default button (to empty, i.e. no button)?
>
> The java-doc for Shell#setDefaultButton( Button button ) states:
> Quote:
>> If the argument is not null, sets the receiver's default button to the
>> argument, and if the argument is null, sets the receiver's default
>> button to the first button which was set as the receiver's default
>> button (called the saved default button). If no default button had
>> previously been set, or the saved default button was disposed, the
>> receiver's default button will be set to null.
>
>
> I do not exactly understand that doc. So it is not possible to set the
> default button to 'none'?
> Assuming that a shell by default has the save (first) button as default
> button, all subsecently calls 'setDefaultButton( null )' always set the
> default button to the previous set button, that is the save button ...
>
Re: [RWT] Shell defaultButton [message #661128 is a reply to message #660918] Wed, 23 March 2011 10:16 Go to previous message
Jens Kreidler is currently offline Jens KreidlerFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Rüdiger,

thanks for quickly looking into this.

The reason I asked this is, that I encountered - along with that 'special' setDefaultButton behaviour - a different behaviour concerning a Dialog's default button event processing.
I made two snippet application's, one for RCP and one for RAP to reproduce that.

I felt free to file a bug report in the RAP team's bugzilla, the two snippet eclipse projects included:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340736

RAP tested against 1.4M6.
RCP tested against e3.6



Previous Topic:Hanged sessions
Next Topic:org.elcipse.ui.console Getaway
Goto Forum:
  


Current Time: Thu Oct 21 19:21:47 GMT 2021

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

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

Back to the top