1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 533473 - Dynamically hide option categories

Allow applicabilityCalculator to hide optionCategory items that are
located on the toolchain. Show in the schema that
applicabilityCalculator is a valid attribute for optionCategory.

Change-Id: I6adb22b0af2a2c7fe45ea142049fcc2687d105b9
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2018-04-12 12:39:28 +02:00
parent 91a142fcb7
commit 47d08ec204
2 changed files with 17 additions and 3 deletions

View file

@ -1186,6 +1186,16 @@ The path is relative to the plug-in directory which defines .buildDefinitions.
</appInfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="applicabilityCalculator" type="string">
<annotation>
<documentation>
Optional class which is used to determine dynamically at runtime whether the option category is visible. This class must implement the IOptionCategoryApplicability interface. If no calculator is specified then the option category is always visible.
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.eclipse.cdt.managedbuilder.core.IOptionCategoryApplicability"/>
</appInfo>
</annotation>
</attribute>
</complexType> </complexType>
</element> </element>
@ -1451,7 +1461,7 @@ Additional special types exist to flag options of special relevance to the build
<attribute name="applicabilityCalculator" type="string"> <attribute name="applicabilityCalculator" type="string">
<annotation> <annotation>
<documentation> <documentation>
Optional class which is used to determine dynamically at runtime whether the option is visible, enabled, and used in command line generation. This class must impelment the IOptionApplicability interface. If no calculator is specified then the option is always visible, enabled, and used in command line generation. Optional class which is used to determine dynamically at runtime whether the option is visible, enabled, and used in command line generation. This class must implement the IOptionApplicability interface. If no calculator is specified then the option is always visible, enabled, and used in command line generation.
</documentation> </documentation>
<appInfo> <appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.IOptionApplicability"/> <meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.IOptionApplicability"/>

View file

@ -9,6 +9,7 @@
* Timesys - Initial API and implementation * Timesys - Initial API and implementation
* IBM Rational Software * IBM Rational Software
* Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability) * Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability)
* Torbjörn Svensson (STMicroelectronics) - bug #533473
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
@ -60,9 +61,12 @@ public class ToolListContentProvider implements ITreeContentProvider{
// Create an element for each one // Create an element for each one
for (int i=0; i<toolChainCategories.length; i++) { for (int i=0; i<toolChainCategories.length; i++) {
ToolListElement e = new ToolListElement(null, toolChain, toolChainCategories[i]); ToolListElement e = new ToolListElement(null, toolChain, toolChainCategories[i]);
IOptionCategoryApplicability applicabilityCalculator = toolChainCategories[i].getApplicabilityCalculator();
if (applicabilityCalculator == null || applicabilityCalculator.isOptionCategoryVisible(config, e.getHoldOptions(), e.getOptionCategory())) {
elementList.add(e); elementList.add(e);
createChildElements(e); createChildElements(e);
} }
}
// Get the tools to be displayed // Get the tools to be displayed
filteredTools = config.getFilteredTools(); filteredTools = config.getFilteredTools();
// Create an element for each one // Create an element for each one