Default Button on ViewStack [message #527411] |
Thu, 15 April 2010 08:11 |
Bassspieler Messages: 40 Registered: April 2010 Location: Germany |
Member |
|
|
Hi!
I have a view-stack with varying amounts of open views, that most have a default button. That simply doesn't work, yet.
Problem 1 is, that it's not enough to set a button as default on creation of the view. OK, so the shell for the view-stack is always the same, so the 2nd created view catches the default button.
Problem 2 is, that I just can not recognize, when the user switches between views. I think it should be like "button.addListener(SWT.Show, myListener);"
But the SWT.Show, SWT.Hide, SWT.Traverse do not work in my app (RAP 1.3 M6). They never get triggered. Why?
Problem 3 is, that the once set default button for a shell can not be completly reset. A also have views without a default button. When I open and close a view that had a default button and open a new view without any default button I get: WIDGET IS DISPOSED. I tried to reset it via shell.setDefaultButton(null); But that does not work. When I call shell.getDefaultButton(); afterwards I get the button once defined.
-> SWT.Show really does not work?
-> "Cleaning" default button of a shell is impossible?
Best regards,
Bassspieler
[Updated on: Thu, 15 April 2010 08:13] Report message to a moderator
|
|
|
Re: Default Button on ViewStack [message #527474 is a reply to message #527411] |
Thu, 15 April 2010 11:58 |
|
Bassspieler wrote:
> Hi!
>
> I have a view-stack with varying amounts of open views, that most have a
> default button. That simply doesn't work, yet.
>
> Problem 1 is, that it's not enough to set a button as default on
> creation of the view. OK, so the shell for the view-stack is always the
> same, so the 2nd created view catches the default button.
This fact alone let me doubt that the use of default buttons is
appropriate for your case.
> Problem 2 is, that I just can not recognize, when the user switches
> between views. I think it should be like "button.addListener(SWT.Show,
> myListener);"
> But the SWT.Show, SWT.Hide, SWT.Traverse do not work in my app (RAP 1.3
> M6). They never get triggered. Why?
The class doc of Button states which events are available for this
widget. To get notified on part activation, you need a PartListener.
> Problem 3 is, that the once set default button for a shell can not be
> completly reset. A also have views without a default button. When I open
> and close a view that had a default button and open a new view without
> any default button I get: WIDGET IS DISPOSED. I tried to reset it via
> shell.setDefaultButton(null); But that does not work. When I call
> shell.getDefaultButton(); afterwards I get the button once defined.
>
> -> SWT.Show really does not work?
> -> Clean default button of a view is impossible?
>
> Best regards,
> Bassspieler
|
|
|
|
Re: Default Button on ViewStack [message #527514 is a reply to message #527479] |
Thu, 15 April 2010 13:49 |
|
Bassspieler wrote:
> Thx for the hint on recognizing view activations.
> I have a view-stack. There is only 1 view visible at a time. And I want
> the default-button-behaviour. So I used: shell.setDefaultButton()
>
> What about the "reset-default-button-to-default" problem?
Please read the JavaDoc for Shell#setDefaultButton(). If you find a case
where it does not work as described, please open a bug and add a simple
code snippet to reproduce.
Ralf
|
|
|
Powered by
FUDForum. Page generated in 0.04447 seconds