Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorOleg Krasilnikov2008-02-06 11:51:16 +0000
committerOleg Krasilnikov2008-02-06 11:51:16 +0000
commitba4b0ab3ed85613b84803a3eca76fda172e60045 (patch)
treea11af0c45b299c953be42baa46d23a7e117f58e8 /build
parent622b2739c31ba837fb1c852077c75b4fe4e8deb9 (diff)
downloadorg.eclipse.cdt-ba4b0ab3ed85613b84803a3eca76fda172e60045.tar.gz
org.eclipse.cdt-ba4b0ab3ed85613b84803a3eca76fda172e60045.tar.xz
org.eclipse.cdt-ba4b0ab3ed85613b84803a3eca76fda172e60045.zip
Disable unnecessary isOptionVisible() check during page creation.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java204
1 files changed, 102 insertions, 102 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 771fee9c688..6cf617724d8 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
@@ -121,114 +121,114 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
IBuildObject config = fInfo;
- if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
-
- try {
- // Figure out which type the option is and add a proper field
- // editor for it
- Composite fieldEditorParent = getFieldEditorParent();
- FieldEditor fieldEditor;
-
- switch (opt.getValueType()) {
- case IOption.STRING: {
- StringFieldEditor stringField;
-
- // If browsing is set, use a field editor that has a
- // browse button of the appropriate type.
- switch (opt.getBrowseType()) {
- case IOption.BROWSE_DIR: {
- stringField = new DirectoryFieldEditor(optId, opt.getName(), fieldEditorParent);
- } break;
-
- case IOption.BROWSE_FILE: {
- stringField = new FileFieldEditor(optId, opt.getName(), fieldEditorParent);
- } break;
-
- case IOption.BROWSE_NONE: {
- final StringFieldEditorM local = new StringFieldEditorM(optId, opt.getName(), fieldEditorParent);
- stringField = local;
- local.getTextControl().addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- local.valueChanged();
- }
- });
- } break;
-
- default: {
- throw new BuildException(null);
- }
- }
+// Check for (un)visibility is now performed in setFieldEditorEnablement()
+// if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt))
+// {
- stringField.getTextControl(fieldEditorParent).setToolTipText(opt.getToolTip());
- stringField.getLabelControl(fieldEditorParent).setToolTipText(opt.getToolTip());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(stringField.getTextControl(fieldEditorParent), opt.getContextId());
- fieldEditor = stringField;
- } break;
-
- case IOption.BOOLEAN: {
- fieldEditor = new TriStateBooleanFieldEditor(
- optId,
- opt.getName(),
- opt.getToolTip(),
- fieldEditorParent,
- opt.getContextId(),
- ohs,
- curr);
- } break;
-
- case IOption.ENUMERATED: {
- String selId = opt.getSelectedEnum();
- String sel = opt.getEnumName(selId);
-
- // Get all applicable values for this enumerated Option, But display
- // only the enumerated values that are valid (static set of enumerated values defined
- // in the plugin.xml file) in the UI Combobox. This refrains the user from selecting an
- // invalid value and avoids issuing an error message.
- String[] enumNames = opt.getApplicableValues();
- Vector<String> enumValidList = new Vector<String>();
- for (int i = 0; i < enumNames.length; ++i) {
- if (opt.getValueHandler().isEnumValueAppropriate(config,
- opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) {
- enumValidList.add(enumNames[i]);
- }
+ try {
+ // Figure out which type the option is and add a proper field
+ // editor for it
+ Composite fieldEditorParent = getFieldEditorParent();
+ FieldEditor fieldEditor;
+
+ switch (opt.getValueType()) {
+ case IOption.STRING: {
+ StringFieldEditor stringField;
+
+ // If browsing is set, use a field editor that has a
+ // browse button of the appropriate type.
+ switch (opt.getBrowseType()) {
+ case IOption.BROWSE_DIR: {
+ stringField = new DirectoryFieldEditor(optId, opt.getName(), fieldEditorParent);
+ } break;
+
+ case IOption.BROWSE_FILE: {
+ stringField = new FileFieldEditor(optId, opt.getName(), fieldEditorParent);
+ } break;
+
+ case IOption.BROWSE_NONE: {
+ final StringFieldEditorM local = new StringFieldEditorM(optId, opt.getName(), fieldEditorParent);
+ stringField = local;
+ local.getTextControl().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ local.valueChanged();
}
- String[] enumValidNames = new String[enumValidList.size()];
- enumValidList.copyInto(enumValidNames);
-
- fieldEditor = new BuildOptionComboFieldEditor(optId, opt.getName(), opt.getToolTip(), opt.getContextId(), enumValidNames, sel, fieldEditorParent);
- } break;
-
- case IOption.INCLUDE_PATH:
- case IOption.STRING_LIST:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
- case IOption.INCLUDE_FILES:
- case IOption.LIBRARY_PATHS:
- case IOption.LIBRARY_FILES:
- case IOption.MACRO_FILES:
- case IOption.UNDEF_INCLUDE_PATH:
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
- case IOption.UNDEF_INCLUDE_FILES:
- case IOption.UNDEF_LIBRARY_PATHS:
- case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES: {
- fieldEditor = new FileListControlFieldEditor(optId, opt.getName(), opt.getToolTip(), opt.getContextId(), fieldEditorParent, opt.getBrowseType());
- } break;
-
- default:
- throw new BuildException(null);
+ });
+ } break;
+
+ default: {
+ throw new BuildException(null);
+ }
+ }
+
+ stringField.getTextControl(fieldEditorParent).setToolTipText(opt.getToolTip());
+ stringField.getLabelControl(fieldEditorParent).setToolTipText(opt.getToolTip());
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(stringField.getTextControl(fieldEditorParent), opt.getContextId());
+ fieldEditor = stringField;
+ } break;
+
+ case IOption.BOOLEAN: {
+ fieldEditor = new TriStateBooleanFieldEditor(
+ optId,
+ opt.getName(),
+ opt.getToolTip(),
+ fieldEditorParent,
+ opt.getContextId(),
+ ohs,
+ curr);
+ } break;
+
+ case IOption.ENUMERATED: {
+ String selId = opt.getSelectedEnum();
+ String sel = opt.getEnumName(selId);
+
+ // Get all applicable values for this enumerated Option, But display
+ // only the enumerated values that are valid (static set of enumerated values defined
+ // in the plugin.xml file) in the UI Combobox. This refrains the user from selecting an
+ // invalid value and avoids issuing an error message.
+ String[] enumNames = opt.getApplicableValues();
+ Vector<String> enumValidList = new Vector<String>();
+ for (int i = 0; i < enumNames.length; ++i) {
+ if (opt.getValueHandler().isEnumValueAppropriate(config,
+ opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) {
+ enumValidList.add(enumNames[i]);
+ }
}
+ String[] enumValidNames = new String[enumValidList.size()];
+ enumValidList.copyInto(enumValidNames);
+
+ fieldEditor = new BuildOptionComboFieldEditor(optId, opt.getName(), opt.getToolTip(), opt.getContextId(), enumValidNames, sel, fieldEditorParent);
+ } break;
+
+ case IOption.INCLUDE_PATH:
+ case IOption.STRING_LIST:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS:
+ case IOption.INCLUDE_FILES:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_PATH:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES: {
+ fieldEditor = new FileListControlFieldEditor(optId, opt.getName(), opt.getToolTip(), opt.getContextId(), fieldEditorParent, opt.getBrowseType());
+ } break;
+
+ default:
+ throw new BuildException(null);
+ }
- setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
+ setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
- addField(fieldEditor);
- fieldsMap.put(optId, fieldEditor);
- fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
+ addField(fieldEditor);
+ fieldsMap.put(optId, fieldEditor);
+ fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
- } catch (BuildException e) {
- }
- }
+ } catch (BuildException e) {}
}
}

Back to the top