Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Need Auto Complete (Content Assist) feature(Need Auto Complete (Content Assist) feature)
icon5.gif  Need Auto Complete (Content Assist) feature [message #757413] Fri, 18 November 2011 10:56 Go to next message
Mustak  is currently offline Mustak Friend
Messages: 1
Registered: November 2011
Junior Member
Hi,

I have implemented auto complete feature in my application for a Text control using ContentProposalAdapter.

public AutocompleteVariables(Text text) {
if (text != null) {
this.text = text;
String[] proposals = getGlobalVariableArray();
AutocompleteContentProposalProvider provider = getContentProposalProvider(proposals);
ContentProposalAdapter adpter = new ContentProposalAdapter(text, new TextContentAdapter(), provider, null, getAutoactivationChars());
adpter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);
}
}

In Text Control, on typing "." I am seeing all proposals in the popup and on entering further text, proposals are getting filtered. On selecting a proposal, proposal is getting inserted into text control. Till this point everything is working fine. But text which was entered after "." is not getting cleared.

Ex. Before proposal selection -> "test.va"
After proposal selection -> "test.vavalue"
Required -> "test.value"

I can not use ProposalAcceptanceStyle as PROPOSAL_REPLACE as this will clear of all contains of the text control.

I want the text which was entered after "." to be removed(just like eclipse editor's auto complete feature).

How this can be done.

Thanks,
Mustak

Re: Need Auto Complete (Content Assist) feature [message #758209 is a reply to message #757413] Tue, 22 November 2011 10:55 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 18.11.2011 11:56, Mustak wrote:
> Hi,
>
> I have implemented auto complete feature in my application for a Text
> control using ContentProposalAdapter.
> public AutocompleteVariables(Text text) {
> if (text != null) {
> this.text = text;
> String[] proposals = getGlobalVariableArray();
> AutocompleteContentProposalProvider provider =
> getContentProposalProvider(proposals);
> ContentProposalAdapter adpter = new
> ContentProposalAdapter(text, new TextContentAdapter(), provider, null,
> getAutoactivationChars());
>
> adpter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);
> }
> }
>
> In Text Control, on typing "." I am seeing all proposals in the popup
> and on entering further text, proposals are getting filtered. On
> selecting a proposal, proposal is getting inserted into text control.
> Till this point everything is working fine. But text which was entered
> after "." is not getting cleared.
>
> Ex. Before proposal selection -> "test.va"
> After proposal selection -> "test.vavalue"
> Required -> "test.value"
>
> I can not use ProposalAcceptanceStyle as PROPOSAL_REPLACE as this will
> clear of all contains of the text control.
>
> I want the text which was entered after "." to be removed(just like
> eclipse editor's auto complete feature).
I would expect that this works out of the box when using
PROPOSAL_REPLACE and e.g. a
org.eclipse.jface.fieldassist.SimpleContentProposalProvider. If not, I
suggest you file a bug against Platform UI.

Dani
>
> How this can be done.
>
> Thanks,
> Mustak
>
>
Previous Topic:How to realize communication between UI components
Next Topic:Error running on exported product, not within eclipse !
Goto Forum:
  


Current Time: Fri Apr 26 17:56:10 GMT 2024

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

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

Back to the top