Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] dynamically changing enumeration values

Hello Wieant,
We have also implemented similar functionality.

Applicability calculator is the place where you can check for the
selected option.
You can add the following code to access the CPU option.


IToolChain toolChain = configuration.getToolChain();
ITool[] tools = toolChain.getTools();
IOption CPUListOption = null;
for (int i = 0; i < tools.length; i++) {
	if (tools[i].getOptionBySuperClassId(configTypeID) != null) {
		CPUListOption =
tools[i].getOptionBySuperClassId(configTypeID);
		}
	}
If you have to change the CPU list for all configurations you have to
loop the above code.
Once you get the CPUListOption you can set the option by using
ManagedBuildManager.setOption().

Hope this helps.

Regards
-Sanchali

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Wieant Nielander
Sent: Wednesday, August 16, 2006 5:04 PM
To: CDT General developers list.
Subject: [cdt-dev] dynamically changing enumeration values


In the build options for our toolchains we generally have an enumeration
option to select the target CPU. For some toolchains the number of
possible
CPUs may however be quite large, and in order to facilitate CPU
selection
we would like to add another (enumeration) option that allows selection
of
a subset of CPUs (e.g. by manufacturer). 

Now my question is how to dynamically change the list of selectable
enumeration values based on another option setting, thus in the above
case
changing a manufacturer should change the list of selectable items in
the
CPU selection box?

I tried the 'valueHandler' option extension, but that only seems to
filter
the enumeration values on creation of the combo box.  The option
applicability calculator on the other hand does get called whenever an
option changes, but I couldn't find a way to get access to the required
combo box in order to change its items list.

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


Back to the top