Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cancel Button of a WizardPage
Cancel Button of a WizardPage [message #463631] Fri, 11 November 2005 07:02 Go to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
I have a wizard page where you can open another simple dialog. Within this
dialog i have two button. One is a OK button and the other is a CANCEL
button. The cancel button should not only close the simple dialog but also
the wizard. It this possible and if yes how can i do this?

Thanks a lot for your help,
Matt
Re: Cancel Button of a WizardPage [message #463641 is a reply to message #463631] Fri, 11 November 2005 12:05 Go to previous messageGo to next message
venkataramana m is currently offline venkataramana mFriend
Messages: 86
Registered: July 2009
Member
In some method of the page you might be opening the dialog as follows ... add some more code to it to close.

YourDlg dlg = new YourDlg();
if( dlg.open() == Window.CANCEL )
{
((WizardDialog)getContainer()).close();
return;
}


Thanks
Venkat
Re: Cancel Button of a WizardPage [message #463642 is a reply to message #463641] Fri, 11 November 2005 13:00 Go to previous messageGo to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks, it works so far.
But i get the following error: Unhandled event loop exception - Reason:
Widget is disposed.
This happens in the WizardDialog class in function 'updateForPage'.
Nullpointer happens on the following line: oldPage.setVisible(false);
(line 939)
Any idea on how to avoid this?
Re: Cancel Button of a WizardPage [message #463646 is a reply to message #463642] Fri, 11 November 2005 13:52 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Check for disposal of the widget. If it is dispose simply don't do
whatever you want to do. Something along the lines

if(!widget.isDisposed)
{
// do your stuff here
}

HTH
Stefan

Matt wrote:
> Thanks, it works so far.
> But i get the following error: Unhandled event loop exception - Reason:
> Widget is disposed.
> This happens in the WizardDialog class in function 'updateForPage'.
> Nullpointer happens on the following line: oldPage.setVisible(false);
> (line 939)
> Any idea on how to avoid this?
>
Re: Cancel Button of a WizardPage [message #463648 is a reply to message #463646] Fri, 11 November 2005 14:01 Go to previous messageGo to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
Unfortunately 'oldPage.setVisible(false);' happens in the WizardDialog
class where i can't change anything.
Maybe I'll have to look for a completely different solution.
Re: Cancel Button of a WizardPage [message #463652 is a reply to message #463648] Fri, 11 November 2005 14:13 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
I guess you are calling the dispose method on the wizard before it has
completed its task.

Check if the close() call calls dispose and if it does try to set the
wizard invisible instead and after it has doen what ever it needs to
close it.

Stefan

Matt wrote:
> Unfortunately 'oldPage.setVisible(false);' happens in the WizardDialog
> class where i can't change anything.
> Maybe I'll have to look for a completely different solution.
>
Re: Cancel Button of a WizardPage [message #463654 is a reply to message #463652] Fri, 11 November 2005 14:20 Go to previous messageGo to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
Yes, the close() call calls the dispose method from the WizardDialog class
(Method hardClose()). My wizard doesn't need to do anything after closing.
So setting the wizard invisible doesn't solve my problem.

Matt
Re: Cancel Button of a WizardPage [message #463656 is a reply to message #463654] Fri, 11 November 2005 14:23 Go to previous message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Can you post some code snippet showing the problem?
Stefan

Matt wrote:
> Yes, the close() call calls the dispose method from the WizardDialog
> class (Method hardClose()). My wizard doesn't need to do anything after
> closing. So setting the wizard invisible doesn't solve my problem.
>
> Matt
>
Previous Topic:Annoying scrollbar problem
Next Topic:how to inhibit accelerators
Goto Forum:
  


Current Time: Thu Apr 25 10:27:27 GMT 2024

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

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

Back to the top