Bug 171027 Emtpy space created when calling setEnabled on encoding field editor
I20070116-1510 FieldEditor.setEnabled(boolean) is implemented in a pretty strange way: it creates the label if not yet created. This has side effects for clients that do not need/create that label but later call setEnabled(...). An example for such a subclass is AbstractEncodingFieldEditor. Now, fixing this in FieldEditor.setEnabled(...) might be problematic because currently for some clients the label might only appear as a side-effect of calling setEnabled(...) during initialization. A safer fix might be to simply not call super.setEnabled(...) in AbstractEncodingFieldEditor.setEnabled(...).
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/AbstractEncodingFieldEditor.java
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.WorkbenchEncoding;
import org.eclipse.ui.ide.IDEEncoding;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
/**
 * The abstract superclass of field editors used to set an encoding. Any user
 * entered encodings will be added to the list of encodings available via
 * {@link org.eclipse.ui.ide.IDEEncoding}.
 * <p>
 * Subclasses may extend, but must call <code>createEncodingGroup</code>
 * during <code>doFillIntoGrid</code>.
 * </p>
 * 
 * @see org.eclipse.ui.ide.IDEEncoding
 * @since 3.1
 */
public abstract class AbstractEncodingFieldEditor extends FieldEditor {
	private Composite container;
	private Button defaultEncodingButton;
	private String defaultEnc;
	private Button otherEncodingButton;
	private Combo encodingCombo;
	private boolean isValid = true;
	private String oldSelectedEncoding;
	private String groupTitle = IDEWorkbenchMessages.WorkbenchPreference_encoding;
	/**
	 * Creates a new encoding field editor with no settings set.