Bug 293841 [FieldAssist] NumLock keyDown event should not close the proposal popup [with patch]
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 Build Identifier: 20090920-1017 I have a Text widget with a ContentProposalAdapter attached to it. The user shall input some numeric value, but on this platform (Windows 2003 Terminal Server with rdestop unix client, if that matters) there are additional keyDown events generated for num pad input. These events almost immediately close the proposal popup after user input. Input with the normal "digit keys" works as expected. The ContentProposalAdapter.ControlProposalPopup.TargetControlListener class currently does check for keyDown events on the SWT.CAPS_LOCK and SWT.MOD{1-4} keys and does ignore them. Any other key forces the popup to close. I suggest to also NOT close the popup on SWT.NUM_LOCK keyDown events. Reproducible: Always
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.PopupDialog;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Util;
import org.eclipse.jface.viewers.ILabelProvider;
/**
 * ContentProposalAdapter can be used to attach content proposal behavior to a
 * control. This behavior includes obtaining proposals, opening a popup dialog,
 * managing the content of the control relative to the selections in the popup,
 * and optionally opening up a secondary popup to further describe proposals.
 * <p>
 * A number of configurable options are provided to determine how the control
 * content is altered when a proposal is chosen, how the content proposal popup
 * is activated, and whether any filtering should be done on the proposals as
 * the user types characters.
 * <p>
 * This class provides some overridable methods to allow clients to manually
 * control the popup. However, most of the implementation remains private.
 * 
 * @since 3.2
 */
public class ContentProposalAdapter {