Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Looking for Code Assist UI Code
Looking for Code Assist UI Code [message #220486] Mon, 12 December 2005 13:39 Go to next message
Eclipse UserFriend
Originally posted by: gakins.ascent-systems.com

I'm trying to find the UI code that causes the list to appear for code
completion (Eclipse 3.1.1)?

Can anyone give me some direction? I'm pretty new to the source code and am
trying to work through the jdt packages, but there is a lot there.

Any help is appreciated.

-greg
Re: Looking for Code Assist UI Code [message #220559 is a reply to message #220486] Tue, 13 December 2005 15:28 Go to previous message
Eclipse UserFriend
Greg,

In your editor's main class, the one that extends the TextEditor class,
override the method getContentAssistant, which returns the
IContentAssistant, your content assistant that implements the
IContentAssistant. So, the code would be something like the below.

public IContentAssistant getContentAssistant()
{
return
this.getSourceViewerConfiguration().getContentAssistant(this .getSourceViewer());

}

This is only half of the battle. As you can see, you will have first to
create your own source viewer configuration. Your source viewer can
simply extend the Eclipse class SourceViewerConfiguration and override
the method SourceViewerConfiguration.getContentAssistant() to return
YOUR content assistant for your editor. In this getContentAssistant()
method, you can simply create and return a ContentAssistant or
ContentAssistant2 instance, all of which implements the
IContentAssistant. Make sure to set the completion processor for the
assistant object you created. It's best to have your content assistant
as a data member of your source configuration class so that you won't be
creating new content assistant instances, as the getContentAssistant()
does get called a lot! Explore the ContentAssist api calls.

The next thing is to implement your completion processor. You basically
have a clas that implements IContentAssistProcessor. The most important
methods to implement are the getCompletionAutoActivationCharacters() and
computeCompletionProposals that returns an array of
ICompletionProposal for Eclipse display in the list!

Good luck!

Greg wrote:

> I'm trying to find the UI code that causes the list to appear for code
> completion (Eclipse 3.1.1)?
>
> Can anyone give me some direction? I'm pretty new to the source code and am
> trying to work through the jdt packages, but there is a lot there.
>
> Any help is appreciated.
>
> -greg
>
>
Previous Topic:Startup JDT debugger from another Eclipse debugger
Next Topic:Forceing help system to use local info
Goto Forum:
  


Current Time: Fri Nov 07 17:52:17 EST 2025

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

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

Back to the top