Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Getting project name in custom pages of C New Project wizard

Hi Antony,

I'm not sure it's the best way, but this worked for the crossgcc custom page.

IWizardPage[] pages = getWizard().getPages();
for (IWizardPage wizardPage : pages) {
if (wizardPage instanceof WizardNewProjectCreationPage) {
String projectName = (WizardNewProjectCreationPage) wizardPage).getProjectName());
break;
}
}

The crossgcc custom page is in the plug-in org.eclipse.cdt.build.crossgcc. It might not be the cleanest example but it might help you if you have more problems.

Marc-Andre


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Antony Burton [aburton@xxxxxxxxxxx]
Sent: Tuesday, 24 September 2013 12:20 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Getting project name in custom pages of C New Project wizard

Yes, it does get me the first wizard page, but there is no method to retrieve the user entered project name...

Antony

On 24/09/2013 16:05, Chris Recoskie wrote:

Unless I'm mistaken, the code I pasted should get you the same page.

===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto


Inactive
          hide details for Antony Burton ---09/24/2013 05:03:02
          AM---Thanks Chris, but I was trying to access the attribute
          fMaiAntony Burton ---09/24/2013 05:03:02 AM---Thanks Chris, but I was trying to access the attribute fMainPage in  CDTCommonProjectWizard to get t

From: Antony Burton <aburton@xxxxxxxxxxx>
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Date: 09/24/2013 05:03 AM
Subject: Re: [cdt-dev] Getting project name in custom pages of C New Project wizard
Sent by: cdt-dev-bounces@xxxxxxxxxxx





Thanks Chris, but I was trying to access the attribute fMainPage in CDTCommonProjectWizard to get the project name entered by the user on the first wizard page.. Unless there is another way?

Antony

On 23/09/2013 18:13, Chris Recoskie wrote:

    org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager.getPageData(CDTMainWizardPage.PAGE_ID).getWizardPage()

    ===========================
    Chris Recoskie
    Team Lead, IBM CDT and RDT
    IBM Toronto


    Inactive hide details for Antony Burton ---09/23/2013
          11:53:21 AM---Hello, Is there a way of getting the project
          name enterAntony Burton ---09/23/2013 11:53:21 AM---Hello,     Is there a way of getting the project name entered by the user in

    From:
    Antony Burton <aburton@xxxxxxxxxxx>
    To:
    "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
    Date:
    09/23/2013 11:53 AM
    Subject:
    [cdt-dev] Getting project name in custom pages of C New Project wizard
    Sent by:
    cdt-dev-bounces@xxxxxxxxxxx



    Hello,
      Is there a way of getting the project name entered by the user in
    the first page of the C New Project wizard from a custom page? The
    custom pages were added using
    org.eclipse.cdt.managedbuilder.ui.newWizardPages.

    I followed the code and I saw that CDTCommonProjectWizard creates the
    CDTMainWizardPage in its addPages() method:

    fMainPage= new CDTMainWizardPage(CUIPlugin.getResourceString(PREFIX));

    ...and so can get the project name with:

    fMainPage.getProjectName()

    Is it possible to get to fMainPage?

    Thanks in advance,

    Antony
    _______________________________________________
    cdt-dev mailing list

    cdt-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/cdt-dev




    _______________________________________________
    cdt-dev mailing list
    cdt-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top