Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Default Button on ViewStack(1 Shell for X Views = Y Problems)
Default Button on ViewStack [message #527411] Thu, 15 April 2010 08:11 Go to next message
Bassspieler  is currently offline Bassspieler Friend
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 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

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 #527479 is a reply to message #527474] Thu, 15 April 2010 12:20 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
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?
Re: Default Button on ViewStack [message #527514 is a reply to message #527479] Thu, 15 April 2010 13:49 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

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
Previous Topic:Error on workbench shutdown
Next Topic:ArrayIndexOutOfBoundsException on startup with current CVS HEAD
Goto Forum:
  


Current Time: Tue Oct 08 00:43:53 GMT 2024

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

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

Back to the top