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: 31
Registered: December 2015
Member
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.

Thanks
Dimg
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: 772
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);
adapter.setPropagateKeys(true);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:JFace TableViewer Number of Columns header
Next Topic:Databinding to mutable property stops in SimplePropertyObserverValue
Goto Forum:
  


Current Time: Fri Sep 21 05:34:55 GMT 2018

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

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

Back to the top