Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Question about the org.eclipse.cdt.managedbuilder.ui.newWizardPages extension

You can get/set arbitrary page properties from your wizard pages, which your operation can then consume:

/**
* Retrieves a previously published piece of data associated with a wizard page.
*
*
* @param pageID - The unique ID of the page for which the
* data should be retrieved.
*
* @param key - The unique name of the data to be retrieved.
*
* @return The data that was stored for the given key. No assumptions are made about the type of data stored. It is up to the
* contributor of a given page to establish their own contract as to what type of data is stored.
*
* There are certain well known pieces of data published by the stock wizard pages provided by the Managed Build System.
* See org.eclipse.cdt.maangedbuilder.ui.wizards.CProjectPlatformPage.
*
* @see org.eclipse.cdt.maangedbuilder.ui.wizards.CProjectPlatformPage
* @see org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager#addPageProperty(String, String, Object)
*
* @since 3.0
*/
public static Object getPageProperty(String pageID, String key)

As for getting the project, you get this by doing something like:

// get a handle to the wizard
IWizardPage[] pages = MBSCustomPageManager.getPages();

if(pages != null && pages.length > 0) {

ICDTCommonProjectWizard wizard = (ICDTCommonProjectWizard) pages[0].getWizard();
IProject project = wizard.getLastProject();

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

Inactive hide details for Corey Ashford ---05/10/2011 06:56:56 PM---Hello, I am looking at adding one or more custom wizard pagCorey Ashford ---05/10/2011 06:56:56 PM---Hello, I am looking at adding one or more custom wizard pages to the C/C++


From:

Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>

To:

CDT General developers list <cdt-dev@xxxxxxxxxxx>

Date:

05/10/2011 06:56 PM

Subject:

[cdt-dev] Question about the org.eclipse.cdt.managedbuilder.ui.newWizardPages extension

Sent by:

cdt-dev-bounces@xxxxxxxxxxx





Hello,

I am looking at adding one or more custom wizard pages to the C/C++
project creation wizard.  What I want these added pages to do is examine
and possibly modify some of the compiler and linker options, that are
normally available under the "Advanced Settings->Settings" dialog.

Is it a reasonable thing to want to do, or does it break some design rule?

Is this something that's relatively easy to do?

I would guess that just modifying the .cproject XML is not going to be
enough to get the new project settings to take hold, that there's likely
to be some in-memory representation that would need to be refreshed.

I've been looking at the org.eclipse.cdt.managedbuild.ui.newWizardPages
extension, but the operationClass's IRunnable.run() is not passed any
parameters at all.  So it's not at all clear to me as to how to gain
access to the newly created project, and its settings.

Any pointers would be appreciated.

Thanks for your consideration,

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


GIF image

GIF image


Back to the top