Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Auto completion for SWT Table widget column (or Cell).

Please ask user questions in the newsgroups.

Tom

Am 15.04.11 14:33, schrieb Gangs:
> Hi Team,
> 
>   I have one requirement where I need to implement auto completion
> feature inside Table column. When user enter something in table cell, I
> need to show up suggestions as per user entered value. I know about
> logic to implement to get suggestions depending on user entered text.
> But I do not know how to show up the  results.
> 
> I wrote something like this.
> 
> private void setAutoCompletion(String value )
>     {
>         try
>         {
>             ContentProposalAdapter adapter = null;
>             //getAllProposals() have logic to retrieve suggestions.
>             String[] newProposals = getAllProposals(value);
>             SimpleContentProposalProvider scp = new
> SimpleContentProposalProvider( newProposals );
>             adapter = new ContentProposalAdapter(<instance of
> org.eclipse.swt.widgets.Table>, new TextContentAdapter(),
>                     scp,null,null);
>             adapter.setAutoActivationDelay(1000);
>            
> adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
>         }
>         catch( Exception e )
>         {
>             e.printStackTrace();
>         }
>     }
> 
> I call setAutoCompletion() method for each letter entered by user inside
> table cell.
> 
> The above code worked for me for Swt Text widget, but not working with
> SWT Table widget.
> 
> Any clue or suggestion would be greatly appreciable.
> 
> Thanks in advance.
> -- Ganga
> 
> 
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top