I was wondering if there are any sample apps that demonstrate the use of GEF
rulers.

I've hooked them up using the RulerComposite and RulerProvider, however it
seems very limited in what can be customized. Maybe I'm missing something,
but most implementation methods or classes are private.

Ideally I would like to be able to enh or modify rulers to make them
comparable to the rulers in Office products.
At the very least I'd like to be able to prevent guidelines from being added
to the rulers (ie clicking on the ruler should not show a guideline).

The Eclipse GMF project uses GEF rulers. You could take a look at the GMF
code if you wanted to see if that helps any.

Regards,
Cherie

"Damian" <damian_biollo@hotmail.com> wrote in message
news:e4dper$fpc$1@utils.eclipse.org...
> Hi there,
>
> I was wondering if there are any sample apps that demonstrate the use of
GEF
> rulers.
>
> I've hooked them up using the RulerComposite and RulerProvider, however it
> seems very limited in what can be customized. Maybe I'm missing something,
> but most implementation methods or classes are private.
>
> Ideally I would like to be able to enh or modify rulers to make them
> comparable to the rulers in Office products.
> At the very least I'd like to be able to prevent guidelines from being
added
> to the rulers (ie clicking on the ruler should not show a guideline).
>
> Thanks
> Damian
>
>

Damian wrote:
> Hi there,
>
> I was wondering if there are any sample apps that demonstrate the use of GEF
> rulers.
>
> I've hooked them up using the RulerComposite and RulerProvider, however it
> seems very limited in what can be customized. Maybe I'm missing something,
> but most implementation methods or classes are private.
>
> Ideally I would like to be able to enh or modify rulers to make them
> comparable to the rulers in Office products.
> At the very least I'd like to be able to prevent guidelines from being added
> to the rulers (ie clicking on the ruler should not show a guideline).

I ended up writing my own simpler ruler implementation using just
Draw2D. There's really no way (as I can see) that one can significantly
customize the existing GEF ruler implementation without accessing and
extending internal classes.

Moreover, the GEF implementation of the rulers use GEF. That is, you
end up with three GraphicalViewers -- one for each ruler and the main
viewer for your own GEF canvas. Unless you really need the "edit"
capabilities of GEF for the rulers, you can just as easily draw them
using draw2D. The trickiest part is implementing the scroll bar
listeners. Here's an example: