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: 59
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
Eclipse UserFriend
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);
Previous Topic:JFace TableViewer Number of Columns header
Next Topic:Databinding to mutable property stops in SimplePropertyObserverValue
Goto Forum:
  


Current Time: Fri Apr 19 10:38:01 GMT 2024

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

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

Back to the top