Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Custom editor content assist tab behavior
Custom editor content assist tab behavior [message #779947] Mon, 16 January 2012 21:56 Go to next message
Mikkel Fishman is currently offline Mikkel FishmanFriend
Messages: 4
Registered: January 2012
Junior Member
Hello, I've been dinking around with making a custom editor for a few days, primarily going off the Java Editor example and am trying to put the finishing touches on.

One of my completion processors is based on Templates, and I can't figure out how to enable tab highlighting after entry.

For example, typing method =>
[public] [void] [methodName]([paramlist]) {
//TODO implement
[functionbody]
}

where it highlights public first and then on a tab highlights the next phrase in brackets, and so on.

I managed to find the Java Editor that Eclipse uses but when I looked at that it didn't even seem to be using the same org.eclipse.jface.text.contentassist constructs.

I overrode an implementation of ICompletionProposal.getSelection and can use that to select the first word I want, but don't know where to go from there.

Any suggestions?

Re: Custom editor content assist tab behavior [message #780506 is a reply to message #779947] Wed, 18 January 2012 11:09 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 16.01.2012 22:56, Mikkel Fishman wrote:
> Hello, I've been dinking around with making a custom editor for a few
> days, primarily going off the Java Editor example and am trying to put
> the finishing touches on.
> One of my completion processors is based on Templates, and I can't
> figure out how to enable tab highlighting after entry.
> For example, typing method =>
> [public] [void] [methodName]([paramlist]) {
> //TODO implement [functionbody]
> }
>
> where it highlights public first and then on a tab highlights the next
> phrase in brackets, and so on.
Are you talking about the highlighting once the template/code is
inserted? If so, what you want to look at is the linked mode UI. Take a
closer look at
org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal.apply(ITextViewer,
char, int, int).

Dani
>
> I managed to find the Java Editor that Eclipse uses but when I looked
> at that it didn't even seem to be using the same
> org.eclipse.jface.text.contentassist constructs.
>
> I overrode an implementation of ICompletionProposal.getSelection and
> can use that to select the first word I want, but don't know where to
> go from there.
>
> Any suggestions?
>
>
Re: Custom editor content assist tab behavior [message #780624 is a reply to message #780506] Wed, 18 January 2012 19:55 Go to previous message
Mikkel Fishman is currently offline Mikkel FishmanFriend
Messages: 4
Registered: January 2012
Junior Member
Thanks Dani, that should be enough to figure it out.
Previous Topic:TabDescriptorProvider and tabbed.propertyTabs extension point
Next Topic:SWT: try to hide/show widgets without success
Goto Forum:
  


Current Time: Wed Apr 24 23:45:14 GMT 2024

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

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

Back to the top