Position Markups (visual cues) in editor Code Templates? [message #293676] |
Thu, 27 October 2005 22:34 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04023 seconds