Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TextEditor substring Content proposals`?
TextEditor substring Content proposals`? [message #1752191] Thu, 19 January 2017 15:33 Go to next message
Dimg Cim is currently offline Dimg CimFriend
Messages: 56
Registered: December 2015
Hello everyone,

I implement a small Texteditor with highlighting Syntax and Content proposals. (I don't want this implementd in XText). I used the Eclipse JFace Text Framework. So how can I implement the IContentAssistProcessor, that I can autocomplete substrings? At now it only search for the whole words at beginning- Further when I typing a word and press the Content proposals insert the autocomplete, the last given prefix append to the word. So how is to do the right?

E.g. I want to get HelloWorld, I type he and add the Content proposals HelloWorld, the result ist heHelloWorld, but he should after complete deleted.

Hope this is clear.

Re: TextEditor substring Content proposals`? [message #1752200 is a reply to message #1752191] Thu, 19 January 2017 20:34 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

This is what I use in my code:
Text tw = new Text(composite, SWT.SINGLE | SWT.BORDER);
ContentProposalAdapter adapter = new ContentProposalAdapter(tw, new TextContentAdapter(),
                                        contentProposalProvider, null, null);
Previous Topic:JFace TableViewer Number of Columns header
Next Topic:Databinding to mutable property stops in SimplePropertyObserverValue
Goto Forum:

Current Time: Fri Apr 23 01:12:08 GMT 2021

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

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

Back to the top