Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Can not get activation character in IContentProposalProvider(IContentProposalProvider does not get the activation character in getProposals method as the part of the contents string)
Can not get activation character in IContentProposalProvider [message #1578361] Thu, 22 January 2015 05:50 Go to next message
Eclipse UserFriend
I wanted to make a small demo for ContentProposal feature using RAP (2.3.1). I have got a word list of English language and I wanted to provide content proposals as soon as the user enters two characters. So I simply added all digits and letters as activation characters into the ContentProposalAdapter.

I have got a problem however. IContentProposalProvider gets theoretically the content of the associated Text field into its getProposals method. Still the activation character itself is not in the string. So for example:


  1. I enter "a" into the empty field -> I get an empty string as content, but position is 0
  2. I add "b" to the text field (so "ab") so far -> I get "a" as content and 1 as position.


The activation character itself is not at the end of the content string as I would expect. After some debugging the problem seems to be that no matter that the autoactivate uses asynchronous popup opening in autoActivate method, still opening the popup and asking for proposals from the provider happens always before updating the text of the TextField. So org.eclipse.jface.fieldassist.ContentProposalAdapter.getProposals() in line 2139 will always deliver the "getText()" of the text, which does not contain the activation character:

String contents = getControlContentAdapter().getControlContents(			getControl());


Since org.eclipse.jface.fieldassist.TextContentAdapter.getControlContents(Control) contains:

	public String getControlContents(Control control) {
		return ((Text) control).getText();
	}


What do I wrong? Do I misuse something, or this is a bug? I would expect to get that activation character in contents string in IContentProposalProvider.
Re: Can not get activation character in IContentProposalProvider [message #1578438 is a reply to message #1578361] Thu, 22 January 2015 06:50 Go to previous message
Eclipse UserFriend
If I set org.eclipse.jface.fieldassist.ContentProposalAdapter.setAutoActivationDelay(int) to be for example 500, then it works as expected. So this must be a bug, which could be corrected by simply passing text.getText() + activation character to the ContentProposalProvider.
Previous Topic:How to avoid popup blocker?
Next Topic:Row Template crashs in RAP Version 2.3.1
Goto Forum:
  


Current Time: Thu Jul 03 20:01:04 EDT 2025

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

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

Back to the top