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
/*******************************************************************************
 * Copyright (c) 2004, 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
 *     Daniel Megert daniel_megert@ch.ibm.com Bug 169696
 *******************************************************************************/
package org.eclipse.ui.ide.dialogs;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.util.List;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;