extending CDT new project wizard [message #152584] |
Mon, 29 August 2005 21:07 |
Eclipse User |
|
|
|
Originally posted by: no.yes.maybe
Hi,
I want to create a project wizard that basically creates a CDT project,
but also some additional files in it. I may have to provide some input
in the wizard for parameters related to these files.
How do I do this? Is it possible to somehow extends the CDT wizard? how
much can I change in it? for example, can I add pages to the wizard? can
I change the text in the top of the wizard?
Thank You,
Roberto
|
|
|
|
Re: extending CDT new project wizard [message #152643 is a reply to message #152627] |
Tue, 30 August 2005 16:01 |
Eclipse User |
|
|
|
Originally posted by: no.yes.maybe
Thanks. I Installed CDT 3.0 (SDK), but the help documentation seems
still to be 2.0 (the "What's new" section has a "what's new in 2.0"
title in a blu bar). Is this normal? is there a 3.0 documentation?
Roberto
Wieant wrote:
>
>> I want to create a project wizard that basically creates a CDT
>> project, but also some additional files in it. I may have to provide
>> some input in the wizard for parameters related to these files.
>>
>> How do I do this? Is it possible to somehow extends the CDT wizard?
>> how much can I change in it? for example, can I add pages to the
>> wizard? can I change the text in the top of the wizard?
>
>
> Yes, you can. Since CDT 3.0 there's a new extension point:
> org.eclipse.cdt.managedbuilder.ui.newWizardPages
> This extension point allows you to add an extra Wizard page (pageClass)
> as well as to add a Runnable (operationClass) to run when the Wizard
> finishes. The combination of the two should allow you to add files to
> the project based on specific settings in the additional Wizard page.
> Seems to work fine...
>
> -- Wieant
>
>
|
|
|
|
|
|
Re: extending CDT new project wizard [message #157234 is a reply to message #155037] |
Wed, 02 November 2005 04:55 |
Eclipse User |
|
|
|
Originally posted by: crecoskie.ti.com
The idea is that you use the MBSCustomPageManager to query for data that
the pages have set. If your page has some piece of data your operation
will care about, then use the addPageProperty() and getPageProperty()
methods to publish and retrieve the data.
If you *really* need to get at your wizard page for some reason, you could
always pass a reference to it as your data to addPageProperty(). I would
suggest only publishing the data you need though.
Regards,
Chris
Wieant wrote:
>> How do I initialize that operationClass? I would assume there should be
>> a way to have my pageClass create and initialize the operationClass
>> with data obtained from the user in the pageClass.
> I have managed to get this going using the following setWizard() template
> in the MBSCustomPage subclass.
> public void setWizard(IWizard newWizard){
> ...
> MBSCustomPageData pagedata = MBSCustomPageManager.getPageData(myPageID);
> if ( pagedata != null ){
> Runnable operation = pagedata.getOperation();
> if ( operation instanceof MyWizardAction ){
> ((MyWizardAction)operation).setProvider(this);
> }
> }
> ...
> }
> Where MyWizardAction is a Runnable subclass providing the
> setProvider(IWizardPage wizardpage)
> method.
> But it feels like a bit of trickery, would be nicer to have the Runnable
> operation already being instantiated with the MBSCustomPage. Guess we
> could apply a change request for this (and your pageID remark).
> -- Wieant
|
|
|
Powered by
FUDForum. Page generated in 0.03275 seconds