Content Assist [message #78366] |
Fri, 14 March 2008 14:46 |
Eclipse User |
|
|
|
Originally posted by: devaughn.cisco.com
Hi
I am trying to add content assist with the ContentProposalAdapter. I
for some reason am unable to get it to work. Am I missing something?
text = new Text(container, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
IContentProposalProvider cpp = new IContentProposalProvider(){
@Override
public IContentProposal[] getProposals(String contents, int position)
{
List<IContentProposal> proposals = new
ArrayList<IContentProposal>();
for(int i =0; i<10; i++){
proposals.add(new CP(i+1 + "Label", contents));
}
return proposals.toArray(new IContentProposal[proposals.size()]);
}
};
ContentProposalAdapter adapter = new ContentProposalAdapter(text,new
ComboContentAdapter(),cpp,null,null);
-Dennis
|
|
|
Re: Content Assist [message #78418 is a reply to message #78366] |
Fri, 14 March 2008 17:54 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
I made some fixes to the ContentProposalAdapter (changes in CVS-HEAD) to get
a very basic functionality working (using TextContentAdapter). But frankly
spoken the content proposal mechanism is in no shape to be very useful.
There is still too much infrastructure missing in RWT. I'm not sure how it
made it into CVS. Sorry if you spend a lot of time, but feel free to file a
bug.
Ciao
Frank
"Dennis Vaughn" <devaughn@cisco.com> schrieb im Newsbeitrag
news:fre341$pjl$1@build.eclipse.org...
> Hi
>
> I am trying to add content assist with the ContentProposalAdapter. I for
> some reason am unable to get it to work. Am I missing something?
>
> text = new Text(container, SWT.BORDER);
> text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
>
> IContentProposalProvider cpp = new IContentProposalProvider(){
>
> @Override
> public IContentProposal[] getProposals(String contents, int position)
> {
> List<IContentProposal> proposals = new ArrayList<IContentProposal>();
> for(int i =0; i<10; i++){
> proposals.add(new CP(i+1 + "Label", contents));
> }
> return proposals.toArray(new IContentProposal[proposals.size()]);
> }
> };
>
> ContentProposalAdapter adapter = new ContentProposalAdapter(text,new
> ComboContentAdapter(),cpp,null,null);
>
>
> -Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds