Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Re: Programitically Changing The Project Location

On Wed, Jul 2, 2008 at 4:43 PM, Karol Krizka <kkrizka@xxxxxxxxx> wrote:
> To add to my question, is it also possible to set the initial project
> name? I am asking this, because I am trying to make it possible to
> check-out a project from CVS and the project name has to be the same
> as the module name in CVS.
>
> I noticed that the CDTMainWizardPage class has a function called
> setInitialProjectName, which should accomplish just this. But it has
> to be called before the page is created, which is not sure how I can
> accomplish. I tried to do this from setWizard() function of a custom
> page, but at that time      CDTMainWizardPage
> firstPage=(CDTMainWizardPage)wizard.getPage(CDTMainWizardPage.PAGE_ID);
>  returns null, so I am guessing it has not been added to the wizard yet.
>
I managed to get it working by grabbing the first page returned by
wizard.getPages(), however only the location was updated. I also
successfully tried to get the wizard from the construcor of my custom
wizard page using MBSCustomPageManager, but I encountered the same
problem This leads me to believe that the custom pages are beign
created after the GUI control (where the project name is set) of the
main CDT project wizard page.

Is there any other way to use the setInitialProjectName function such
that it will have an effect?
--
Cheers,
Karol Krizka
http://www.krizka.net

>
>
> On Wed, Jul 2, 2008 at 4:24 PM, Karol Krizka <kkrizka@xxxxxxxxx> wrote:
>> Hi all,
>>
>> I am wondering if it is possible to change the project location in the
>> "New Project Wizard" using a plugin. The reason I am asking this is
>> because I am working on a projectType that is being organized into
>> packages and I want new projects to be created in folders
>> corresponding to the package it is in. For example, let's say that I
>> have project Foo that is part of package Cool. When I create a new
>> project, I want to give it the name Foo, but when I click finish I
>> want it to be created in workspace:/Cool/Foo.
>>
>>  I know I can manually change the project location in the first page
>> of the wizard, but I would prefer to do it automatically because
>> sometimes the package names will be long and hard to remember to
>> specify. I was thinking of creating another wizard page that gave one
>> a list of possible packages and somehow modified the project path
>> relative to the workspace before the project was created based on the
>> selection. Is this possible? I mean, do I have write access to the
>> project description so I can use
>> IProjectDescription.setLocation("workspace:/Cool/Foo")?
>>
>> --
>> Cheers,
>> Karol Krizka
>> http://www.krizka.net
>>
>


Back to the top