Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Position Markups (visual cues) in editor Code Templates?
Position Markups (visual cues) in editor Code Templates? [message #293676] Thu, 27 October 2005 22:34 Go to next message
Eclipse UserFriend
Originally posted by: mark_melvin.amis.com

Hi There,

I have just implemented code templates in my editor. It all seems to
work great, however I do not get the nice boxes surrounding the
positions in my editor, nor do I get the green bar indicating where the
${cursor} should be. I swear this was working before but now there is
nothing. I'm assuming this is something to with my
SourceViewerConfiguration not implementing something, or not calling
some obscure method. Does anyone know off the top of their head what it
is that enables these visual cues? The code templates are so much
more useful with them there.

Thanks,
Mark.
Re: Position Markups (visual cues) in editor Code Templates? [message #293769 is a reply to message #293676] Fri, 28 October 2005 18:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark_melvin.amis.com

This is slowly driving me insane...

I can trace this through and it looks to me like the mechanism with
which the positions are added are in the method:

TemplateProposal#apply(ITextViewer viewer, char trigger, int stateMask,
int offset)

This method creates a bunch of positions and then uses a LinkedModeUI to
maintain them. I can clearly see it creates the positions, and sets the
exit position (corresponding to my ${cursor} variable), and the tab
navigation and linked variable editing all works fine - *but there are
no visual annotations!*. There are no rectangles around the variables,
and there is no green bar showing the cursor. Grrr!

I can't figure out where to look for this. What draws these annotations
in my editor? Did I miss something in my editor, or in my
SourceViewerConfiguration? Any help would be very welcome.

Thanks,
Mark.

Mark Melvin wrote:
> Hi There,
>
> I have just implemented code templates in my editor. It all seems to
> work great, however I do not get the nice boxes surrounding the
> positions in my editor, nor do I get the green bar indicating where the
> ${cursor} should be. I swear this was working before but now there is
> nothing. I'm assuming this is something to with my
> SourceViewerConfiguration not implementing something, or not calling
> some obscure method. Does anyone know off the top of their head what it
> is that enables these visual cues? The code templates are so much
> more useful with them there.
>
> Thanks,
> Mark.
Re: Position Markups (visual cues) in editor Code Templates? [message #293772 is a reply to message #293769] Fri, 28 October 2005 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark_melvin.amis.com

OK, I figured this one out - looks like a bug. I'll file one shortly.
The short story:

Our product does not use the JDT. The class
org.eclipse.jface.text.link.LinkedPositionAnnotations defines its
annotation types as follows:

/* annotation types */
private static final String TARGET_ANNOTATION_TYPE=
"org.eclipse.jdt.ui.link.target"; //$NON-NLS-1$
private static final String SLAVE_ANNOTATION_TYPE=
"org.eclipse.jdt.ui.link.slave"; //$NON-NLS-1$
private static final String FOCUS_ANNOTATION_TYPE=
"org.eclipse.jdt.ui.link.master"; //$NON-NLS-1$
private static final String EXIT_ANNOTATION_TYPE=
"org.eclipse.jdt.ui.link.exit"; //$NON-NLS-1$

If the JDT isn't installed, this obviously doesn't work. <sigh>

Mark.

Mark Melvin wrote:
> This is slowly driving me insane...
>
> I can trace this through and it looks to me like the mechanism with
> which the positions are added are in the method:
>
> TemplateProposal#apply(ITextViewer viewer, char trigger, int stateMask,
> int offset)
>
> This method creates a bunch of positions and then uses a LinkedModeUI to
> maintain them. I can clearly see it creates the positions, and sets the
> exit position (corresponding to my ${cursor} variable), and the tab
> navigation and linked variable editing all works fine - *but there are
> no visual annotations!*. There are no rectangles around the variables,
> and there is no green bar showing the cursor. Grrr!
>
> I can't figure out where to look for this. What draws these annotations
> in my editor? Did I miss something in my editor, or in my
> SourceViewerConfiguration? Any help would be very welcome.
>
> Thanks,
> Mark.
>
> Mark Melvin wrote:
>
>> Hi There,
>>
>> I have just implemented code templates in my editor. It all seems to
>> work great, however I do not get the nice boxes surrounding the
>> positions in my editor, nor do I get the green bar indicating where the
>> ${cursor} should be. I swear this was working before but now there is
>> nothing. I'm assuming this is something to with my
>> SourceViewerConfiguration not implementing something, or not calling
>> some obscure method. Does anyone know off the top of their head what it
>> is that enables these visual cues? The code templates are so much
>> more useful with them there.
>>
>> Thanks,
>> Mark.
Re: Position Markups (visual cues) in editor Code Templates? [message #293838 is a reply to message #293772] Mon, 31 October 2005 13:40 Go to previous message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
Just for reference by others: the issue is now being tracked under

https://bugs.eclipse.org/bugs/show_bug.cgi?id=114247

-tom
Previous Topic:Marker or Annotation for left ruler error icon
Next Topic:problem with creating an editor[Urgent]
Goto Forum:
  


Current Time: Fri Sep 27 14:22:40 GMT 2024

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

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

Back to the top