Bug 271339 [FieldAssist] Add CC text field content assist doesn't work as expected when narrowing suggestions
Continued typing in the text field should narrow the list of results displayed in the suggest list. On Carbon, this is how it works: # Open any Bugzilla bug in the Mylyn task editor # position the caret in the 'Add CC' field # press CTRL+Space # observe suggested values # start typing (slowly) 'dg' # notice that with each successive character the list is narrowed to fewer matching results # start typing backspace (slowly) to delete the characters in the text field # notice that the list is expanded to show additional matching results as the characters are deleted On Cocoa, typing in the text field after the suggest list is displayed causes the suggest list to go away.
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
import org.eclipse.swt.widgets.Control;
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 is not intended to be subclassed.
 * 
 * @since 3.2
 */
public class ContentProposalAdapter {