Bug 183650 [FieldAssist] ContentProposalAdapter with Text produces unwanted popup on Enter
Build ID: I20070323-1616 Steps To Reproduce: 1. Setup a ContentProposalAdapter (using ContentProposalAdapter.PROPOSAL_REPLACE) with some proposals on a Text control. 2. Type some valid text into the Text control 3. Hit "Enter" (or select from the dropdown) More information: ContentProposalAdapter has a private controlListener that calls autoActivate() on a SWT.Modify event. This is fine except it gets triggered from ContentProposalAdapter.proposalAccepted(). The result is that you select one of the items and it modifies the Text control causing the popup to display again, which goes around until the user hits ESC to make it go away.
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
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;
/**
 * 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 {