1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Bug 388484: Cosmetics

This commit is contained in:
Andrew Gvozdev 2013-07-18 03:11:38 -04:00
parent 76fcfce0ab
commit fd53d6c37c
3 changed files with 882 additions and 1172 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2003, 2011 IBM Corporation and others. * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -17,8 +17,8 @@ package org.eclipse.cdt.managedbuilder.core;
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData; import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
/** /**
* Basic Tool / Toolchain Option type. * Basic Tool / Tool-chain Option type.
* *
* @noextend This class is not intended to be subclassed by clients. * @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
@ -33,7 +33,7 @@ public interface IOption extends IBuildObject {
/** /**
* String list of library names to link against searched for * String list of library names to link against searched for
* via LIBRARY_PATHS by the linker. In the GNU * via LIBRARY_PATHS by the linker. In the GNU
* toolchain these correspond to -l{lib_name}. <br/> * tool-chain these correspond to -l{lib_name}. <br/>
* This option type is persisted / referenced by the name * This option type is persisted / referenced by the name
* {@link IOption#TYPE_LIB} * {@link IOption#TYPE_LIB}
*/ */
@ -42,7 +42,7 @@ public interface IOption extends IBuildObject {
public static final int INCLUDE_FILES = 8; public static final int INCLUDE_FILES = 8;
/** /**
* String list of library search paths <br/> * String list of library search paths <br/>
* This option type is persisted / referenced by the name * This option type is persisted / referenced by the name
* {@link IOption#TYPE_LIB_PATHS} * {@link IOption#TYPE_LIB_PATHS}
*/ */
public static final int LIBRARY_PATHS = 9; public static final int LIBRARY_PATHS = 9;
@ -82,7 +82,7 @@ public interface IOption extends IBuildObject {
public static final int FILTER_FILE = 1; public static final int FILTER_FILE = 1;
public static final int FILTER_PROJECT = 2; public static final int FILTER_PROJECT = 2;
public static final String PROJECT = "project"; //$NON-NLS-1$ public static final String PROJECT = "project"; //$NON-NLS-1$
// Schema attribute names for option elements // Schema attribute names for option elements
public static final String BROWSE_TYPE = "browseType"; //$NON-NLS-1$ public static final String BROWSE_TYPE = "browseType"; //$NON-NLS-1$
/** @since 7.0 */ /** @since 7.0 */
@ -148,12 +148,12 @@ public interface IOption extends IBuildObject {
* @since 8.1 * @since 8.1
*/ */
public static final String TYPE_TREE = "tree"; //$NON-NLS-1$ public static final String TYPE_TREE = "tree"; //$NON-NLS-1$
public static final String VALUE = "value"; //$NON-NLS-1$ public static final String VALUE = "value"; //$NON-NLS-1$
public static final String VALUE_TYPE = "valueType"; //$NON-NLS-1$ public static final String VALUE_TYPE = "valueType"; //$NON-NLS-1$
public static final String VALUE_HANDLER = "valueHandler"; //$NON-NLS-1$ public static final String VALUE_HANDLER = "valueHandler"; //$NON-NLS-1$
public static final String VALUE_HANDLER_EXTRA_ARGUMENT = "valueHandlerExtraArgument"; //$NON-NLS-1$ public static final String VALUE_HANDLER_EXTRA_ARGUMENT = "valueHandlerExtraArgument"; //$NON-NLS-1$
/** @since 8.0 */ /** @since 8.0 */
public static final String FIELD_EDITOR_ID = "fieldEditor"; //$NON-NLS-1$ public static final String FIELD_EDITOR_ID = "fieldEditor"; //$NON-NLS-1$
/** @since 8.0 */ /** @since 8.0 */
@ -185,7 +185,7 @@ public interface IOption extends IBuildObject {
* option, or <code>null</code> if the attribute was not specified. * option, or <code>null</code> if the attribute was not specified.
*/ */
public IOption getSuperClass(); public IOption getSuperClass();
/** /**
* @param holder - the actual option-holder for the context-data. This holder * @param holder - the actual option-holder for the context-data. This holder
* is usually a subclass of this option's {@link #getOptionHolder() holder}. * is usually a subclass of this option's {@link #getOptionHolder() holder}.
@ -193,11 +193,11 @@ public interface IOption extends IBuildObject {
* @since 7.0 * @since 7.0
*/ */
public IOptionContextData getOptionContextData(IHoldsOptions holder); public IOptionContextData getOptionContextData(IHoldsOptions holder);
/** /**
* @return If this option is defined as an enumeration, this function returns * @return If this option is defined as an enumeration, this function returns
* the list of possible values for that enum. * the list of possible values for that enum.
* *
* If this option is not defined as an enumeration, it returns <code>null</code>. * If this option is not defined as an enumeration, it returns <code>null</code>.
*/ */
public String [] getApplicableValues(); public String [] getApplicableValues();
@ -206,46 +206,46 @@ public interface IOption extends IBuildObject {
* @return the value for a boolean option. * @return the value for a boolean option.
*/ */
public boolean getBooleanValue() throws BuildException; public boolean getBooleanValue() throws BuildException;
/** /**
* @return the setting of the browseType attribute * @return the setting of the browseType attribute
*/ */
public int getBrowseType(); public int getBrowseType();
/** /**
* Sets the browseType attribute. * Sets the browseType attribute.
* *
* @param type - browseType attribute * @param type - browseType attribute
*/ */
public void setBrowseType(int type); public void setBrowseType(int type);
/** /**
* @return the setting of the browseFilterPath attribute. For options of {@link #BROWSE_FILE} and {@link #BROWSE_DIR} types. * @return the setting of the browseFilterPath attribute. For options of {@link #BROWSE_FILE} and {@link #BROWSE_DIR} types.
* @since 7.0 * @since 7.0
*/ */
public String getBrowseFilterPath(); public String getBrowseFilterPath();
/** /**
* Sets the browseFilterPath attribute. For options of {@link #BROWSE_FILE} and {@link #BROWSE_DIR} types. * Sets the browseFilterPath attribute. For options of {@link #BROWSE_FILE} and {@link #BROWSE_DIR} types.
* @param path - default filter-path for the underlying browse dialog * @param path - default filter-path for the underlying browse dialog
* @since 7.0 * @since 7.0
*/ */
public void setBrowseFilterPath(String path); public void setBrowseFilterPath(String path);
/** /**
* @return the setting of the browseFilterExtensions attribute. For options of {@link #BROWSE_FILE} type. * @return the setting of the browseFilterExtensions attribute. For options of {@link #BROWSE_FILE} type.
* @since 7.0 * @since 7.0
*/ */
public String[] getBrowseFilterExtensions(); public String[] getBrowseFilterExtensions();
/** /**
* Sets the browseFilterExtensions attribute. For options of {@link #BROWSE_FILE} type. * Sets the browseFilterExtensions attribute. For options of {@link #BROWSE_FILE} type.
* @param extensions - file extensions to show in browse files dialog * @param extensions - file extensions to show in browse files dialog
* *
* @since 7.0 * @since 7.0
*/ */
public void setBrowseFilterExtensions(String[] extensions); public void setBrowseFilterExtensions(String[] extensions);
/** /**
* @return the setting of the resourceFilter attribute * @return the setting of the resourceFilter attribute
*/ */
@ -253,65 +253,65 @@ public interface IOption extends IBuildObject {
/** /**
* Sets the resourceFilter attribute. * Sets the resourceFilter attribute.
* *
* @param filter - resourceFilter attribute * @param filter - resourceFilter attribute
*/ */
public void setResourceFilter(int filter); public void setResourceFilter(int filter);
/** /**
* @return an instance of the class that calculates whether the option is visible, * @return an instance of the class that calculates whether the option is visible,
* enabled, and used in command line generation * enabled, and used in command line generation
*/ */
public IOptionApplicability getApplicabilityCalculator(); public IOptionApplicability getApplicabilityCalculator();
/** /**
* @return an array of strings containing the built-in values * @return an array of strings containing the built-in values
* defined for a stringList, includePaths, definedSymbols, or libs * defined for a stringList, includePaths, definedSymbols, or libs
* option. If none have been defined, the array will be empty but * option. If none have been defined, the array will be empty but
* never <code>null</code>. * never <code>null</code>.
*/ */
public String[] getBuiltIns(); public String[] getBuiltIns();
/** /**
* @return the category for this option. * @return the category for this option.
*/ */
public IOptionCategory getCategory(); public IOptionCategory getCategory();
/** /**
* Sets the category for this option. * Sets the category for this option.
*/ */
public void setCategory(IOptionCategory category); public void setCategory(IOptionCategory category);
/** /**
* @return a <code>String</code> containing the actual command line * @return a <code>String</code> containing the actual command line
* option associated with the option * option associated with the option
*/ */
public String getCommand(); public String getCommand();
/** /**
* @return an instance of the class that overrides the default command generation for the option * @return an instance of the class that overrides the default command generation for the option
* @since 8.0 * @since 8.0
*/ */
public IOptionCommandGenerator getCommandGenerator(); public IOptionCommandGenerator getCommandGenerator();
/** /**
* Sets a <code>String</code> containing the actual command line * Sets a <code>String</code> containing the actual command line
* option associated with the option * option associated with the option
* *
* @param command - the actual command line option * @param command - the actual command line option
*/ */
public void setCommand(String command); public void setCommand(String command);
/** /**
* @return {@code String} containing the actual command line * @return {@code String} containing the actual command line
* option associated with a Boolean option when the value is {@code false} * option associated with a Boolean option when the value is {@code false}
*/ */
public String getCommandFalse(); public String getCommandFalse();
/** /**
* Sets a <code>String</code> containing the actual command line * Sets a <code>String</code> containing the actual command line
* option associated with a Boolean option when the value is {@code false} * option associated with a Boolean option when the value is {@code false}
* *
* @param commandFalse - the actual command line option associated * @param commandFalse - the actual command line option associated
* with a Boolean option when the value is {@code false} * with a Boolean option when the value is {@code false}
*/ */
@ -322,10 +322,10 @@ public interface IOption extends IBuildObject {
* associated with the option * associated with the option
*/ */
public String getToolTip(); public String getToolTip();
/** /**
* Sets a <code>String</code> containing the tooltip associated with the option * Sets a <code>String</code> containing the tooltip associated with the option
* *
* @param tooltip - the tooltip associated with the option * @param tooltip - the tooltip associated with the option
*/ */
public void setToolTip(String tooltip); public void setToolTip(String tooltip);
@ -336,25 +336,25 @@ public interface IOption extends IBuildObject {
*/ */
public String getContextId(); public String getContextId();
/** /**
* Sets a <code>String</code> containing the contextId associated with the option * Sets a <code>String</code> containing the contextId associated with the option
* *
* @param id - the contextId associated with the option * @param id - the contextId associated with the option
*/ */
public void setContextId(String id); public void setContextId(String id);
/** /**
* @return the user-defined preprocessor symbols. * @return the user-defined preprocessor symbols.
*/ */
public String[] getDefinedSymbols() throws BuildException; public String[] getDefinedSymbols() throws BuildException;
/** /**
* *
* @param id - enumeration id * @param id - enumeration id
* @return the command associated with the enumeration id. For * @return the command associated with the enumeration id. For
* example, if the enumeration id was <code>gnu.debug.level.default</code> * example, if the enumeration id was <code>gnu.debug.level.default</code>
* for the debug level option of the Gnu compiler, and the plugin * for the debug level option of the Gnu compiler, and the plugin
* manifest defined that as -g, then the return value would be the * manifest defined that as -g, then the return value would be the
* String "-g" * String "-g"
*/ */
public String getEnumCommand (String id) throws BuildException; public String getEnumCommand (String id) throws BuildException;
@ -371,7 +371,7 @@ public interface IOption extends IBuildObject {
* manifest defined that as -g, then the return value would be the * manifest defined that as -g, then the return value would be the
* String "-g" * String "-g"
* *
* @throws BuildException * @throws BuildException if this option is not of type {@link #TREE} or {@link #ENUMERATED}
* @since 8.1 * @since 8.1
*/ */
public String getCommand (String id) throws BuildException; public String getCommand (String id) throws BuildException;
@ -417,7 +417,7 @@ public interface IOption extends IBuildObject {
* defined in the build model. * defined in the build model.
*/ */
public String[] getIncludePaths() throws BuildException; public String[] getIncludePaths() throws BuildException;
/** /**
* @return an array or <code>String</code>s containing the libraries * @return an array or <code>String</code>s containing the libraries
* that must be linked into the project. * that must be linked into the project.
@ -427,7 +427,7 @@ public interface IOption extends IBuildObject {
/** /**
* @return an array or <code>String</code>s containing the library files * @return an array or <code>String</code>s containing the library files
* that must be linked into the project. * that must be linked into the project.
* *
* @since 7.0 * @since 7.0
*/ */
public String[] getLibraryFiles() throws BuildException; public String[] getLibraryFiles() throws BuildException;
@ -442,51 +442,51 @@ public interface IOption extends IBuildObject {
public String[] getLibraryPaths() throws BuildException; public String[] getLibraryPaths() throws BuildException;
/** /**
* @return a <code>String</code> containing the unique ID of the selected * @return a <code>String</code> containing the unique ID of the selected
* enumeration in an enumerated option. For an option that has not been * enumeration in an enumerated option. For an option that has not been
* changed by the user, the receiver will answer with the default defined * changed by the user, the receiver will answer with the default defined
* in the plugin manifest. If the user has modified the selection, the * in the plugin manifest. If the user has modified the selection, the
* receiver will answer with the overridden selection. * receiver will answer with the overridden selection.
* *
* @throws BuildException if the option type is not an enumeration * @throws BuildException if the option type is not an enumeration
*/ */
public String getSelectedEnum () throws BuildException; public String getSelectedEnum () throws BuildException;
/** /**
* @return the current value for this option if it is a List of Strings. * @return the current value for this option if it is a List of Strings.
*/ */
public String [] getStringListValue() throws BuildException; public String [] getStringListValue() throws BuildException;
/** /**
* @return the current value for this option if it is a String * @return the current value for this option if it is a String
*/ */
public String getStringValue() throws BuildException; public String getStringValue() throws BuildException;
/** /**
* @return all of the user-defined object files that must be linked with * @return all of the user-defined object files that must be linked with
* the final build target. * the final build target.
*/ */
public String [] getUserObjects() throws BuildException; public String [] getUserObjects() throws BuildException;
/** /**
* @return the raw value of this option which is the Object that contains the raw value of the option. * @return the raw value of this option which is the Object that contains the raw value of the option.
* The type of Object is specific to the option type. * The type of Object is specific to the option type.
*/ */
public Object getValue(); public Object getValue();
/** /**
* @return the raw default value of this option which is the Object that contains the raw default value of the option. * @return the raw default value of this option which is the Object that contains the raw default value of the option.
* The type of Object is specific to the option type. * The type of Object is specific to the option type.
*/ */
public Object getDefaultValue(); public Object getDefaultValue();
/** /**
* @return the type for the value of the option. * @return the type for the value of the option.
*/ */
public int getValueType() throws BuildException; public int getValueType() throws BuildException;
/** /**
* Sets the boolean value of the receiver to the value specified in the argument. * Sets the boolean value of the receiver to the value specified in the argument.
* If the receiver is not a reference to a boolean option, method will throw an * If the receiver is not a reference to a boolean option, method will throw an
* exception. * exception.
*/ */
@ -496,25 +496,25 @@ public interface IOption extends IBuildObject {
* Sets the string value of the receiver to the value specified in the argument. * Sets the string value of the receiver to the value specified in the argument.
*/ */
public void setValue(String value) throws BuildException; public void setValue(String value) throws BuildException;
/** /**
* Sets the value of the receiver to be an array of strings. * Sets the value of the receiver to be an array of strings.
* *
* @param value An array of strings to place in the option reference. * @param value An array of strings to place in the option reference.
*/ */
public void setValue(String [] value) throws BuildException; public void setValue(String [] value) throws BuildException;
/** /**
* Sets the raw value of this option. * Sets the raw value of this option.
* *
* @param v The Object that contains the raw value of the option. The type * @param v The Object that contains the raw value of the option. The type
* of Object is specific to the option type. * of Object is specific to the option type.
*/ */
public void setValue(Object v); public void setValue(Object v);
/** /**
* Sets the default value of this option. * Sets the default value of this option.
* *
* @param v The Object that contains the default value of the option. The type * @param v The Object that contains the default value of the option. The type
* of Object is specific to the option type. * of Object is specific to the option type.
*/ */
@ -524,19 +524,19 @@ public interface IOption extends IBuildObject {
* Sets the value-type of this option. Use with care. * Sets the value-type of this option. Use with care.
*/ */
public void setValueType(int type); public void setValueType(int type);
/** /**
* @return the value handler specified for this tool. * @return the value handler specified for this tool.
* @since 3.0 * @since 3.0
*/ */
public IManagedOptionValueHandler getValueHandler(); public IManagedOptionValueHandler getValueHandler();
/** /**
* @return the value handlers extra argument specified for this tool * @return the value handlers extra argument specified for this tool
* @since 3.0 * @since 3.0
*/ */
public String getValueHandlerExtraArgument(); public String getValueHandlerExtraArgument();
/** /**
* Sets the value handlers extra argument specified for this tool * Sets the value handlers extra argument specified for this tool
* @since 3.0 * @since 3.0
@ -545,25 +545,25 @@ public interface IOption extends IBuildObject {
/** /**
* @return the custom field-editor ID for this build-option. This ID should match a custom-field editor * @return the custom field-editor ID for this build-option. This ID should match a custom-field editor
* contributed through the {@code <fieldEditor>} element of the * contributed through the {@code <fieldEditor>} element of the
* {@code org.eclipse.cdt.managedbuilder.ui.buildDefinitionsUI} extension-point. * {@code org.eclipse.cdt.managedbuilder.ui.buildDefinitionsUI} extension-point.
* @since 8.0 * @since 8.0
*/ */
public String getFieldEditorId(); public String getFieldEditorId();
/** /**
* @return an optional extra argument for the {@link #getFieldEditorId() field-editor}. * @return an optional extra argument for the {@link #getFieldEditorId() field-editor}.
* @since 8.0 * @since 8.0
*/ */
public String getFieldEditorExtraArgument(); public String getFieldEditorExtraArgument();
/** /**
* Sets the optional extra argument for the field-editor. * Sets the optional extra argument for the field-editor.
* @param extraArgument free-form extra argument to be interpreted by the {@link #getFieldEditorId() field-editor} * @param extraArgument free-form extra argument to be interpreted by the {@link #getFieldEditorId() field-editor}
* @since 8.0 * @since 8.0
*/ */
public void setFieldEditorExtraArgument(String extraArgument); public void setFieldEditorExtraArgument(String extraArgument);
/** /**
* @return <code>true</code> if this option was loaded from a manifest file, * @return <code>true</code> if this option was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file. * and <code>false</code> if it was loaded from a project (.cdtbuild) file.
@ -573,15 +573,15 @@ public interface IOption extends IBuildObject {
/** /**
* @return <code>true</code> if this option is valid and <code>false</code> * @return <code>true</code> if this option is valid and <code>false</code>
* if the option cannot be safely used due to an error in the MBS grammar. * if the option cannot be safely used due to an error in the MBS grammar.
* *
* @since 3.0 * @since 3.0
* *
* @pre Can only be used after Ids in MBS grammar have been resolved by pointers. * @pre Can only be used after Ids in MBS grammar have been resolved by pointers.
*/ */
public boolean isValid(); public boolean isValid();
/** /**
* @return the type of the option value, i.e. whether it is string, boolean, * @return the type of the option value, i.e. whether it is string, boolean,
* string list or enumeration. As opposed to the getValueType() method, * string list or enumeration. As opposed to the getValueType() method,
* the returned type does not specifies the "sense" of the value, e.g. whether it represents the list of includes or not. * the returned type does not specifies the "sense" of the value, e.g. whether it represents the list of includes or not.
* *
@ -596,13 +596,13 @@ public interface IOption extends IBuildObject {
* {@link IOption#LIBRARY_FILES}, {@link IOption#MACRO_FILES} * {@link IOption#LIBRARY_FILES}, {@link IOption#MACRO_FILES}
*/ */
int getBasicValueType() throws BuildException ; int getBasicValueType() throws BuildException ;
/** /**
* @return in case the option basic value type is STRING_LIST, returns the String list value, * @return in case the option basic value type is STRING_LIST, returns the String list value,
* throws BuildException otherwise * throws BuildException otherwise
*/ */
String[] getBasicStringListValue() throws BuildException; String[] getBasicStringListValue() throws BuildException;
public OptionStringValue[] getBasicStringListValueElements() throws BuildException; public OptionStringValue[] getBasicStringListValueElements() throws BuildException;
/** /**
@ -693,9 +693,9 @@ public interface IOption extends IBuildObject {
/** /**
* Adds a new child directly under this node. * Adds a new child directly under this node.
* @param id * @param id The id of the new child.
* @param name * @param name The name of the new child.
* @return * @return The added child.
*/ */
ITreeOption addChild(String id, String name); ITreeOption addChild(String id, String name);
void remove(); void remove();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2003, 2011 IBM Corporation and others. * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -113,46 +113,46 @@ public class OptionReference implements IOption {
// value // value
switch (optValType) { switch (optValType) {
case BOOLEAN: case BOOLEAN:
value = new Boolean(element.getAttribute(DEFAULT_VALUE)); value = new Boolean(element.getAttribute(DEFAULT_VALUE));
break; break;
case STRING: case STRING:
case TREE: case TREE:
case ENUMERATED: case ENUMERATED:
// Pre-2.0 the value was the string for the UI // Pre-2.0 the value was the string for the UI
// Post-2.0 it is the ID of the enumerated option // Post-2.0 it is the ID of the enumerated option
value = element.getAttribute(DEFAULT_VALUE); value = element.getAttribute(DEFAULT_VALUE);
break; break;
case STRING_LIST: case STRING_LIST:
case INCLUDE_PATH: case INCLUDE_PATH:
case PREPROCESSOR_SYMBOLS: case PREPROCESSOR_SYMBOLS:
case LIBRARIES: case LIBRARIES:
case OBJECTS: case OBJECTS:
case INCLUDE_FILES: case INCLUDE_FILES:
case LIBRARY_PATHS: case LIBRARY_PATHS:
case LIBRARY_FILES: case LIBRARY_FILES:
case MACRO_FILES: case MACRO_FILES:
case UNDEF_INCLUDE_PATH: case UNDEF_INCLUDE_PATH:
case UNDEF_PREPROCESSOR_SYMBOLS: case UNDEF_PREPROCESSOR_SYMBOLS:
case UNDEF_INCLUDE_FILES: case UNDEF_INCLUDE_FILES:
case UNDEF_LIBRARY_PATHS: case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES: case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES: case UNDEF_MACRO_FILES:
List<String> valueList = new ArrayList<String>(); List<String> valueList = new ArrayList<String>();
NodeList nodes = element.getElementsByTagName(LIST_VALUE); NodeList nodes = element.getElementsByTagName(LIST_VALUE);
for (int i = 0; i < nodes.getLength(); ++i) { for (int i = 0; i < nodes.getLength(); ++i) {
Node node = nodes.item(i); Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeType() == Node.ELEMENT_NODE) {
Boolean isBuiltIn = new Boolean(((Element)node).getAttribute(LIST_ITEM_BUILTIN)); Boolean isBuiltIn = new Boolean(((Element)node).getAttribute(LIST_ITEM_BUILTIN));
if (isBuiltIn.booleanValue()) { if (isBuiltIn.booleanValue()) {
getBuiltInList().add(((Element)node).getAttribute(LIST_ITEM_VALUE)); getBuiltInList().add(((Element)node).getAttribute(LIST_ITEM_VALUE));
} else { } else {
valueList.add(((Element)node).getAttribute(LIST_ITEM_VALUE)); valueList.add(((Element)node).getAttribute(LIST_ITEM_VALUE));
}
} }
} }
value = valueList; }
break; value = valueList;
break;
} }
} }
@ -184,48 +184,47 @@ public class OptionReference implements IOption {
// value // value
switch (optValType) { switch (optValType) {
case BOOLEAN: case BOOLEAN:
value = new Boolean(element.getAttribute(DEFAULT_VALUE)); value = new Boolean(element.getAttribute(DEFAULT_VALUE));
break; break;
case STRING: case STRING:
value = element.getAttribute(DEFAULT_VALUE); value = element.getAttribute(DEFAULT_VALUE);
break; break;
case TREE: case TREE:
case ENUMERATED: case ENUMERATED:
String temp = element.getAttribute(DEFAULT_VALUE); String temp = element.getAttribute(DEFAULT_VALUE);
if (temp != null) { if (temp != null) {
value = temp; value = temp;
}
break;
case STRING_LIST:
case INCLUDE_PATH:
case PREPROCESSOR_SYMBOLS:
case LIBRARIES:
case OBJECTS:
case INCLUDE_FILES:
case LIBRARY_PATHS:
case LIBRARY_FILES:
case MACRO_FILES:
case UNDEF_INCLUDE_PATH:
case UNDEF_PREPROCESSOR_SYMBOLS:
case UNDEF_INCLUDE_FILES:
case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES:
List<String> valueList = new ArrayList<String>();
IManagedConfigElement[] valueElements = element.getChildren(LIST_VALUE);
for (IManagedConfigElement valueElement : valueElements) {
Boolean isBuiltIn = new Boolean(valueElement.getAttribute(LIST_ITEM_BUILTIN));
if (isBuiltIn.booleanValue()) {
getBuiltInList().add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
} }
break; else {
case STRING_LIST: valueList.add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
case INCLUDE_PATH:
case PREPROCESSOR_SYMBOLS:
case LIBRARIES:
case OBJECTS:
case INCLUDE_FILES:
case LIBRARY_PATHS:
case LIBRARY_FILES:
case MACRO_FILES:
case UNDEF_INCLUDE_PATH:
case UNDEF_PREPROCESSOR_SYMBOLS:
case UNDEF_INCLUDE_FILES:
case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES:
List<String> valueList = new ArrayList<String>();
IManagedConfigElement[] valueElements = element.getChildren(LIST_VALUE);
for (int i = 0; i < valueElements.length; ++i) {
IManagedConfigElement valueElement = valueElements[i];
Boolean isBuiltIn = new Boolean(valueElement.getAttribute(LIST_ITEM_BUILTIN));
if (isBuiltIn.booleanValue()) {
getBuiltInList().add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
}
else {
valueList.add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
}
} }
value = valueList; }
break; value = valueList;
break;
} }
} }
} }
@ -246,133 +245,104 @@ public class OptionReference implements IOption {
// value // value
switch (optValType) { switch (optValType) {
case BOOLEAN: case BOOLEAN:
element.setAttribute(DEFAULT_VALUE, ((Boolean)value).toString()); element.setAttribute(DEFAULT_VALUE, ((Boolean)value).toString());
break; break;
case STRING: case STRING:
case TREE: case TREE:
case ENUMERATED: case ENUMERATED:
element.setAttribute(DEFAULT_VALUE, (String)value); element.setAttribute(DEFAULT_VALUE, (String)value);
break; break;
case STRING_LIST: case STRING_LIST:
case INCLUDE_PATH: case INCLUDE_PATH:
case PREPROCESSOR_SYMBOLS: case PREPROCESSOR_SYMBOLS:
case LIBRARIES: case LIBRARIES:
case OBJECTS: case OBJECTS:
case INCLUDE_FILES: case INCLUDE_FILES:
case LIBRARY_PATHS: case LIBRARY_PATHS:
case LIBRARY_FILES: case LIBRARY_FILES:
case MACRO_FILES: case MACRO_FILES:
case UNDEF_INCLUDE_PATH: case UNDEF_INCLUDE_PATH:
case UNDEF_PREPROCESSOR_SYMBOLS: case UNDEF_PREPROCESSOR_SYMBOLS:
case UNDEF_INCLUDE_FILES: case UNDEF_INCLUDE_FILES:
case UNDEF_LIBRARY_PATHS: case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES: case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES: case UNDEF_MACRO_FILES:
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> stringList = (ArrayList<String>)value; ArrayList<String> stringList = (ArrayList<String>)value;
for (String val : stringList) { for (String val : stringList) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, val);
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false"); //$NON-NLS-1$
element.appendChild(valueElement);
}
// Serialize the built-ins that have been overridden
if (builtIns != null) {
for (String builtIn : builtIns) {
Element valueElement = doc.createElement(LIST_VALUE); Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, val); valueElement.setAttribute(LIST_ITEM_VALUE, builtIn);
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false"); //$NON-NLS-1$ valueElement.setAttribute(LIST_ITEM_BUILTIN, "true"); //$NON-NLS-1$
element.appendChild(valueElement); element.appendChild(valueElement);
} }
// Serialize the built-ins that have been overridden }
if (builtIns != null) { break;
for (String builtIn : builtIns) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, builtIn);
valueElement.setAttribute(LIST_ITEM_BUILTIN, "true"); //$NON-NLS-1$
element.appendChild(valueElement);
}
}
break;
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getOptionContextData(org.eclipse.cdt.managedbuilder.core.IHoldsOptions)
*/
@Override @Override
public IOptionContextData getOptionContextData(IHoldsOptions holder) { public IOptionContextData getOptionContextData(IHoldsOptions holder) {
return option.getOptionContextData(holder); return option.getOptionContextData(holder);
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues()
*/
@Override @Override
public String[] getApplicableValues() { public String[] getApplicableValues() {
return option.getApplicableValues(); return option.getApplicableValues();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCategory()
*/
@Override @Override
public IOptionCategory getCategory() { public IOptionCategory getCategory() {
return option.getCategory(); return option.getCategory();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
*/
@Override @Override
public String getCommand() { public String getCommand() {
return option.getCommand(); return option.getCommand();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCommandGenerator()
*/
@Override @Override
public IOptionCommandGenerator getCommandGenerator() { public IOptionCommandGenerator getCommandGenerator() {
return option.getCommandGenerator(); return option.getCommandGenerator();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCommandFalse()
*/
@Override @Override
public String getCommandFalse() { public String getCommandFalse() {
return option.getCommandFalse(); return option.getCommandFalse();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getToolTip()
*/
@Override @Override
public String getToolTip() { public String getToolTip() {
return option.getToolTip(); return option.getToolTip();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getContextID()
*/
@Override @Override
public String getContextId() { public String getContextId() {
return option.getContextId(); return option.getContextId();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
*/
@Override @Override
public String[] getDefinedSymbols() throws BuildException { public String[] getDefinedSymbols() throws BuildException {
if (value == null) if (value == null) {
return option.getDefinedSymbols(); return option.getDefinedSymbols();
else if (getValueType() == PREPROCESSOR_SYMBOLS) { } else if (getValueType() == PREPROCESSOR_SYMBOLS) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
*/
@Override @Override
public String getEnumCommand(String id) { public String getEnumCommand(String id) {
if (!resolved) { if (!resolved) {
@ -387,6 +357,7 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
@Override
public String getCommand(String id) throws BuildException { public String getCommand(String id) throws BuildException {
if (!resolved) { if (!resolved) {
resolveReferences(); resolveReferences();
@ -400,9 +371,6 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumName(java.lang.String)
*/
@Override @Override
public String getEnumName(String id) { public String getEnumName(String id) {
if (!resolved) { if (!resolved) {
@ -417,6 +385,7 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
@Override
public String getName(String id) throws BuildException { public String getName(String id) throws BuildException {
if (!resolved) { if (!resolved) {
resolveReferences(); resolveReferences();
@ -430,9 +399,6 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getEnumeratedId(java.lang.String)
*/
@Override @Override
public String getEnumeratedId(String name) { public String getEnumeratedId(String name) {
if (!resolved) { if (!resolved) {
@ -447,6 +413,7 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
@Override
public String getId(String name) throws BuildException { public String getId(String name) throws BuildException {
if (!resolved) { if (!resolved) {
resolveReferences(); resolveReferences();
@ -460,100 +427,80 @@ public class OptionReference implements IOption {
return new String(); return new String();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
@Override @Override
public String getId() { public String getId() {
// A reference has the same id as the option it references // A reference has the same id as the option it references
return option.getId(); return option.getId();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getBaseId()
*/
@Override @Override
public String getBaseId() { public String getBaseId() {
// A reference has the same id as the option it references // A reference has the same id as the option it references
return option.getBaseId(); return option.getBaseId();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths()
*/
@Override @Override
public String[] getIncludePaths() throws BuildException { public String[] getIncludePaths() throws BuildException {
if (value == null) if (value == null) {
return option.getIncludePaths(); return option.getIncludePaths();
else if (getValueType() == INCLUDE_PATH) { } else if (getValueType() == INCLUDE_PATH) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getLibraries()
*/
@Override @Override
public String[] getLibraries() throws BuildException { public String[] getLibraries() throws BuildException {
if (value == null) if (value == null) {
return option.getLibraries(); return option.getLibraries();
else if (getValueType() == LIBRARIES) { } else if (getValueType() == LIBRARIES) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getLibraryFiles()
*/
@Override @Override
public String[] getLibraryFiles() throws BuildException { public String[] getLibraryFiles() throws BuildException {
if (value == null) if (value == null) {
return option.getLibraryFiles(); return option.getLibraryFiles();
else if (getValueType() == LIBRARY_FILES) { } else if (getValueType() == LIBRARY_FILES) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryPaths()
*/
@Override @Override
public String[] getLibraryPaths() throws BuildException { public String[] getLibraryPaths() throws BuildException {
if (value == null) if (value == null) {
return option.getLibraryPaths(); return option.getLibraryPaths();
else if (getValueType() == LIBRARY_PATHS) { } else if (getValueType() == LIBRARY_PATHS) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
@Override @Override
public String getName() { public String getName() {
// A reference has the same name as the option it references // A reference has the same name as the option it references
return option.getName(); return option.getName();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getBooleanValue()
*/
@Override @Override
public boolean getBooleanValue() throws BuildException { public boolean getBooleanValue() throws BuildException {
if (value == null){ if (value == null){
@ -567,25 +514,16 @@ public class OptionReference implements IOption {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseType()
*/
@Override @Override
public int getBrowseType() { public int getBrowseType() {
return option.getBrowseType(); return option.getBrowseType();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterPath()
*/
@Override @Override
public String getBrowseFilterPath() { public String getBrowseFilterPath() {
return option.getBrowseFilterPath(); return option.getBrowseFilterPath();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterExtensions()
*/
@Override @Override
public String[] getBrowseFilterExtensions() { public String[] getBrowseFilterExtensions() {
return option.getBrowseFilterExtensions(); return option.getBrowseFilterExtensions();
@ -598,9 +536,6 @@ public class OptionReference implements IOption {
return builtIns; return builtIns;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getBuiltIns()
*/
@Override @Override
public String[] getBuiltIns() { public String[] getBuiltIns() {
List<String> answer = new ArrayList<String>(); List<String> answer = new ArrayList<String>();
@ -631,9 +566,6 @@ public class OptionReference implements IOption {
return option; return option;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getSelectedEnum()
*/
@Override @Override
public String getSelectedEnum() throws BuildException { public String getSelectedEnum() throws BuildException {
// A reference to an enumerated option stores the ID of the selected enum in its value // A reference to an enumerated option stores the ID of the selected enum in its value
@ -648,46 +580,37 @@ public class OptionReference implements IOption {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
@Override @Override
public String[] getStringListValue() throws BuildException { public String[] getStringListValue() throws BuildException {
if (value == null) if (value == null) {
return option.getStringListValue(); return option.getStringListValue();
else if (getValueType() == STRING_LIST) { } else if (getValueType() == STRING_LIST) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringValue()
*/
@Override @Override
public String getStringValue() throws BuildException { public String getStringValue() throws BuildException {
if (value == null) if (value == null) {
return option.getStringValue(); return option.getStringValue();
else if (getValueType() == STRING) } else if (getValueType() == STRING) {
return (String)value; return (String)value;
else }
else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getParent()
*/
@Override @Override
public IBuildObject getParent() { public IBuildObject getParent() {
return owner; return owner;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getOptionHolder()
*/
@Override @Override
public IHoldsOptions getOptionHolder() { public IHoldsOptions getOptionHolder() {
return owner; return owner;
@ -702,25 +625,20 @@ public class OptionReference implements IOption {
return owner; return owner;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getUserObjects()
*/
@Override @Override
public String[] getUserObjects() throws BuildException { public String[] getUserObjects() throws BuildException {
if (value == null) if (value == null) {
return option.getDefinedSymbols(); return option.getDefinedSymbols();
else if (getValueType() == OBJECTS) { } else if (getValueType() == OBJECTS) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>)value; ArrayList<String> list = (ArrayList<String>)value;
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueType()
*/
@Override @Override
public int getValueType() { public int getValueType() {
int optValType; int optValType;
@ -731,9 +649,6 @@ public class OptionReference implements IOption {
return optValType; return optValType;
} }
/* (non-Javadoc)
* Returns the raw value.
*/
@Override @Override
public Object getValue() { public Object getValue() {
return value; return value;
@ -763,10 +678,12 @@ public class OptionReference implements IOption {
*/ */
@Override @Override
public void setValue(boolean value) throws BuildException { public void setValue(boolean value) throws BuildException {
if (getValueType() == BOOLEAN) if (getValueType() == BOOLEAN) {
this.value = new Boolean(value); this.value = new Boolean(value);
else }
else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
@Override @Override
@ -787,31 +704,29 @@ public class OptionReference implements IOption {
@Override @Override
public void setValue(String [] value) throws BuildException { public void setValue(String [] value) throws BuildException {
if (getValueType() == STRING_LIST if (getValueType() == STRING_LIST
|| getValueType() == INCLUDE_PATH || getValueType() == INCLUDE_PATH
|| getValueType() == PREPROCESSOR_SYMBOLS || getValueType() == PREPROCESSOR_SYMBOLS
|| getValueType() == LIBRARIES || getValueType() == LIBRARIES
|| getValueType() == OBJECTS || getValueType() == OBJECTS
|| getValueType() == INCLUDE_FILES || getValueType() == INCLUDE_FILES
|| getValueType() == LIBRARY_PATHS || getValueType() == LIBRARY_PATHS
|| getValueType() == LIBRARY_FILES || getValueType() == LIBRARY_FILES
|| getValueType() == MACRO_FILES || getValueType() == MACRO_FILES
|| getValueType() == UNDEF_INCLUDE_PATH || getValueType() == UNDEF_INCLUDE_PATH
|| getValueType() == UNDEF_PREPROCESSOR_SYMBOLS || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
|| getValueType() == UNDEF_INCLUDE_FILES || getValueType() == UNDEF_INCLUDE_FILES
|| getValueType() == UNDEF_LIBRARY_PATHS || getValueType() == UNDEF_LIBRARY_PATHS
|| getValueType() == UNDEF_LIBRARY_FILES || getValueType() == UNDEF_LIBRARY_FILES
|| getValueType() == UNDEF_MACRO_FILES || getValueType() == UNDEF_MACRO_FILES
) { ) {
// Just replace what the option reference is holding onto // Just replace what the option reference is holding onto
this.value = new ArrayList<String>(Arrays.asList(value)); this.value = new ArrayList<String>(Arrays.asList(value));
} }
else else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
} }
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override @Override
public String toString() { public String toString() {
String answer = new String(); String answer = new String();
@ -831,132 +746,82 @@ public class OptionReference implements IOption {
* They should never be called. * They should never be called.
*/ */
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isExtensionElement()
*/
@Override @Override
public boolean isExtensionElement() { public boolean isExtensionElement() {
return false; return false;
} }
/* (non-Javadoc)
* Sets the raw value.
*/
@Override @Override
public void setValue(Object v) { public void setValue(Object v) {
value = v; value = v;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValueType()
*/
@Override @Override
public void setValueType(int type) { public void setValueType(int type) {
} }
/* (non-Javadoc)
* Returns the raw default value.
*/
@Override @Override
public Object getDefaultValue() { public Object getDefaultValue() {
return value; return value;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValue(Object)
*/
@Override @Override
public void setDefaultValue(Object v) { public void setDefaultValue(Object v) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getSuperClass()
*/
@Override @Override
public IOption getSuperClass() { public IOption getSuperClass() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getResourceFilter()
*/
@Override @Override
public int getResourceFilter() { public int getResourceFilter() {
return FILTER_ALL; return FILTER_ALL;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.managedbuilder.core.IOption#getApplicabilityCalculator()
*/
@Override @Override
public IOptionApplicability getApplicabilityCalculator() { public IOptionApplicability getApplicabilityCalculator() {
return option.getApplicabilityCalculator(); return option.getApplicabilityCalculator();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
*/
@Override @Override
public void setResourceFilter(int filter) { public void setResourceFilter(int filter) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseType(int)
*/
@Override @Override
public void setBrowseType(int type) { public void setBrowseType(int type) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterPath(java.lang.String)
*/
@Override @Override
public void setBrowseFilterPath(String path) { public void setBrowseFilterPath(String path) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterExtensions(java.lang.String[])
*/
@Override @Override
public void setBrowseFilterExtensions(String[] extensions) { public void setBrowseFilterExtensions(String[] extensions) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
*/
@Override @Override
public void setCategory(IOptionCategory category) { public void setCategory(IOptionCategory category) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCommand(String)
*/
@Override @Override
public void setCommand(String cmd) { public void setCommand(String cmd) {
if (cmd == null && command == null) return; if (cmd == null && command == null) {
return;
}
if (cmd == null || command == null || !cmd.equals(command)) { if (cmd == null || command == null || !cmd.equals(command)) {
command = cmd; command = cmd;
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCommandFalse(String)
*/
@Override @Override
public void setCommandFalse(String cmd) { public void setCommandFalse(String cmd) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setToolTip(String)
*/
@Override @Override
public void setToolTip(String tooltip) { public void setToolTip(String tooltip) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setContextId(String)
*/
@Override @Override
public void setContextId(String contextId) { public void setContextId(String contextId) {
} }
@ -976,68 +841,41 @@ public class OptionReference implements IOption {
return option.getManagedBuildRevision(); return option.getManagedBuildRevision();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandlerElement()
*/
public IConfigurationElement getValueHandlerElement() { public IConfigurationElement getValueHandlerElement() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValueHandlerElement(IConfigurationElement)
*/
public void setValueHandlerElement(IConfigurationElement element) { public void setValueHandlerElement(IConfigurationElement element) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandler()
*/
@Override @Override
public IManagedOptionValueHandler getValueHandler() { public IManagedOptionValueHandler getValueHandler() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandlerExtraArgument())
*/
@Override @Override
public String getValueHandlerExtraArgument() { public String getValueHandlerExtraArgument() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValueHandlerExtraArgument(String))
*/
@Override @Override
public void setValueHandlerExtraArgument(String extraArgument) { public void setValueHandlerExtraArgument(String extraArgument) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorId()
*/
@Override @Override
public String getFieldEditorId() { public String getFieldEditorId() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorExtraArgument()
*/
@Override @Override
public String getFieldEditorExtraArgument() { public String getFieldEditorExtraArgument() {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setFieldEditorExtraArgument(java.lang.String)
*/
@Override @Override
public void setFieldEditorExtraArgument(String extraArgument) { public void setFieldEditorExtraArgument(String extraArgument) {
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isValid()
*/
@Override @Override
public boolean isValid() { public boolean isValid() {
return option.isValid(); return option.isValid();
@ -1083,6 +921,7 @@ public class OptionReference implements IOption {
} }
return ve; return ve;
} }
@Override
public ITreeRoot getTreeRoot() { public ITreeRoot getTreeRoot() {
if (!resolved) { if (!resolved) {
resolveReferences(); resolveReferences();