mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
Apply patch for Option, tooltip support (bugzilla 113363)
This commit is contained in:
parent
dde1d9fe71
commit
f024ed0dea
7 changed files with 278 additions and 125 deletions
|
@ -1144,7 +1144,7 @@ Additional special types exist to flag options of special relevance to the build
|
||||||
<attribute name="tip" type="string">
|
<attribute name="tip" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Specifies a "tip" that can be displayed in hover help or on the property page. Not implemented in 2.0.
|
Specifies a "tip" that can be displayed in hover help or on the property page.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.core;
|
package org.eclipse.cdt.managedbuilder.core;
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ public interface IOption extends IBuildObject {
|
||||||
public static final String CATEGORY = "category"; //$NON-NLS-1$
|
public static final String CATEGORY = "category"; //$NON-NLS-1$
|
||||||
public static final String COMMAND = "command"; //$NON-NLS-1$
|
public static final String COMMAND = "command"; //$NON-NLS-1$
|
||||||
public static final String COMMAND_FALSE = "commandFalse"; //$NON-NLS-1$
|
public static final String COMMAND_FALSE = "commandFalse"; //$NON-NLS-1$
|
||||||
|
public static final String TOOL_TIP = "tip"; //$NON-NLS-1$
|
||||||
public static final String DEFAULT_VALUE = "defaultValue"; //$NON-NLS-1$
|
public static final String DEFAULT_VALUE = "defaultValue"; //$NON-NLS-1$
|
||||||
public static final String ENUM_VALUE = "enumeratedOptionValue"; //$NON-NLS-1$
|
public static final String ENUM_VALUE = "enumeratedOptionValue"; //$NON-NLS-1$
|
||||||
public static final String IS_DEFAULT = "isDefault"; //$NON-NLS-1$
|
public static final String IS_DEFAULT = "isDefault"; //$NON-NLS-1$
|
||||||
|
@ -202,6 +204,21 @@ public interface IOption extends IBuildObject {
|
||||||
*/
|
*/
|
||||||
public void setCommandFalse(String commandFalse);
|
public void setCommandFalse(String commandFalse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answers a <code>String</code> containing the tooltip
|
||||||
|
* associated with the option
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getToolTip();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a <code>String</code> containing the tooltip
|
||||||
|
* associated with the option
|
||||||
|
*
|
||||||
|
* @param String
|
||||||
|
*/
|
||||||
|
public void setToolTip(String tooltip);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answers the user-defined preprocessor symbols.
|
* Answers the user-defined preprocessor symbols.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ public class Option extends BuildObject implements IOption {
|
||||||
private String categoryId;
|
private String categoryId;
|
||||||
private String command;
|
private String command;
|
||||||
private String commandFalse;
|
private String commandFalse;
|
||||||
|
private String tip;
|
||||||
private List enumList;
|
private List enumList;
|
||||||
private Map enumCommands;
|
private Map enumCommands;
|
||||||
private Map enumNames;
|
private Map enumNames;
|
||||||
|
@ -181,6 +183,9 @@ public class Option extends BuildObject implements IOption {
|
||||||
if (option.commandFalse != null) {
|
if (option.commandFalse != null) {
|
||||||
commandFalse = new String(option.commandFalse);
|
commandFalse = new String(option.commandFalse);
|
||||||
}
|
}
|
||||||
|
if (option.tip != null) {
|
||||||
|
tip = new String(option.tip);
|
||||||
|
}
|
||||||
if (option.categoryId != null) {
|
if (option.categoryId != null) {
|
||||||
categoryId = new String(option.categoryId);
|
categoryId = new String(option.categoryId);
|
||||||
}
|
}
|
||||||
|
@ -294,6 +299,9 @@ public class Option extends BuildObject implements IOption {
|
||||||
// Get the command defined for a Boolean option when the value is False
|
// Get the command defined for a Boolean option when the value is False
|
||||||
commandFalse = element.getAttribute(COMMAND_FALSE);
|
commandFalse = element.getAttribute(COMMAND_FALSE);
|
||||||
|
|
||||||
|
// Get the tooltip for the option
|
||||||
|
tip = element.getAttribute(TOOL_TIP);
|
||||||
|
|
||||||
// Options hold different types of values
|
// Options hold different types of values
|
||||||
String valueTypeStr = element.getAttribute(VALUE_TYPE);
|
String valueTypeStr = element.getAttribute(VALUE_TYPE);
|
||||||
if (valueTypeStr != null) {
|
if (valueTypeStr != null) {
|
||||||
|
@ -407,6 +415,11 @@ public class Option extends BuildObject implements IOption {
|
||||||
commandFalse = element.getAttribute(COMMAND_FALSE);
|
commandFalse = element.getAttribute(COMMAND_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the tooltip for the option
|
||||||
|
if (element.hasAttribute(TOOL_TIP)) {
|
||||||
|
tip = element.getAttribute(TOOL_TIP);
|
||||||
|
}
|
||||||
|
|
||||||
// Options hold different types of values
|
// Options hold different types of values
|
||||||
if (element.hasAttribute(VALUE_TYPE)) {
|
if (element.hasAttribute(VALUE_TYPE)) {
|
||||||
String valueTypeStr = element.getAttribute(VALUE_TYPE);
|
String valueTypeStr = element.getAttribute(VALUE_TYPE);
|
||||||
|
@ -623,6 +636,10 @@ public class Option extends BuildObject implements IOption {
|
||||||
element.setAttribute(COMMAND_FALSE, commandFalse);
|
element.setAttribute(COMMAND_FALSE, commandFalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tip != null) {
|
||||||
|
element.setAttribute(TOOL_TIP, tip);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: We store value & value-type as a pair, so we know what type of value we are
|
* Note: We store value & value-type as a pair, so we know what type of value we are
|
||||||
* dealing with when we read it back in.
|
* dealing with when we read it back in.
|
||||||
|
@ -978,6 +995,19 @@ public class Option extends BuildObject implements IOption {
|
||||||
return commandFalse;
|
return commandFalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getToolTip()
|
||||||
|
*/
|
||||||
|
public String getToolTip() {
|
||||||
|
if (tip == null) {
|
||||||
|
if (superClass != null) {
|
||||||
|
return superClass.getToolTip();
|
||||||
|
} else {
|
||||||
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tip;
|
||||||
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefinedSymbols()
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefinedSymbols()
|
||||||
*/
|
*/
|
||||||
|
@ -1339,6 +1369,17 @@ public class Option extends BuildObject implements IOption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#setToolTip(String)
|
||||||
|
*/
|
||||||
|
public void setToolTip(String tooltip) {
|
||||||
|
if (tooltip == null && tip == null) return;
|
||||||
|
if (tooltip == null || tip == null || !tooltip.equals(tip)) {
|
||||||
|
tip = tooltip;
|
||||||
|
isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
|
||||||
*/
|
*/
|
||||||
|
@ -1521,6 +1562,7 @@ public class Option extends BuildObject implements IOption {
|
||||||
categoryId == null &&
|
categoryId == null &&
|
||||||
command == null &&
|
command == null &&
|
||||||
commandFalse == null &&
|
commandFalse == null &&
|
||||||
|
tip == null &&
|
||||||
enumList == null &&
|
enumList == null &&
|
||||||
enumCommands == null &&
|
enumCommands == null &&
|
||||||
enumNames == null &&
|
enumNames == null &&
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||||
|
|
||||||
|
@ -294,6 +295,13 @@ public class OptionReference implements IOption {
|
||||||
return option.getCommandFalse();
|
return option.getCommandFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.build.managed.IOption#getToolTip()
|
||||||
|
*/
|
||||||
|
public String getToolTip() {
|
||||||
|
return option.getToolTip();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
|
* @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
|
||||||
*/
|
*/
|
||||||
|
@ -750,6 +758,12 @@ public class OptionReference implements IOption {
|
||||||
public void setCommandFalse(String cmd) {
|
public void setCommandFalse(String cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.build.managed.IOption#setToolTip(String)
|
||||||
|
*/
|
||||||
|
public void setToolTip(String tooltip) {
|
||||||
|
}
|
||||||
|
|
||||||
public PluginVersionIdentifier getVersion() {
|
public PluginVersionIdentifier getVersion() {
|
||||||
return option.getVersion();
|
return option.getVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,13 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.jface.preference.FieldEditor;
|
import org.eclipse.jface.preference.FieldEditor;
|
||||||
|
import org.eclipse.swt.SWTException;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
@ -40,6 +42,50 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
|
||||||
createControl(parent);
|
createControl(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name
|
||||||
|
* @param label
|
||||||
|
* @param tooltip
|
||||||
|
* @param opts
|
||||||
|
* @param sel
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
|
public BuildOptionComboFieldEditor(String name, String label, String tooltip, String [] opts, String sel, Composite parent) {
|
||||||
|
this(name, label, opts, sel, parent);
|
||||||
|
setToolTip(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the field editor's tool tip text to the argument, which
|
||||||
|
* may be null indicating that no tool tip text should be shown.
|
||||||
|
*
|
||||||
|
* @param string the new tool tip text (or null)
|
||||||
|
*
|
||||||
|
* @exception SWTException <ul>
|
||||||
|
* <li>ERROR_WIDGET_DISPOSED - if the field editor has been disposed</li>
|
||||||
|
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the field editor</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public void setToolTip(String tooltip) {
|
||||||
|
optionSelector.setToolTipText(tooltip);
|
||||||
|
getLabelControl().setToolTipText(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the field editor's tool tip text, or null if it has
|
||||||
|
* not been set.
|
||||||
|
*
|
||||||
|
* @return the field editor's tool tip text
|
||||||
|
*
|
||||||
|
* @exception SWTException <ul>
|
||||||
|
* <li>ERROR_WIDGET_DISPOSED - if the field editor has been disposed</li>
|
||||||
|
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the field editor</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public String getToolTipText() {
|
||||||
|
return optionSelector.getToolTipText();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
|
* @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
|
||||||
*/
|
*/
|
||||||
|
@ -128,6 +174,27 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns this field editor's text control.
|
||||||
|
*
|
||||||
|
* @return the text control, or <code>null</code> if no
|
||||||
|
* text field is created yet
|
||||||
|
*/
|
||||||
|
protected Combo getComboControl() {
|
||||||
|
return optionSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns this field editor's text control.
|
||||||
|
*
|
||||||
|
* @return the text control, or <code>null</code> if no
|
||||||
|
* text field is created yet
|
||||||
|
*/
|
||||||
|
public Combo getComboControl(Composite parent) {
|
||||||
|
checkParent(optionSelector, parent);
|
||||||
|
return optionSelector;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether or not the controls in the field editor
|
* Set whether or not the controls in the field editor
|
||||||
* are enabled.
|
* are enabled.
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
@ -100,89 +101,60 @@ public class BuildOptionSettingsPage extends BuildSettingsPage {
|
||||||
} else {
|
} else {
|
||||||
config = clonedConfig;
|
config = clonedConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
|
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Figure out which type the option is and add a proper field
|
// Figure out which type the option is and add a proper field
|
||||||
// editor for it
|
// editor for it
|
||||||
|
Composite fieldEditorParent = getFieldEditorParent();
|
||||||
|
FieldEditor fieldEditor;
|
||||||
|
|
||||||
switch (opt.getValueType()) {
|
switch (opt.getValueType()) {
|
||||||
case IOption.STRING:
|
case IOption.STRING: {
|
||||||
// fix for PR 63973
|
StringFieldEditor stringField;
|
||||||
// Check browse type.
|
|
||||||
// If browsing is set, use a field editor that has a
|
// If browsing is set, use a field editor that has a
|
||||||
// browse button of
|
// browse button of the appropriate type.
|
||||||
// the appropriate type.
|
|
||||||
// Otherwise, use a regular text field.
|
|
||||||
switch (opt.getBrowseType()) {
|
switch (opt.getBrowseType()) {
|
||||||
case IOption.BROWSE_DIR:
|
case IOption.BROWSE_DIR: {
|
||||||
Composite fieldEditorParent2 = getFieldEditorParent();
|
stringField = new DirectoryFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
||||||
DirectoryFieldEditor dirFieldEditor = new DirectoryFieldEditor(
|
} break;
|
||||||
prefName, opt.getName(), fieldEditorParent2);
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
case IOption.BROWSE_FILE: {
|
||||||
opt, applicabilityCalculator, dirFieldEditor, fieldEditorParent2);
|
stringField = new FileFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
||||||
|
} break;
|
||||||
|
|
||||||
addField(dirFieldEditor);
|
case IOption.BROWSE_NONE: {
|
||||||
fieldsMap.put(prefName, dirFieldEditor);
|
stringField = new StringFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
||||||
fieldEditorsToParentMap.put(dirFieldEditor, fieldEditorParent2);
|
} break;
|
||||||
|
|
||||||
break;
|
default: {
|
||||||
|
throw new BuildException(null);
|
||||||
case IOption.BROWSE_FILE:
|
|
||||||
Composite fieldEditorParent3 = getFieldEditorParent();
|
|
||||||
FileFieldEditor fileFieldEditor = new FileFieldEditor(
|
|
||||||
prefName, opt.getName(), fieldEditorParent3);
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
|
||||||
opt, applicabilityCalculator, fileFieldEditor, fieldEditorParent3);
|
|
||||||
|
|
||||||
addField(fileFieldEditor);
|
|
||||||
fieldsMap.put(prefName, fileFieldEditor);
|
|
||||||
fieldEditorsToParentMap.put(fileFieldEditor, fieldEditorParent3);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IOption.BROWSE_NONE:
|
|
||||||
Composite fieldEditorParent4 = getFieldEditorParent();
|
|
||||||
StringFieldEditor stringField = new StringFieldEditor(
|
|
||||||
prefName, opt.getName(), fieldEditorParent4);
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
|
||||||
opt, applicabilityCalculator, stringField, fieldEditorParent4);
|
|
||||||
|
|
||||||
addField(stringField);
|
|
||||||
fieldsMap.put(prefName, stringField);
|
|
||||||
fieldEditorsToParentMap.put(stringField, fieldEditorParent4);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// should not be possible
|
|
||||||
throw (new AssertionError());
|
|
||||||
}
|
}
|
||||||
// end fix for 63973
|
|
||||||
break;
|
|
||||||
case IOption.BOOLEAN:
|
|
||||||
Composite fieldEditorParent5 = getFieldEditorParent();
|
|
||||||
BooleanFieldEditor booleanField = new BooleanFieldEditor(
|
|
||||||
prefName, opt.getName(), fieldEditorParent5);
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
|
||||||
opt, applicabilityCalculator, booleanField, fieldEditorParent5);
|
|
||||||
|
|
||||||
addField(booleanField);
|
|
||||||
fieldsMap.put(prefName, booleanField);
|
|
||||||
fieldEditorsToParentMap.put(booleanField, fieldEditorParent5);
|
|
||||||
break;
|
|
||||||
case IOption.ENUMERATED:
|
|
||||||
String selId;
|
|
||||||
String sel;
|
|
||||||
try {
|
|
||||||
selId = opt.getSelectedEnum();
|
|
||||||
sel = opt.getEnumName(selId);
|
|
||||||
} catch (BuildException e) {
|
|
||||||
// If we get this exception, then the option type is
|
|
||||||
// wrong
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stringField.getTextControl(fieldEditorParent).setToolTipText(opt.getToolTip());
|
||||||
|
stringField.getLabelControl(fieldEditorParent).setToolTipText(opt.getToolTip());
|
||||||
|
|
||||||
|
fieldEditor = stringField;
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case IOption.BOOLEAN: {
|
||||||
|
class TooltipBooleanFieldEditor extends BooleanFieldEditor {
|
||||||
|
public TooltipBooleanFieldEditor(String name, String labelText, String tooltip, Composite parent) {
|
||||||
|
super(name, labelText, parent);
|
||||||
|
getChangeControl(parent).setToolTipText(tooltip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldEditor = new TooltipBooleanFieldEditor(prefName, opt.getName(), opt.getToolTip(), fieldEditorParent);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case IOption.ENUMERATED: {
|
||||||
|
String selId = opt.getSelectedEnum();
|
||||||
|
String sel = opt.getEnumName(selId);
|
||||||
|
|
||||||
// Get all applicable values for this enumerated Option, But display
|
// Get all applicable values for this enumerated Option, But display
|
||||||
// only the enumerated values that are valid (static set of enumerated values defined
|
// 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
|
// in the plugin.xml file) in the UI Combobox. This refrains the user from selecting an
|
||||||
|
@ -198,37 +170,27 @@ public class BuildOptionSettingsPage extends BuildSettingsPage {
|
||||||
String[] enumValidNames = new String[enumValidList.size()];
|
String[] enumValidNames = new String[enumValidList.size()];
|
||||||
enumValidList.copyInto(enumValidNames);
|
enumValidList.copyInto(enumValidNames);
|
||||||
|
|
||||||
Composite fieldEditorParent6 = getFieldEditorParent();
|
fieldEditor = new BuildOptionComboFieldEditor(prefName, opt.getName(), opt.getToolTip(), enumValidNames, sel, fieldEditorParent);
|
||||||
BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(
|
} break;
|
||||||
prefName, opt.getName(), enumValidNames, sel, fieldEditorParent6);
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
|
||||||
opt, applicabilityCalculator, comboField, fieldEditorParent6);
|
|
||||||
|
|
||||||
addField(comboField);
|
|
||||||
fieldsMap.put(prefName, comboField);
|
|
||||||
fieldEditorsToParentMap.put(comboField, fieldEditorParent6);
|
|
||||||
break;
|
|
||||||
case IOption.INCLUDE_PATH:
|
case IOption.INCLUDE_PATH:
|
||||||
case IOption.STRING_LIST:
|
case IOption.STRING_LIST:
|
||||||
case IOption.PREPROCESSOR_SYMBOLS:
|
case IOption.PREPROCESSOR_SYMBOLS:
|
||||||
case IOption.LIBRARIES:
|
case IOption.LIBRARIES:
|
||||||
case IOption.OBJECTS:
|
case IOption.OBJECTS: {
|
||||||
|
fieldEditor = new FileListControlFieldEditor(prefName, opt.getName(), opt.getToolTip(), fieldEditorParent, opt.getBrowseType());
|
||||||
|
} break;
|
||||||
|
|
||||||
Composite fieldEditorParent7 = getFieldEditorParent();
|
|
||||||
FileListControlFieldEditor listField = new FileListControlFieldEditor(
|
|
||||||
prefName, opt.getName(), fieldEditorParent7, opt.getBrowseType());
|
|
||||||
|
|
||||||
setFieldEditorEnablement(holder,
|
|
||||||
opt, applicabilityCalculator, listField, fieldEditorParent7);
|
|
||||||
|
|
||||||
addField(listField);
|
|
||||||
fieldsMap.put(prefName, listField);
|
|
||||||
fieldEditorsToParentMap.put(listField, fieldEditorParent7);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
throw new BuildException(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
|
||||||
|
|
||||||
|
addField(fieldEditor);
|
||||||
|
fieldsMap.put(prefName, fieldEditor);
|
||||||
|
fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
|
||||||
|
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* BitMethods Inc - Initial API and implementation
|
* BitMethods Inc - Initial API and implementation
|
||||||
|
* ARM Ltd. - basic tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
@ -58,6 +59,56 @@ public class FileListControlFieldEditor extends FieldEditor {
|
||||||
list.setType(type);
|
list.setType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a file list control field editor.
|
||||||
|
* @param name the name of the preference this field editor works on
|
||||||
|
* @param labelText the label text of the field editor
|
||||||
|
* @param tooltip the tooltip text of the field editor
|
||||||
|
* @param parent the parent of the field editor's control
|
||||||
|
* @param type the browseType of the file list control
|
||||||
|
*/
|
||||||
|
public FileListControlFieldEditor(
|
||||||
|
String name,
|
||||||
|
String labelText,
|
||||||
|
String tooltip,
|
||||||
|
Composite parent,
|
||||||
|
int type) {
|
||||||
|
this(name, labelText, parent, type);
|
||||||
|
// can't use setToolTip(tooltip) as label not created yet
|
||||||
|
getLabelControl(parent).setToolTipText(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the field editor's tool tip text to the argument, which
|
||||||
|
* may be null indicating that no tool tip text should be shown.
|
||||||
|
*
|
||||||
|
* @param string the new tool tip text (or null)
|
||||||
|
*
|
||||||
|
* @exception SWTException <ul>
|
||||||
|
* <li>ERROR_WIDGET_DISPOSED - if the field editor has been disposed</li>
|
||||||
|
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the field editor</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public void setToolTip(String tooltip) {
|
||||||
|
// Currently just the label has the tooltip
|
||||||
|
getLabelControl().setToolTipText(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the field editor's tool tip text, or null if it has
|
||||||
|
* not been set.
|
||||||
|
*
|
||||||
|
* @return the field editor's tool tip text
|
||||||
|
*
|
||||||
|
* @exception SWTException <ul>
|
||||||
|
* <li>ERROR_WIDGET_DISPOSED - if the field editor has been disposed</li>
|
||||||
|
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the field editor</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public String getToolTipText() {
|
||||||
|
return getLabelControl().getToolTipText();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a file list control field editor.
|
* Creates a file list control field editor.
|
||||||
* @param name the name of the preference this field editor works on
|
* @param name the name of the preference this field editor works on
|
||||||
|
|
Loading…
Add table
Reference in a new issue