List of usage examples for org.eclipse.jface.preference StringFieldEditor getLabelControl
public Label getLabelControl(Composite parent)
From source file:at.medevit.elexis.gdt.ui.GDTPreferencePage.java
License:Open Source License
/** * Create contents of the preference page. *//* w w w . j a v a 2s .c o m*/ @Override protected void createFieldEditors() { { Composite composite = getFieldEditorParent(); StringFieldEditor stringFieldEditorGDTID = new StringFieldEditor(CFG_GDT_ID, "GDT Identitt", composite); stringFieldEditorGDTID.getLabelControl(composite).setText("GDT Identitt (max 8 Zeichen)"); stringFieldEditorGDTID.getLabelControl(composite).setToolTipText( "Die GDT-ID dient zur eindeutigen Identifikation der an der Kommunikation beteiligten Komonenten."); stringFieldEditorGDTID.getTextControl(composite).setTextLimit(8); addField(stringFieldEditorGDTID); } { Composite composite = getFieldEditorParent(); StringFieldEditor exchangeKuerzel = new StringFieldEditor(CFG_GDT_FILETRANSFER_SHORTNAME, "Kommunikations-Krzel (4 Zeichen)", composite); exchangeKuerzel.getTextControl(composite).setTextLimit(4); addField(exchangeKuerzel); } { Composite composite = getFieldEditorParent(); ComboFieldEditor comboFieldEditor = new ComboFieldEditor(CFG_GDT_CHARSET, "Standard Zeichensatz", comboCharsetSelektor, composite); comboFieldEditor.getLabelControl(composite) .setToolTipText("Zeichensatz welcher zum Datenaustausch verwendet werden soll"); addField(comboFieldEditor); } { BooleanFieldEditor deleteNonGDTFiles = new BooleanFieldEditor(CFG_GDT_FILETRANSFER_DELETE_NON_GDT_FILES, "Nicht GDT Dateien aus Daten-Austausch-Verzeichnissen entfernen", getFieldEditorParent()); addField(deleteNonGDTFiles); } }
From source file:com.siemens.ct.mp3m.ui.editors.id3.databinding.Id3TagPage.java
License:Open Source License
private void addKeyValuePair(String key, IMP3Info id3TagInfo, String value, final DataBindingContext bindingContext, boolean editable) { StringFieldEditor stringEditor = new StringFieldEditor(key, key + ":", section); //$NON-NLS-1$ toolkit.adapt(stringEditor.getTextControl(section), true, true); stringEditor.setEnabled(editable, section); Label label = stringEditor.getLabelControl(section); label.setEnabled(true);//from w w w . ja v a2s . com toolkit.adapt(label, false, false); ControlDecoration controlDecoration = createTextDecoration(stringEditor.getTextControl(section)); // do the data binding bindingContext.bindValue(SWTObservables.observeText(stringEditor.getTextControl(section), SWT.Modify), PojoObservables.observeValue(id3TagInfo, value), new UpdateValueStrategy().setAfterConvertValidator(new RequiredValidator(controlDecoration, this)), new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE)); stringEditor.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (AggregateValidationStatus .getStatusMerged(bindingContext.getValidationStatusProviders()) == Status.OK_STATUS) { if (event.getProperty().equals("field_editor_value")) { isDirty = true; } getEditor().editorDirtyStateChanged(); } } }); fieldEditors.add(stringEditor); }
From source file:com.siemens.ct.mp3m.ui.editors.id3.Id3TagPage.java
License:Open Source License
private void addKeyValuePair(String key, String value, boolean editable) { StringFieldEditor stringEditor = new StringFieldEditor(key, key + ":", section); //$NON-NLS-1$ toolkit.adapt(stringEditor.getTextControl(section), true, true); stringEditor.setStringValue(value);//from w ww . j a va 2s. c om stringEditor.setEnabled(editable, section); Label label = stringEditor.getLabelControl(section); label.setEnabled(true); toolkit.adapt(label, false, false); stringEditor.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals("field_editor_value")) { isDirty = true; } getEditor().editorDirtyStateChanged(); } }); fieldEditors.add(stringEditor); }
From source file:org.bonitasoft.studio.engine.preferences.BonitaUserXpPreferencePage.java
License:Open Source License
/** * Creates the field editors. Field editors are abstractions of the common * GUI blocks needed to manipulate various types of preferences. Each field * editor knows how to save and restore itself. *//*w w w . j a v a2s . c om*/ @Override public void createFieldEditors() { createTitleBar(Messages.BonitaPreferenceDialog_UserXP_Settings, Pics.getImage(PicsConstants.preferenceLogin), false); host = new StringFieldEditor(BonitaPreferenceConstants.CONSOLE_HOST, Messages.consolePreferenceHostLabel, getFieldEditorParent()); addField(host); port = new IntegerFieldEditor(BonitaPreferenceConstants.CONSOLE_PORT, Messages.consolePreferencePortLabel, getFieldEditorParent()); addField(port); Group loginGroup = new Group(getFieldEditorParent(), SWT.NONE); loginGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(15, 15).create()); loginGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create()); loginGroup.setText(Messages.loginAs); StringFieldEditor user = new StringFieldEditor(BonitaPreferenceConstants.USER_NAME, Messages.userNameLLabel, loginGroup); addField(user); user.getTextControl(loginGroup) .setLayoutData(GridDataFactory.fillDefaults().grab(true, false).indent(0, 15).create()); user.getLabelControl(loginGroup) .setLayoutData(GridDataFactory.fillDefaults().grab(false, false).indent(0, 15).create()); final PasswordFieldEditor password = new PasswordFieldEditor(BonitaPreferenceConstants.USER_PASSWORD, Messages.userPasswordLabel, loginGroup); addField(password); defaultTheme = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_USERXP_THEME, Messages.bind(Messages.defaultUserXPThemeLabel, new Object[] { bonitaPortalModuleName }), getAvailableThemes(), getFieldEditorParent()); addField(defaultTheme); }
From source file:org.dawb.tango.extensions.editors.preferences.CalibrationPreferences.java
License:Open Source License
@Override protected void createFieldEditors() { editors = new ArrayList<StringFieldEditor>(7); this.use = new BooleanFieldEditor(CalibrationConstants.USE, "Use calibration", getFieldEditorParent()); addField(use);// w ww. j a va 2 s . c om StringFieldEditor expr = new StringFieldEditor(CalibrationConstants.EXPR, "Calibration Expression", getFieldEditorParent()); expr.getLabelControl(getFieldEditorParent()).setToolTipText( "Expression to use in calibration, the variable p is used for pixel value and p0 for the first pixel."); addField(expr); editors.add(expr); expr.getTextControl(getFieldEditorParent()) .setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE)); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); addField(new LabelFieldEditor("Coefficients:", getFieldEditorParent())); StringFieldEditor a = new StringFieldEditor(CalibrationConstants.A, "a", getFieldEditorParent()); a.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient a used in the calibration expression."); addField(a); editors.add(a); StringFieldEditor b = new StringFieldEditor(CalibrationConstants.B, "b", getFieldEditorParent()); b.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient b used in the calibration expression."); addField(b); editors.add(b); StringFieldEditor c = new StringFieldEditor(CalibrationConstants.C, "c", getFieldEditorParent()); c.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient c used in the calibration expression."); addField(c); editors.add(c); StringFieldEditor d = new StringFieldEditor(CalibrationConstants.D, "d", getFieldEditorParent()); d.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient d used in the calibration expression."); addField(d); editors.add(d); updateEnabled(Activator.getDefault().getPreferenceStore().getBoolean(CalibrationConstants.USE)); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); addField(new LabelFieldEditor("", getFieldEditorParent())); addField(new StringFieldEditor(CalibrationConstants.LABEL, "X-axis label", getFieldEditorParent())); }
From source file:org.dawb.tango.extensions.editors.preferences.SharedPreferences.java
License:Open Source License
@Override protected void createFieldEditors() { {//from w ww . ja v a2s . c om final IntegerFieldEditor monFreq = new IntegerFieldEditor(SharedConstants.MON_FREQ, "Monitor Frequency in ms", getFieldEditorParent()); monFreq.setValidRange(500, 10000); monFreq.getLabelControl(getFieldEditorParent()).setToolTipText( "The frequency to go to the shared memory and attempt to read it. If the memory has not changed since the last read, nothing will happen."); addField(monFreq); } { final IntegerFieldEditor histSize = new IntegerFieldEditor(SharedConstants.HISTORY_SIZE, "History size", getFieldEditorParent()); histSize.setValidRange(5, 10000); histSize.getLabelControl(getFieldEditorParent()) .setToolTipText("The history size when the system is in history mode."); addField(histSize); } { final IntegerFieldEditor chunkIndex = new IntegerFieldEditor(SharedConstants.CHUNK_INDEX, "Chunk Index", getFieldEditorParent()); chunkIndex.setValidRange(0, 999); chunkIndex.getLabelControl(getFieldEditorParent()).setToolTipText( "The chunk index when reading chunks of spectra to add to the history. This is a 0 based index, if set to more than the chunk size, the chunk size - 1 will be used."); addField(chunkIndex); } { addField(new LabelFieldEditor(" ", getFieldEditorParent())); final LabelFieldEditor label = new LabelFieldEditor("Advanced Options", getFieldEditorParent()); label.getLabelControl(getFieldEditorParent()).setToolTipText( "Advanced options below may also need the spec shared memory variable to be changed or the macro altered or tango reconfigured, use with caution."); addField(label); } { final IntegerFieldEditor chunkSize = new IntegerFieldEditor(SharedConstants.CHUNK_SIZE, "Chunk Size", getFieldEditorParent()); chunkSize.setValidRange(1, 1000); chunkSize.getLabelControl(getFieldEditorParent()) .setToolTipText("The size of the rows in the shared memory to read when updating."); addField(chunkSize); } { final StringFieldEditor tangoAddress = new StringFieldEditor(SharedConstants.SPEC_SHARED, "Spec Tango Uri", getFieldEditorParent()); tangoAddress.getLabelControl(getFieldEditorParent()) .setToolTipText("Change this URI only if you are able to match it with the tango server."); addField(tangoAddress); } }
From source file:org.eclipse.cdt.codan.internal.ui.widgets.ParametersComposite.java
License:Open Source License
/** * @param parent// w ww . j av a2 s . c om * @param problem * @param style */ public ParametersComposite(Composite parent, final IProblem problem) { super(parent, SWT.NONE); if (problem == null) throw new NullPointerException(); this.setLayout(new GridLayout(2, false)); this.problem = problem; this.prefStore = new PreferenceStore(); page = new FieldEditorPreferencePage(FieldEditorPreferencePage.GRID) { @Override protected void createFieldEditors() { noDefaultAndApplyButton(); ((GridLayout) getFieldEditorParent().getLayout()).numColumns = 2; addField(new BooleanFieldEditor(PREF_ENABLED, CodanUIMessages.ParametersComposite_IsEnabled, getFieldEditorParent())); String[][] entries = { { CodanSeverity.Error.toTranslatableString(), CodanSeverity.Error.toString() }, // { CodanSeverity.Warning.toTranslatableString(), CodanSeverity.Warning.toString() }, // { CodanSeverity.Info.toTranslatableString(), CodanSeverity.Info.toString() }, // { NO_CHANGE, NO_CHANGE }, // }; addField(new ComboFieldEditor(PREF_SEVERITY, CodanUIMessages.ParametersComposite_Severity, entries, getFieldEditorParent())); StringFieldEditor messagePatternEditor = new StringFieldEditor(PREF_MESSAGE, CodanUIMessages.ParametersComposite_MessagePattern, getFieldEditorParent()); // We are using read-only text field for message pattern to allow copy to clipboard. makeUneditable(messagePatternEditor); addField(messagePatternEditor); IProblemPreference pref = problem.getPreference(); createFieldEditorsForParameters(pref); } private void makeUneditable(StringFieldEditor editor) { /* * Here we are doing 2 things to make a text control "uneditable": * 1. 'setUneditable(false)' the problem with with just doing this is that * the background of the text control doesn't change, and it looks like * an editable one. This is confusing to the user. * 2. Getting the background of a label control and applying it * to the "uneditable" text control. This way it is easier to figure out that * the contents of the text control cannot be changed. * Why not just setEnable(false)? Because it changes the text of the text control * to light gray, making it difficult to read. Also, users cannot select and copy * text from a disabled text field. */ Color background = editor.getLabelControl(getFieldEditorParent()).getBackground(); Text text = editor.getTextControl(getFieldEditorParent()); text.setBackground(background); text.setEditable(false); } @Override protected Control createContents(Composite parent) { return super.createContents(parent); } /** * @param info */ private void createFieldEditorsForParameters(final IProblemPreference info) { if (info == null) return; if (info.getKey() == FileScopeProblemPreference.KEY) return; // skip the scope if (info.getKey() == LaunchModeProblemPreference.KEY) return; // skip the launch switch (info.getType()) { case TYPE_STRING: { StringFieldEditor fe = new StringFieldEditor(info.getQualifiedKey(), info.getLabel(), getFieldEditorParent()); addField(fe); break; } case TYPE_BOOLEAN: { BooleanFieldEditor fe = new BooleanFieldEditor(info.getQualifiedKey(), info.getLabel(), getFieldEditorParent()); addField(fe); break; } case TYPE_LIST: ListEditor le = new ListEditor(info.getQualifiedKey(), info.getLabel(), getFieldEditorParent()) { @Override protected String[] parseString(String stringList) { ListProblemPreference list = (ListProblemPreference) info; IProblemPreference[] childDescriptors = list.getChildDescriptors(); if (childDescriptors.length == 0) return new String[0]; String res[] = new String[childDescriptors.length]; for (int i = 0; i < childDescriptors.length; i++) { IProblemPreference item = childDescriptors[i]; res[i] = String.valueOf(item.getValue()); } return res; } @Override protected String getNewInputObject() { ListProblemPreference list = (ListProblemPreference) info; String label = list.getChildDescriptor().getLabel(); InputDialog dialog = new InputDialog(getShell(), CodanUIMessages.ParametersComposite_NewValue, label, "", null); //$NON-NLS-1$ if (dialog.open() == Window.OK) { return dialog.getValue(); } return null; } @Override protected String createList(String[] items) { ListProblemPreference list = (ListProblemPreference) info.clone(); list.clear(); for (int i = 0; i < items.length; i++) { String val = items[i]; list.addChildValue(val); } return list.exportValue(); } }; addField(le); break; case TYPE_MAP: IProblemPreference[] childrenDescriptor = ((IProblemPreferenceCompositeDescriptor) info) .getChildDescriptors(); for (int i = 0; i < childrenDescriptor.length; i++) { IProblemPreference desc = childrenDescriptor[i]; createFieldEditorsForParameters(desc); } break; case TYPE_CUSTOM: { StringFieldEditor fe = new StringFieldEditor(info.getQualifiedKey(), info.getLabel(), getFieldEditorParent()); addField(fe); break; } case TYPE_FILE: { FileFieldEditor fe = new FileFieldEditor(info.getQualifiedKey(), info.getLabel(), getFieldEditorParent()); addField(fe); break; } default: throw new UnsupportedOperationException(info.getType().toString()); } } }; load(problem); page.setPreferenceStore(prefStore); page.createControl(parent); page.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); }
From source file:org.eclipse.cdt.internal.autotools.ui.properties.AutotoolsCategoryPropertyOptionPage.java
License:Open Source License
protected void createFieldEditors() { super.createFieldEditors(); Composite parent = getFieldEditorParent(); // FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent); AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getChildOptions(catName); for (int i = 0; i < options.length; ++i) { AutotoolsConfiguration.Option option = options[i]; switch (option.getType()) { case IConfigureOption.STRING: case IConfigureOption.INTERNAL: case IConfigureOption.MULTIARG: parent = getFieldEditorParent(); StringFieldEditor f = new StringFieldEditor(option.getName(), option.getDescription(), 20, parent); f.getLabelControl(parent).setToolTipText(option.getToolTip()); addField(f);/* w w w. j a v a 2 s . c o m*/ fieldEditors.add(f); break; case IConfigureOption.BIN: case IConfigureOption.FLAGVALUE: parent = getFieldEditorParent(); BooleanFieldEditor b = new BooleanFieldEditor(option.getName(), option.getDescription(), parent); b.getDescriptionControl(parent).setToolTipText(option.getToolTip()); addField(b); fieldEditors.add(b); break; case IConfigureOption.FLAG: parent = getFieldEditorParent(); FieldEditor l = createLabelEditor(parent, option.getName()); addField(l); fieldEditors.add(l); break; } } }
From source file:org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionSettingsUI.java
License:Open Source License
@Override protected void createFieldEditors() { // true if the user selected "Display tool option tips at a fixed location" in Preferences AND // and we are displaying the tool tip box on this page because one or more option has non-empty tool tip. boolean pageHasToolTipBox = isToolTipBoxNeeded(); // Get the preference store for the build settings super.createFieldEditors(); // Iterate over the options in the category and create a field editor // for each/* w w w . j ava 2 s . com*/ Object[][] options = category.getOptions(fInfo, optionHolder); for (int index = 0; index < options.length; ++index) { // Get the option IHoldsOptions holder = (IHoldsOptions) options[index][0]; if (holder == null) break; // The array may not be full IOption opt = (IOption) options[index][1]; // check to see if the option has an applicability calculator IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator(); IBuildObject config = fInfo; if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) { String optId = getToolSettingsPrefStore().getOptionId(opt); final String nameStr = opt.getName(); String tipStr = opt.getToolTip(); String contextId = opt.getContextId(); if (pageHasToolTipBox && (tipStr == null || tipStr.trim().length() == 0)) { tipStr = Messages.BuildOptionSettingsUI_0; } try { // Figure out which type the option is and add a proper field // editor for it Composite fieldEditorParent = getFieldEditorParent(); FieldEditor fieldEditor = null; String customFieldEditorId = opt.getFieldEditorId(); if (customFieldEditorId != null) { fieldEditor = createCustomFieldEditor(customFieldEditorId); if (fieldEditor != null) { ICustomBuildOptionEditor customFieldEditor = (ICustomBuildOptionEditor) fieldEditor; if (customFieldEditor.init(opt, opt.getFieldEditorExtraArgument(), optId, fieldEditorParent)) { Control[] toolTipSources = customFieldEditor.getToolTipSources(); if (toolTipSources != null) { for (Control control : toolTipSources) { if (pageHasToolTipBox) { control.setData(new TipInfo(nameStr, tipStr)); control.addListener(selectAction, tipSetListener); } else { control.setToolTipText(tipStr); } } } } else { fieldEditor = null; } } } if (fieldEditor == null) { switch (opt.getValueType()) { case IOption.STRING: { StringFieldEditor stringField; // If browsing is set, use a field editor that has a // browse button of the appropriate type. switch (opt.getBrowseType()) { case IOption.BROWSE_DIR: { stringField = new DirectoryFieldEditor(optId, nameStr, fieldEditorParent); if (opt.getBrowseFilterPath() != null) { try { String filterPath = ManagedBuildManager.getBuildMacroProvider() .resolveValue(opt.getBrowseFilterPath(), null, null, IBuildMacroProvider.CONTEXT_OPTION, opt.getOptionContextData(holder)); ((DirectoryFieldEditor) stringField).setFilterPath(new File(filterPath)); } catch (BuildMacroException bmx) { ManagedBuilderUIPlugin.log(bmx); } } } break; case IOption.BROWSE_FILE: { stringField = new FileFieldEditor(optId, nameStr, fieldEditorParent) { /** * Do not perform validity check on the file name due to losing focus, * see http://bugs.eclipse.org/289448 */ @Override protected boolean checkState() { clearErrorMessage(); return true; } }; if (opt.getBrowseFilterPath() != null) { try { String filterPath = ManagedBuildManager.getBuildMacroProvider() .resolveValue(opt.getBrowseFilterPath(), null, null, IBuildMacroProvider.CONTEXT_OPTION, opt.getOptionContextData(holder)); ((FileFieldEditor) stringField).setFilterPath(new File(filterPath)); } catch (BuildMacroException bmx) { ManagedBuilderUIPlugin.log(bmx); } } ((FileFieldEditor) stringField).setFileExtensions(opt.getBrowseFilterExtensions()); } break; case IOption.BROWSE_NONE: { final StringFieldEditorM local = new StringFieldEditorM(optId, nameStr, fieldEditorParent); stringField = local; local.getTextControl().addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { local.valueChanged(); } }); } break; default: { throw new BuildException(null); } } Label label = stringField.getLabelControl(fieldEditorParent); Text text = stringField.getTextControl(fieldEditorParent); if (pageHasToolTipBox) { label.setData(new TipInfo(nameStr, tipStr)); label.addListener(selectAction, tipSetListener); text.setData(new TipInfo(nameStr, tipStr)); text.addListener(selectAction, tipSetListener); } else { label.setToolTipText(tipStr); text.setToolTipText(tipStr); } if (!contextId.equals(AbstractPage.EMPTY_STR)) { PlatformUI.getWorkbench().getHelpSystem().setHelp(text, contextId); } fieldEditor = stringField; } break; case IOption.BOOLEAN: { fieldEditor = new TriStateBooleanFieldEditor(optId, nameStr, tipStr, fieldEditorParent, contextId, ohs, curr); // tipStr is handled in TriStateBooleanFieldEditor constructor } break; case IOption.ENUMERATED: { String selId = opt.getSelectedEnum(); String sel = opt.getEnumName(selId); // Get all applicable values for this enumerated Option, But display // only the enumerated values that are valid (static set of enumerated values defined // in the plugin.xml file) in the UI Combobox. This refrains the user from selecting an // invalid value and avoids issuing an error message. String[] enumNames = opt.getApplicableValues(); Vector<String> enumValidList = new Vector<String>(); for (int i = 0; i < enumNames.length; ++i) { if (opt.getValueHandler().isEnumValueAppropriate(config, opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) { enumValidList.add(enumNames[i]); } } String[] enumValidNames = new String[enumValidList.size()]; enumValidList.copyInto(enumValidNames); // if (displayFixedTip==false), tooltip was already set in BuildOptionComboFieldEditor constructor. String tooltipHoverStr = displayFixedTip ? null : tipStr; fieldEditor = new BuildOptionComboFieldEditor(optId, nameStr, tooltipHoverStr, contextId, enumValidNames, sel, fieldEditorParent); if (pageHasToolTipBox) { Combo combo = ((BuildOptionComboFieldEditor) fieldEditor).getComboControl(); Label label = fieldEditor.getLabelControl(fieldEditorParent); combo.setData(new TipInfo(nameStr, tipStr)); combo.addListener(selectAction, tipSetListener); label.setData(new TipInfo(nameStr, tipStr)); label.addListener(selectAction, tipSetListener); } } break; case IOption.TREE: fieldEditor = new TreeBrowseFieldEditor(optId, nameStr, fieldEditorParent, nameStr, opt, contextId); ((StringButtonFieldEditor) fieldEditor).setChangeButtonText("..."); //$NON-NLS-1$ if (pageHasToolTipBox) { Text text = ((StringButtonFieldEditor) fieldEditor) .getTextControl(fieldEditorParent); Label label = fieldEditor.getLabelControl(fieldEditorParent); text.setData(new TipInfo(nameStr, tipStr)); text.addListener(selectAction, tipSetListener); label.setData(new TipInfo(nameStr, tipStr)); label.addListener(selectAction, tipSetListener); } break; case IOption.INCLUDE_PATH: case IOption.STRING_LIST: case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: case IOption.OBJECTS: case IOption.INCLUDE_FILES: case IOption.LIBRARY_PATHS: case IOption.LIBRARY_FILES: case IOption.MACRO_FILES: case IOption.UNDEF_INCLUDE_PATH: case IOption.UNDEF_PREPROCESSOR_SYMBOLS: case IOption.UNDEF_INCLUDE_FILES: case IOption.UNDEF_LIBRARY_PATHS: case IOption.UNDEF_LIBRARY_FILES: case IOption.UNDEF_MACRO_FILES: { // if (displayFixedTip==false), tooltip was already set in FileListControlFieldEditor constructor. String tooltipHoverStr = displayFixedTip ? null : tipStr; fieldEditor = new FileListControlFieldEditor(optId, nameStr, tooltipHoverStr, contextId, fieldEditorParent, opt.getBrowseType()); if (opt.getBrowseFilterPath() != null) { try { String filterPath = ManagedBuildManager.getBuildMacroProvider().resolveValue( opt.getBrowseFilterPath(), null, null, IBuildMacroProvider.CONTEXT_OPTION, opt.getOptionContextData(holder)); ((FileListControlFieldEditor) fieldEditor).setFilterPath(filterPath); } catch (BuildMacroException bmx) { ManagedBuilderUIPlugin.log(bmx); } } ((FileListControlFieldEditor) fieldEditor) .setFilterExtensions(opt.getBrowseFilterExtensions()); if (pageHasToolTipBox) { Label label = fieldEditor.getLabelControl(fieldEditorParent); label.setData(new TipInfo(nameStr, tipStr)); label.addListener(selectAction, tipSetListener); } } break; default: throw new BuildException(null); } } setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent); addField(fieldEditor); fieldsMap.put(optId, fieldEditor); fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent); } catch (BuildException e) { } } } }
From source file:org.eclipse.epp.internal.logging.aeri.ui.PreferencePage.java
License:Open Source License
private StringFieldEditor createStringFieldEditorAndToolTip(String name, String labelText, String toolTipText) { StringFieldEditor stringFieldEditor = new StringFieldEditor(name, labelText, getFieldEditorParent()); DefaultToolTip toolTip = new DefaultToolTip(stringFieldEditor.getLabelControl(getFieldEditorParent())); calibrateTooltip(toolTip, toolTipText); return stringFieldEditor; }