Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Treggiari2005-11-19 20:30:18 +0000
committerLeo Treggiari2005-11-19 20:30:18 +0000
commitf024ed0dea872b8407327805f0e9702bf2b0cdf1 (patch)
treeb414601b58c75bfcc8ec058a89bea134243fe175
parentdde1d9fe713b48c6ce6ab91492bf88e8a9121d0a (diff)
downloadorg.eclipse.cdt-f024ed0dea872b8407327805f0e9702bf2b0cdf1.tar.gz
org.eclipse.cdt-f024ed0dea872b8407327805f0e9702bf2b0cdf1.tar.xz
org.eclipse.cdt-f024ed0dea872b8407327805f0e9702bf2b0cdf1.zip
Apply patch for Option, tooltip support (bugzilla 113363)
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java67
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java210
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java51
7 files changed, 278 insertions, 125 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
index 5564836249..c2ce83c5cb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
+++ b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
@@ -1144,7 +1144,7 @@ Additional special types exist to flag options of special relevance to the build
<attribute name="tip" type="string">
<annotation>
<documentation>
- Specifies a &quot;tip&quot; that can be displayed in hover help or on the property page. Not implemented in 2.0.
+ Specifies a &quot;tip&quot; that can be displayed in hover help or on the property page.
</documentation>
</annotation>
</attribute>
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
index ba8910af07..255483d0c6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
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 COMMAND = "command"; //$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 ENUM_VALUE = "enumeratedOptionValue"; //$NON-NLS-1$
public static final String IS_DEFAULT = "isDefault"; //$NON-NLS-1$
@@ -203,6 +205,21 @@ public interface IOption extends IBuildObject {
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.
*
* @return String[]
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
index 6fccf0108e..d5a3e2f92c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -59,6 +60,7 @@ public class Option extends BuildObject implements IOption {
private String categoryId;
private String command;
private String commandFalse;
+ private String tip;
private List enumList;
private Map enumCommands;
private Map enumNames;
@@ -181,6 +183,9 @@ public class Option extends BuildObject implements IOption {
if (option.commandFalse != null) {
commandFalse = new String(option.commandFalse);
}
+ if (option.tip != null) {
+ tip = new String(option.tip);
+ }
if (option.categoryId != null) {
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
commandFalse = element.getAttribute(COMMAND_FALSE);
+ // Get the tooltip for the option
+ tip = element.getAttribute(TOOL_TIP);
+
// Options hold different types of values
String valueTypeStr = element.getAttribute(VALUE_TYPE);
if (valueTypeStr != null) {
@@ -407,6 +415,11 @@ public class Option extends BuildObject implements IOption {
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
if (element.hasAttribute(VALUE_TYPE)) {
String valueTypeStr = element.getAttribute(VALUE_TYPE);
@@ -623,6 +636,10 @@ public class Option extends BuildObject implements IOption {
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
* dealing with when we read it back in.
@@ -979,6 +996,19 @@ public class Option extends BuildObject implements IOption {
}
/* (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)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefinedSymbols()
*/
public String[] getDefinedSymbols() throws BuildException {
@@ -1340,6 +1370,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)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
*/
public void setResourceFilter(int filter) {
@@ -1521,6 +1562,7 @@ public class Option extends BuildObject implements IOption {
categoryId == null &&
command == null &&
commandFalse == null &&
+ tip == null &&
enumList == null &&
enumCommands == null &&
enumNames == null &&
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
index d09100a722..3cc56e9934 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -295,6 +296,13 @@ public class OptionReference implements IOption {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getToolTip()
+ */
+ public String getToolTip() {
+ return option.getToolTip();
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
*/
public String[] getDefinedSymbols() throws BuildException {
@@ -750,6 +758,12 @@ public class OptionReference implements IOption {
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() {
return option.getVersion();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java
index 701f633392..205f2cae63 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java
@@ -7,11 +7,13 @@
*
* Contributors:
* IBM Rational Software - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
@@ -40,6 +42,50 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
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)
* @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
*/
@@ -129,6 +175,27 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
}
/**
+ * 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
* are enabled.
* @param enabled The enabled state.
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
index 60279eaf64..44076dd64f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Rational Software - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
@@ -100,137 +101,98 @@ public class BuildOptionSettingsPage extends BuildSettingsPage {
} else {
config = clonedConfig;
}
+
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
- try {
- // Figure out which type the option is and add a proper field
- // editor for it
- switch (opt.getValueType()) {
- case IOption.STRING:
- // fix for PR 63973
- // Check browse type.
- // If browsing is set, use a field editor that has a
- // browse button of
- // the appropriate type.
- // Otherwise, use a regular text field.
- switch (opt.getBrowseType()) {
- case IOption.BROWSE_DIR:
- Composite fieldEditorParent2 = getFieldEditorParent();
- DirectoryFieldEditor dirFieldEditor = new DirectoryFieldEditor(
- prefName, opt.getName(), fieldEditorParent2);
-
- setFieldEditorEnablement(holder,
- opt, applicabilityCalculator, dirFieldEditor, fieldEditorParent2);
-
- addField(dirFieldEditor);
- fieldsMap.put(prefName, dirFieldEditor);
- fieldEditorsToParentMap.put(dirFieldEditor, fieldEditorParent2);
-
- break;
-
- 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;
- }
- // 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 enumValidList = new Vector();
- 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(prefName, opt.getName(), fieldEditorParent);
+ } break;
+
+ case IOption.BROWSE_FILE: {
+ stringField = new FileFieldEditor(prefName, opt.getName(), fieldEditorParent);
+ } break;
+
+ case IOption.BROWSE_NONE: {
+ stringField = new StringFieldEditor(prefName, opt.getName(), fieldEditorParent);
+ } break;
+
+ default: {
+ throw new BuildException(null);
+ }
}
- }
- String[] enumValidNames = new String[enumValidList.size()];
- enumValidList.copyInto(enumValidNames);
-
- Composite fieldEditorParent6 = getFieldEditorParent();
- BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(
- 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.STRING_LIST:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
+ 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
+ // 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 enumValidList = new Vector();
+ 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(prefName, opt.getName(), opt.getToolTip(), enumValidNames, sel, fieldEditorParent);
+ } break;
+
+ case IOption.INCLUDE_PATH:
+ case IOption.STRING_LIST:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS: {
+ fieldEditor = new FileListControlFieldEditor(prefName, opt.getName(), opt.getToolTip(), fieldEditorParent, opt.getBrowseType());
+ } break;
+
+ default:
+ throw new BuildException(null);
+ }
- Composite fieldEditorParent7 = getFieldEditorParent();
- FileListControlFieldEditor listField = new FileListControlFieldEditor(
- prefName, opt.getName(), fieldEditorParent7, opt.getBrowseType());
+ setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
- setFieldEditorEnablement(holder,
- opt, applicabilityCalculator, listField, fieldEditorParent7);
+ addField(fieldEditor);
+ fieldsMap.put(prefName, fieldEditor);
+ fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
- addField(listField);
- fieldsMap.put(prefName, listField);
- fieldEditorsToParentMap.put(listField, fieldEditorParent7);
- break;
- default:
- break;
- }
- } catch (BuildException e) {
- }
+ } catch (BuildException e) {
+ }
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
index 829176bf26..867ccfe212 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
@@ -7,6 +7,7 @@
*
* Contributors:
* BitMethods Inc - Initial API and implementation
+ * ARM Ltd. - basic tooltip support
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
@@ -62,6 +63,56 @@ public class FileListControlFieldEditor extends FieldEditor {
* 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.
+ * @param name the name of the preference this field editor works on
+ * @param labelText the label text of the field editor
* @param parent the parent of the field editor's control
* @param value the field editor's value
* @param type the browseType of the file list control

Back to the top