Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » markerAnnotationSpecification problems: Highlights not showing
markerAnnotationSpecification problems: Highlights not showing [message #265593] Thu, 05 August 2004 19:47 Go to next message
Eclipse UserFriend
In my plugin.xml file I define both a
org.eclipse.ui.editors.annotationTypes structure and a
org.eclipse.ui.editors.markerAnnotationSpecification specification.

What I want to do is apply these annotations (specifically, highlighting
the text a color; similar to what the google toolbar "highlight" feature
does with text on web-pages) to a marker. My markers show perfectly in the
editors, but the highlighting doesn't.

Here's how I create it:

IMarker marker;
MarkerAnnotation annotation;

marker = file.createMarker("edu.ucsd.aspectbrowser.aspectmarker");
marker.setAttributes(map);
annotation = new MarkerAnnotation("edu.ucsd.aspectbrowser.highlight",
marker);
annotation.update();

Has someone else run into problems with this? Is there a short code sample
that shows how to perform text highlighting via markers?

Thanks,
Macneil
Re: markerAnnotationSpecification problems: Highlights not showing [message #265720 is a reply to message #265593] Fri, 06 August 2004 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Macneil Shonle wrote:

>In my plugin.xml file I define both a
>org.eclipse.ui.editors.annotationTypes structure and a
>org.eclipse.ui.editors.markerAnnotationSpecification specification.
>
>
Does your annotation type show up in Window > Preferences > Editors >
Annotations? If so, is highlighted in text checked? I can only say more
if I see your concrete extension.

>What I want to do is apply these annotations (specifically, highlighting
>the text a color; similar to what the google toolbar "highlight" feature
>does with text on web-pages) to a marker. My markers show perfectly in the
>editors, but the highlighting doesn't.
>
>Here's how I create it:
>
>IMarker marker;
>MarkerAnnotation annotation;
>
>marker = file.createMarker("edu.ucsd.aspectbrowser.aspectmarker");
>marker.setAttributes(map);
>
>
That's OK, but the following code is not needed because the text-based
editors automatically convert markers into annotations if the
annotationTypes extension point is correctly provided.

Dani

>annotation = new MarkerAnnotation("edu.ucsd.aspectbrowser.highlight",
>marker);
>annotation.update();
>
>Has someone else run into problems with this? Is there a short code sample
>that shows how to perform text highlighting via markers?
>
>Thanks,
>Macneil
>
>
>
Re: markerAnnotationSpecification problems: Highlights not showing [message #265826 is a reply to message #265720] Fri, 06 August 2004 17:00 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert wrote:

> Macneil Shonle wrote:

> >In my plugin.xml file I define both a
> >org.eclipse.ui.editors.annotationTypes structure and a
> >org.eclipse.ui.editors.markerAnnotationSpecification specification.
> >
> >
> Does your annotation type show up in Window > Preferences > Editors >
> Annotations? If so, is highlighted in text checked? I can only say more
> if I see your concrete extension.

Here's what I have:

<extension point="org.eclipse.core.resources.markers"
id="aspectmarker"
name="Aspect Marker">
<persistent value="false"/>
</extension>

<extension point="org.eclipse.ui.editors.annotationTypes">
<type name="edu.ucsd.aspectbrowser.highlight"/>
</extension>

<extension point="org.eclipse.ui.editors.markerAnnotationSpecification ">
<specification
colorPreferenceValue="0,255,255"
annotationType="edu.ucsd.aspectbrowser.highlight"
overviewRulerPreferenceValue="false"
presentationLayer="3"/>
</extension>

And, no, the annotation doesn't show up in the preferences screen. What am
I doing wrong?

Thanks,
Macneil


> >What I want to do is apply these annotations (specifically, highlighting
> >the text a color; similar to what the google toolbar "highlight" feature
> >does with text on web-pages) to a marker. My markers show perfectly in the
> >editors, but the highlighting doesn't.
> >
> >Here's how I create it:
> >
> >IMarker marker;
> >MarkerAnnotation annotation;
> >
> >marker = file.createMarker("edu.ucsd.aspectbrowser.aspectmarker");
> >marker.setAttributes(map);
> >
> >
> That's OK, but the following code is not needed because the text-based
> editors automatically convert markers into annotations if the
> annotationTypes extension point is correctly provided.

> Dani

> >annotation = new MarkerAnnotation("edu.ucsd.aspectbrowser.highlight",
> >marker);
> >annotation.update();
> >
> >Has someone else run into problems with this? Is there a short code sample
> >that shows how to perform text highlighting via markers?
> >
> >Thanks,
> >Macneil
> >
> >
> >
Re: markerAnnotationSpecification problems: Highlights not showing [message #266616 is a reply to message #265826] Wed, 11 August 2004 17:45 Go to previous message
Eclipse UserFriend
I found the solution:

<extension point="org.eclipse.core.resources.markers"
id="aspectmarker"
name="aspectmarker">
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="false"/>
</extension>

<extension point="org.eclipse.ui.editors.annotationTypes">
<type name="edu.ucsd.aspectbrowser.highlightannotation"
markerType="edu.ucsd.aspectbrowser.aspectmarker"/>
</extension>

<extension point="org.eclipse.ui.editors.markerAnnotationSpecification ">
<specification
annotationType="edu.ucsd.aspectbrowser.highlightannotation"
verticalRulerPreferenceKey="highlight.rulers.vertical"
textPreferenceKey="highlight.text"
colorPreferenceKey="highlight.color"
highlightPreferenceKey="highlight.background"
textPreferenceValue="false"
textStylePreferenceValue="NONE"
overviewRulerPreferenceKey="highlight.rulers.overview"
presentationLayer="4"
highlightPreferenceValue="true"
label="Aspect Browser"
colorPreferenceValue="253,255,157"
verticalRulerPreferenceValue="true"
overviewRulerPreferenceValue="true"
textStylePreferenceKey="highlight.text.style"/>
</extension>

Thanks everyone!

-Macneil
Previous Topic:Problems with selection provider.
Next Topic:Re: Xerces with Eclipse 3.0
Goto Forum:
  


Current Time: Thu May 08 23:52:41 EDT 2025

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

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

Back to the top