Bug 259952 [Preferences] Duplicated text when using tooltip in BooleanFieldEditor
Build ID: M20080911-1700 Steps To Reproduce: 1. Set a tooltip to the field: bfe.getLabelControl(parent).setToolTipText(tooltipText); 2. When the preference page is shown, the text that describes the preference being edited appears duplicated. More information: The usual way to set the tool tip to a field editor is calling "getLabelControl(parent).setToolTipText(tooltipText)", but in the BooleanFieldEditor this creates a Label that is not needed (when using the BooleanFieldEditor.DEFAULT style), which makes the textual description be shown twice, in the Checkbox control, and in the (unnecessary) Label control. One solution for this issue would be to turn the method "BooleanFieldEditor.getChangeControl()" to be public instead of protected. This way one could set the tool tip directly in the checkbox Button control.
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/BooleanFieldEditor.java
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.preference;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
/**
 * A field editor for a boolean type preference.
 */
public class BooleanFieldEditor extends FieldEditor {