Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » WizardPage.finish() when user clicks on NEXT
WizardPage.finish() when user clicks on NEXT [message #293170] Wed, 19 October 2005 14:10 Go to next message
Eclipse UserFriend
Originally posted by: fabian.eberhardt.sap.com

Hi,

I have a Wizard with two WizardPages (CreateProjectPage and
CreateWorkingsetPage). The first page create three new projects. The
second page create a WorkingSet (user sets name and select projects).

At the moment I can call the CreateProjectPage.finish() and
CreateWorkingsetPage.finish() in the method Wizard.performFinish(). With
other words: when user clicks FINISH.

But the CreateProjectPage.finish() have to be called when User clicks
NEXT to come to the second page.

I use the extensionPoints and have therefore no extra WizardDialog. Thus
i can't make use of the WizardDialog.nextPressed().

Any ideas?
Thanks.

Regards,
Fabian
Re: WizardPage.finish() when user clicks on NEXT [message #293171 is a reply to message #293170] Wed, 19 October 2005 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

do your stuff in the first page's canFlipToNextPage()?
Re: WizardPage.finish() when user clicks on NEXT [message #293173 is a reply to message #293171] Wed, 19 October 2005 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fabian.eberhardt.sap.com

arne anka wrote:
> do your stuff in the first page's canFlipToNextPage()?


what do you mean?

I could overwrite the WizardPage.canFlipToNextPage() in my
CreateProjectPage . But it would only check if the page is completly set
and if there is a next page to go to. When the last field of first page
is set correctly this would give me "true" before the user can click on
NEXT.

I think I need exaktly the moment when user clicks on NEXT.
Re: WizardPage.finish() when user clicks on NEXT [message #293175 is a reply to message #293173] Wed, 19 October 2005 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

the [Next]-button is activated only when canFlipToNextPage returns true.
so you can check any prerequisites you need, do your stuff and then return
true.
i think the super-iplementation calls isPageComplete which in turn has to
be implemented to fit your needs.
anyway, you need to implement at least one method to help the wizard to
determine whether the user is done with the page (has filled in all
necessary fields, checked all boxes, wrote usefull stuff) -- so only if
this is true the user is allowed to click [next].
i do in a page

public void handleEvent(Event event){
setPageComplete(pec.allFieldsFilled());//pec is my composite
holding the fields the user needs to fill in, allFiledsFilled() returns
true if all necessary fileds are filled in
}

public boolean canFlipToNextPage(){
boolean b=isPageComplete();
if(b) {
super.addToMap("personal", pec.getAllFields());
}
return b;
}

handleEvent and cabFlipToNextPage are overridden methods of WizardPage --
it works well for me.
Re: WizardPage.finish() when user clicks on NEXT [message #293212 is a reply to message #293175] Thu, 20 October 2005 06:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fabian.eberhardt.sap.com

arne anka wrote:
> the [Next]-button is activated only when canFlipToNextPage returns true.
> so you can check any prerequisites you need, do your stuff and then
> return true.
> i think the super-iplementation calls isPageComplete which in turn has
> to be implemented to fit your needs.
> anyway, you need to implement at least one method to help the wizard to
> determine whether the user is done with the page (has filled in all
> necessary fields, checked all boxes, wrote usefull stuff) -- so only if
> this is true the user is allowed to click [next].

thanks for your help.
If I understand you correct, the finish() can be called when the user IS
ALLOWED to click [next]. According to the standard wizards it would be
nice, when the finish() is called when the user ACTUALLY CLICKS on [next].
Re: WizardPage.finish() when user clicks on NEXT [message #293215 is a reply to message #293212] Thu, 20 October 2005 07:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

> thanks for your help.
> If I understand you correct, the finish() can be called when the user IS
> ALLOWED to click [next]. According to the standard wizards it would be
> nice, when the finish() is called when the user ACTUALLY CLICKS on
> [next].

now i'm not sure i understand correctly.
but you may overwrite isPageComplete() -- that seems to be called if
[Next] is actually clicked.
be aware, that _all_ wizardpages are created at once when the wizard is
called, not when the user clicks [Next].
Re: WizardPage.finish() when user clicks on NEXT [message #293217 is a reply to message #293215] Thu, 20 October 2005 07:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fabian.eberhardt.sap.com

arne anka wrote:
>> thanks for your help.
>> If I understand you correct, the finish() can be called when the user
>> IS ALLOWED to click [next]. According to the standard wizards it
>> would be nice, when the finish() is called when the user ACTUALLY
>> CLICKS on [next].
>
>
> now i'm not sure i understand correctly.
> but you may overwrite isPageComplete() -- that seems to be called if
> [Next] is actually clicked.
> be aware, that _all_ wizardpages are created at once when the wizard is
> called, not when the user clicks [Next].


no, that's my problem. isPageComplete() is called every time, when a
user fill out a field on the current page (or something else). After
every input it checks if the Page is complete. If the page is complete,
it returns true and the [next] button is enabled.
Re: WizardPage.finish() when user clicks on NEXT [message #293219 is a reply to message #293217] Thu, 20 October 2005 08:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

> isPageComplete() is called every time, when a user fill out a field on
> the current page

true. jetzt, wo du's sagst, riech' ich's auch ...

you probably should either write your own stuff or call two wizards -- one
to create the projects and after that (with a listener?) the next to
create a working set.
Re: WizardPage.finish() when user clicks on NEXT [message #293221 is a reply to message #293219] Thu, 20 October 2005 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fabian.eberhardt.sap.com

arne anka schrieb:
>> isPageComplete() is called every time, when a user fill out a field
>> on the current page
>
>
> true. jetzt, wo du's sagst, riech' ich's auch ...
>
> you probably should either write your own stuff or call two wizards --
> one to create the projects and after that (with a listener?) the next
> to create a working set.
>
>

ok, ich habs befürchtet ;-)

I have found a way: not nice, but it works.
Between the two pages I inserted another page (a "projects are
created"-info page). in the getNextPage(IWizardPage page) method of my
Wizard I check if the current page is my "infoPage" and at the first
time this is true I create the Projects of the first Page. Thats the
point when the "infoPage" is displayed the first time and it is checked
if this "infoPage" is complete....
Re: WizardPage.finish() when user clicks on NEXT [message #293223 is a reply to message #293221] Thu, 20 October 2005 09:00 Go to previous message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

i use another hack, not very pretty imo but it works (and at least nobody
came up with a better solution this thread ;-)
both methods are from my last page. i need to create two objects and show
their contents for a final confirmation (on cancle i dismiss the newly
created objects)

public boolean isPageComplete(){
if(isCurrentPage()) return true;
return false;
}

public boolean canFlipToNextPage(){
//create objects
LongtermNewWizard wiz=((LongtermNewWizard)getWizard());
wiz.customer=new Customer(a, lot, of, params);
wiz.boat=new Boat(a, lot, of, params);
//show content
epc.setPersonalText(wiz.customer.getDataAsString());
epc.setBoatText(wiz.boat.getDataAsString());
//we don't want [Next Page] to be enabled
return false;
}

maybe it helps ...
Previous Topic:Refactoring over many project ?
Next Topic:Duplicate Nodes on TreeViewer Refresh
Goto Forum:
  


Current Time: Thu Jul 18 06:21:01 GMT 2024

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

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

Back to the top