[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: editor ruler action icon

Kai,

Actually, I was using the markerImageProvider until I read that it's
internal only, although it probably wouldn't have solved the problem of
changing the icon depending if the breakpoint is enabled or disabled, as
you are pointing out.

Looking at what JDT did triggered my first posting, after my head started
spinning :-), hoping that there is a simpler way of doing it that I simply
didn't know about...
Do you have any timetable for when this "looking into simplifying this"
might show up in a driver?  

Robert.


-------------------------------------------------------------------------------
Kai-Uwe Maetzel wrote:

> Robert,

> I assume that you talk about the breakpoints view contributed
> by the "org.eclipse.debug.ui" plugin. The mechanisms how the vertical
> ruler and the breakpoints view look up icons differ. The breakpoints
> view has specific knowledge about markers representing breakpoints,
> whereas the vertical ruler does not assume a specific marker type.

> If you create a marker which should be rendered independently of
> its state, the following is recommended: You specify a particular icon
> for a particular marker type in your plugin.xml file, e.g.:
> <extension point="org.eclipse.ui.markerImageProviders">
>     <imageprovider  id="myplugin.myMarkerProvider"
>         markertype="myplugin.mymarker"
>         icon="myiconlocation/mymarkericon.gif">
>     </imageprovider>
> </extension>

> Your definition is picked up by all editors relying on the provided
> default implementation.


> If  you create a marker that should be rendered depending on
> its state, you have to provide an Annotation which masters the
> required rendering. In addition, you have to make sure that for
> your marker your custom annotation is created. If you deal with
> your own IAnnotationModel, it depends on your implementation
> how your annotation is created and added to the  model. If you
> use, e.g., the ResourceAnnotationModel, you can create a subclass
> of MarkerAnnotation, say MyMarkerAnnotation, and subclass
> ResourceAnnotationModel overriding createMarkerAnnotation(IMarker)
> to return MyMarkerAnnotation. Thus, when building an editor, you have
> to configure it with document providers which return your custom
> ResourceAnnotationModel. As example look at JDT. They provide their
> own JavaMarkerAnnotation, annotation model, etc.
> We are looking into simplifying this for the future.

> Kai


> "Robert Weisz" <weisz@xxxxxxxxxx> wrote in message
> news:9jpqie$ut9$1@xxxxxxxxxxxxxxxx
> > Kai,
> > My scenario: I have added an action to the ruler's context menu, to add a
> > breakpoint; when I select the action, the breakpoint gets created and
> > shows in the Breakpoints view and it has some icon there.  The only thing
> > I am missing is that no icon (annotation?) shows in the vertical ruler
> > itself.
> > I was expecting that the same icon would show up on the vertical ruler as
> > well. What do I need to do to make an icon show in the vertical ruler?
> > Thanks,
> >        Robert.
> >