Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Content Assist
Content Assist [message #78366] Fri, 14 March 2008 14:46 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:UI styling improvements
Next Topic:Table - dynamic scroll bars
Goto Forum:
  


Current Time: Fri Apr 26 00:27:16 GMT 2024

Powered by FUDForum. Page generated in 0.03030 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top