Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » setting up wizard pages between clicking "next"
setting up wizard pages between clicking "next" [message #445487] Sun, 07 November 2004 15:48 Go to next message
stephanie is currently offline stephanieFriend
Messages: 1
Registered: July 2009
Junior Member
I'm new to using swt and also to using eclipse to write wizard plugins. I
apologize if this question has been asked earlier.

I am writing a preview page which serves to give the user a summary of
what they are about to create when they click finish.

I need to be able to pre-populate this preview page with data from an
external source and it needs to happen after "next" is clicked on the
previous wizard page. What event do I modify to do this?

Iis there a postcreate method or anything that I can use to set up my next
wizard page from the previous wizard page, or some sort of load event?

Please Help!
Many thanks in advance,
Steph
Re: setting up wizard pages between clicking "next" [message #445490 is a reply to message #445487] Sun, 07 November 2004 20:10 Go to previous messageGo to next message
Ferenc Hechler is currently offline Ferenc HechlerFriend
Messages: 39
Registered: July 2009
Member
Hi Steph,

I had the same problem, there is no method which could handle a
"next"-button clicked event.
I found a work around for my plugin:
The first WizardPage overwrites the method canFlipToNextPage() and sends the
current data to its Wizard.
The Wizard forwards these data to the next wizard page which can then do
some initialization based on the current data.
canFlipToNextPage() is called to set the enable/disable status of the "next"
button, it is not the click on the next button.
Below is an excerpt of my wizard:

public class MyWizard extends Wizard {
MyWizardPage1 wp1;
MyWizardPage2 wp2;
public void addPages() {
wp1 = new MyWizardPage1();
addPage(wp1);
wp2 = new MyWizardPage2();
addPage(wp2);
super.addPages();
}
public void setNextData(currentdata) {
wp2.setData(currentdata);
}
....
}

public class MyWizardPage1 extends WizardPage {
public boolean canFlipToNextPage() {
boolean ok = false;
if (isPageComplete()) {
MyWizard mw = (MyWizard)getWizard();
mw.setData(currentdata);
ok = true;
}
return (ok && super.canFlipToNextPage());
}
..
}

public class MyWizardPage2 extends WizardPage {

public void setData(currentdata) {
...
}
...
}


Hope this helps,
feri
Re: setting up wizard pages between clicking "next" [message #445641 is a reply to message #445490] Mon, 08 November 2004 15:53 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This question should be asked in the eclipse platform newsgroup:

news://news.eclipse.org/eclipse.platform

"Ferenc Hechler" <ferenc.hechler@web.de> wrote in message
news:cmlvar$r20$1@eclipse.org...
> Hi Steph,
>
> I had the same problem, there is no method which could handle a
> "next"-button clicked event.
> I found a work around for my plugin:
> The first WizardPage overwrites the method canFlipToNextPage() and sends
> the current data to its Wizard.
> The Wizard forwards these data to the next wizard page which can then do
> some initialization based on the current data.
> canFlipToNextPage() is called to set the enable/disable status of the
> "next" button, it is not the click on the next button.
> Below is an excerpt of my wizard:
>
> public class MyWizard extends Wizard {
> MyWizardPage1 wp1;
> MyWizardPage2 wp2;
> public void addPages() {
> wp1 = new MyWizardPage1();
> addPage(wp1);
> wp2 = new MyWizardPage2();
> addPage(wp2);
> super.addPages();
> }
> public void setNextData(currentdata) {
> wp2.setData(currentdata);
> }
> ...
> }
>
> public class MyWizardPage1 extends WizardPage {
> public boolean canFlipToNextPage() {
> boolean ok = false;
> if (isPageComplete()) {
> MyWizard mw = (MyWizard)getWizard();
> mw.setData(currentdata);
> ok = true;
> }
> return (ok && super.canFlipToNextPage());
> }
> ..
> }
>
> public class MyWizardPage2 extends WizardPage {
>
> public void setData(currentdata) {
> ...
> }
> ...
> }
>
>
> Hope this helps,
> feri
>
Previous Topic:How to make Tabitems not editable
Next Topic:Background color when editing table row
Goto Forum:
  


Current Time: Thu Oct 22 01:10:04 GMT 2020

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

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

Back to the top