Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-04-25 00:38:22 -0400
committerAndrew Gvozdev2011-04-25 00:38:22 -0400
commit0a90b65e971ba1c562a9f04e454405fafbba7c84 (patch)
treea50b3e7abcd4c4f528985a934b57b43317eee4d2 /build/org.eclipse.cdt.managedbuilder.ui
parentbd992e2e922b4a5f0df7f819f958d69ba6878302 (diff)
downloadorg.eclipse.cdt-0a90b65e971ba1c562a9f04e454405fafbba7c84.tar.gz
org.eclipse.cdt-0a90b65e971ba1c562a9f04e454405fafbba7c84.tar.xz
org.eclipse.cdt-0a90b65e971ba1c562a9f04e454405fafbba7c84.zip
bug 222817: [Contribution] <enablement and applicability calculator support with Option Category
Patch from Miwako Tokugawa
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java16
3 files changed, 26 insertions, 11 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
index 215d396cf6..87ce6f2c98 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
@@ -189,7 +189,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
*/
@Override
protected void createFieldEditors() {
- // true if he user selected "Display tool option tips at a fixed location" in Preferences AND
+ // true if the user selected "Display tool option tips at a fixed location" in Preferences AND
// and we are displaying the tool tip box on this page because one or more option has non-empty tool tip.
boolean pageHasToolTipBox = isToolTipBoxNeeded();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
index 940e7f2427..43bd6109bd 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2010 IBM Corporation and others.
+ * Copyright (c) 2002, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Timesys - Initial API and implementation
* IBM Rational Software
+ * Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
@@ -18,6 +19,7 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
+import org.eclipse.cdt.managedbuilder.core.IOptionCategoryApplicability;
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
import org.eclipse.cdt.managedbuilder.core.ITool;
@@ -66,7 +68,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
for (int i=0; i<filteredTools.length; i++) {
ToolListElement e = new ToolListElement(filteredTools[i]);
elementList.add(e);
- createChildElements(e);
+ createChildElements(e,config);
}
}
return elementList.toArray(new ToolListElement[elementList.size()]);
@@ -93,11 +95,15 @@ public class ToolListContentProvider implements ITreeContentProvider{
}
return elementList.toArray(new ToolListElement[elementList.size()]);
}
-
private void createChildElements(ToolListElement parentElement) {
+ createChildElements(parentElement,null);
+ }
+
+ private void createChildElements(ToolListElement parentElement, IConfiguration config) {
IOptionCategory parent = parentElement.getOptionCategory();
IHoldsOptions optHolder = parentElement.getHoldOptions();
+ IOptionCategoryApplicability applicabilityCalculator = null;
if (parent == null) {
parent = parentElement.getTool().getTopOptionCategory(); // Must be an ITool
optHolder = parentElement.getTool();
@@ -106,8 +112,11 @@ public class ToolListContentProvider implements ITreeContentProvider{
// Create an element for each one
for (int i=0; i<cats.length; i++) {
ToolListElement e = new ToolListElement(parentElement, optHolder, cats[i]);
- parentElement.addChildElement(e);
- createChildElements(e);
+ applicabilityCalculator = e.getOptionCategory().getApplicabilityCalculator();
+ if (applicabilityCalculator == null || applicabilityCalculator.isOptionCategoryVisible(config, optHolder, parent)) {
+ parentElement.addChildElement(e);
+ createChildElements(e,config);
+ }
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
index ff598d300c..d4867f9d08 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
@@ -133,6 +133,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
propertyObject = page.getElement();
setValues();
+ specificResize();
}
private void specificResize() {
@@ -433,7 +434,6 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
optionList.setSelection(new StructuredSelection(selectedElement), true);
}
}
- specificResize();
}
private ToolListElement matchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
@@ -514,8 +514,11 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
}
// Reset the category or tool selection and run selection event handler
selectedElement = null;
- handleOptionSelection();
setDirty(true);
+
+ fInfo = getResCfg(getResDesc());
+ setValues();
+ handleOptionSelection();
}
/*
@@ -712,9 +715,10 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
@Override
public void updateData(ICResourceDescription cfgd) {
- fInfo = getResCfg(cfgd);
- setValues();
- handleOptionSelection();
+ fInfo = getResCfg(cfgd);
+ setValues();
+ specificResize();
+ handleOptionSelection();
}
@Override
@@ -737,6 +741,8 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
copyHoldsOptions(pair.getKey(), pair.getValue(), ri2);
}
setDirty(false);
+
+ updateData(getResDesc());
}
/**

Back to the top