Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Custom Wizard Page Operation's Run Priority

Karol Krizka wrote:

I am working on a CDT projectType that needs to have a certain
environment configured before it can be created. What I though of
doing is to add an custom wizard page using the
org.eclipse.cdt.managedbuilder.ui.newWizardPages extension, where the
user will be asked to enter the configuration for the environment.
Actually, you shouldn't create new dialogs, it's already there. You can see it if you on Select Configuration page press Advanced Settings button. The tricky thing is if you'd like calculate environment using some basic parameters. In this case you can use class which implements IConfigurationEnvironmentVariableSupplier interface. In my case for example I calculate environment from platform, compiler version, language type and something else. To simplify users task I let him edit these more obvious parameters on the extra tab property page, then reevaluate environment (automatically). On the other hand user can edit environment directly. Anyway, I couldn't do these changes without changing of CDT stuff.

Then I wanted to use the operationClass to process the information,
run the necessary commands and create the project using a template.
But the problem is that the operationClass is run after the project is
created, which is too late. I have several ideas on how to get around
this, but they seem a bit hacky and I'm wondering if there is a
cleaner way to make sure that operationClass runs before the project
is created.
This functionality exists in MBS and "almost" works. MBSWizardHandler has doCustom method. To do extra work during project creation I had to create invisible custom page and added custom operation to it. It works smooth now, but unfortunately I had to change CDT stuff once again (not much, I hope).

Here is what I'm thinking of doing
1) Add a button to the custom wizard page that says "configure
environment". Clicking it will run what needs to be run and enables
the Next/Finish buttons of the wizard.

2) Add another custom process at the beginning of the template that
will somehow grab the options and run the scripts. I don't like this
approach, because I plan to create several templates for the
projectType, and I don't really want to make sure that the custom
process is included in every one of them...

On a slightly related topic, is it possible to dynamically add/delete
the custom page to the wizard? I know I can specity the projectType,
natureID and toolchainID of projects for which to display the page,
but that is not enough for what I need to do. The environment that
this page will be created for is specific to the entire workspace, so
I only need to display it the first time the user tries to create a
project. What I'm thinking of doing is showing editable text boxes if
he has not configured it yet and labels with current options if he has
configured it, but it would be even better if I could not display
anything at all.

Yes, you can manipulate pages visibility as well as re-evaluate dynamically previous and next pages

Sorry if my comments were too brief or just besides the point.



Back to the top