[RWT] Shell defaultButton [message #660909] |
Tue, 22 March 2011 06:09  |
Eclipse User |
|
|
|
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 07:06   |
Eclipse User |
|
|
|
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 06:16  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.07189 seconds