Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] autocomplete in swt

Hi Andrei Medan,

Use the subject control content assistant

org.eclipse.swt.widgets.Text.ContentAssistHandler class has the following
method

createHandlerForText(Text text, ISubjectControlContentAssistant
contentAssistant).

Where U have to pass the text field U have created and ur content assistant
processor has to implement the ISubjectControlContentAssistProcessor
interface for the providing the auto completion.


Here is how to add the completion processor to the text.

	ISubjectControlContentAssistProcessor completionProcessor = new
YourAutoCompletionProcessor();
   
	SubjectControlContentAssistant subjectControlContentAssistant = new
SubjectControlContentAssistant();
	
	
subjectControlContentAssistant.setContentAssistProcessor(completionProcessor
, IDocument.DEFAULT_CONTENT_TYPE);
	
	//enable auto activation
	subjectControlContentAssistant.enableAutoActivation(true);
	subjectControlContentAssistant.setAutoActivationDelay(500);
	
	subjectControlContentAssistant.enableAutoInsert(true);
	subjectControlContentAssistant.enablePrefixCompletion(false);
	   	   
	
subjectControlContentAssistant.setProposalPopupOrientation(IContentAssistant
.CONTEXT_INFO_ABOVE);
	
	
ContentAssistantHandler.createHandlerForText(fConditionText,subjectControlCo
ntentAssistant);


Hope this help U out for start off.

With regards
P.Marimuthu



-----Original Message-----
From: platform-swt-dev-bounces@xxxxxxxxxxx
[mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of
andrei_medanro@xxxxxxxxx
Sent: Friday, January 13, 2006 1:57 PM
To: platform-swt-dev@xxxxxxxxxxx
Subject: [platform-swt-dev] autocomplete in swt


Hello everybody, I have to implement an autocomplete
in a swt text field. Have anyone of you any kind of
sugestion?

Thanks,
Andrei Medan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top