Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Adding content assist to non-javadoc in java editor.(Adding content assist to non-javadoc in java editor)
Adding content assist to non-javadoc in java editor. [message #985420] Thu, 15 November 2012 11:30 Go to next message
Nikhil chulli is currently offline Nikhil chulliFriend
Messages: 9
Registered: June 2012
Junior Member
I am trying to achieve content assist in non-javadoc of the java editor, i.e. suppose I type "MY" and press crtl+space-bar it should list the possible completions(like MYSPACE, MYWORK, MYNETWORK etc) provide by me. To accomplish this I implemented IJavaCompletionProposalComputer.

public class MyProposalComputer implements IJavaCompletionProposalComputer {
	private final LinksToProposalProcessor fProcessor = new LinksToProposalProcessor();
	public List<ICompletionProposal> computeCompletionProposals(
		ContentAssistInvocationContext context, IProgressMonitor monitor) {
			List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();
			IContextInformation info= new ContextInformation("MYSPACE", "MYSPACE Test");
			result.add( new CompletionProposal("MYSPACE", context.getInvocationOffset(), 0, "MYSPACE".length(), null, "MYSPACE", info, "Test MYSPACE"));
			return result;

	public List<IContextInformation> computeContextInformation(
			ContentAssistInvocationContext context, IProgressMonitor monitor) {
		return Arrays.asList(fProcessor.computeContextInformation(context.getViewer(), context.getInvocationOffset()));

	public String getErrorMessage() {
		return fProcessor.getErrorMessage();

	public void sessionEnded() {
		// TODO Auto-generated method stub

	public void sessionStarted() {
		// TODO Auto-generated method stub

But this is not working. Do I need to add anything else?
Re: Adding content assist to non-javadoc in java editor. [message #986091 is a reply to message #985420] Sun, 18 November 2012 17:58 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1828
Registered: July 2009
Senior Member
Have you registered your proposal computer using the corresponding extension point?
Previous Topic:GWT - What happens when one selects "Use Google Web Toolkit"?
Next Topic:Converting IFile to IDocument
Goto Forum:

Current Time: Fri Nov 27 18:49:20 GMT 2020

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

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

Back to the top