Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282371

Summary: ContentProposalAdapter is broken
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 297167    
Bug Blocks:    

Description Benjamin Muskalla CLA 2009-07-03 08:17:04 EDT
ContentProposalAdapter is currently not usable. We need to think about a way to solve this without involving too many key events.

Snippet that uses AutoCompleteField which is based on the ContentProposalAdapter.

--------------------------------
public class AutoDemo implements IEntryPoint {

  public int createUI() {
    Display display = new Display();
    Shell shell = new Shell( display );
    shell.setSize( 200, 200 );
    shell.setLayout( new GridLayout() );
    final Text text = new Text( shell, SWT.SINGLE | SWT.LEAD | SWT.BORDER );
    text.setLayoutData( new GridData( SWT.LEFT, SWT.CENTER, true, false ) );
    text.setText( "some confusing text" );
   
    AutoCompleteField field = new AutoCompleteField( text,
                                                     new TextContentAdapter(),
                                                     new String[]{
                                                       "foo", "bar", "baz"
                                                     } );
                                                     
    shell.pack();
    shell.open();
    while( !shell.isDisposed() ) {
      if( !display.readAndDispatch() )
        display.sleep();
    }
    return 0;
  }
}
Comment 1 Ivan Furnadjiev CLA 2009-12-08 03:33:06 EST
The attached snippet now works as expected. Changes are in CVS HEAD.