Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » extending CDT new project wizard
extending CDT new project wizard [message #152584] Mon, 29 August 2005 21:07 Go to next message
Eclipse UserFriend
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 #152627 is a reply to message #152584] Tue, 30 August 2005 13:46 Go to previous messageGo to next message
Wieant is currently offline WieantFriend
Messages: 8
Registered: July 2009
Junior Member
> 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 #152643 is a reply to message #152627] Tue, 30 August 2005 16:01 Go to previous messageGo to next message
Eclipse UserFriend
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 #154965 is a reply to message #152627] Fri, 23 September 2005 18:31 Go to previous messageGo to next message
Nick Allen is currently offline Nick AllenFriend
Messages: 23
Registered: July 2009
Junior Member
> 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...

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.

Thanks
Nick
Re: extending CDT new project wizard [message #154980 is a reply to message #152627] Fri, 23 September 2005 18:59 Go to previous messageGo to next message
Nick Allen is currently offline Nick AllenFriend
Messages: 23
Registered: July 2009
Junior Member
Wieant wrote:
> 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...

One thing I found to be confusing in subclassing MBSCustomPage for this
purpose was that you need to set MBSCustomPage.pageID manually. I did
not see this mentioned anywhere in the documentation or source, but
assumed so since I was getting NullPointerExceptions and could not find
anyone setting it for me.

I would like to see a way to force clients to have to set this ID. For
instance, a constructor requiring the ID could be added to
MBSCustomPage. Also, an abstract method such as "getPageID" or even
"setPageID" could be added.

--Nick
Re: extending CDT new project wizard [message #155037 is a reply to message #154965] Mon, 26 September 2005 07:44 Go to previous messageGo to next message
Wieant is currently offline WieantFriend
Messages: 8
Registered: July 2009
Junior Member
> 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
Re: extending CDT new project wizard [message #157234 is a reply to message #155037] Wed, 02 November 2005 04:55 Go to previous message
Eclipse UserFriend
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
Previous Topic:Absolute path for include compiler options makes project not exportable
Next Topic:Project refereces & Managed Make
Goto Forum:
  


Current Time: Sat Dec 21 17:11:36 GMT 2024

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

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

Back to the top