protected LogicGuide findGuideAt(int pos, boolean horizontal) {
   RulerProvider provider =
       ((RulerProvider)
           getHost()
               .getViewer()
               .getProperty(
                   horizontal
                       ? RulerProvider.PROPERTY_VERTICAL_RULER
                       : RulerProvider.PROPERTY_HORIZONTAL_RULER));
   return (LogicGuide) provider.getGuideAt(pos);
 }
  private void setRuler(RulerProvider provider, int orientation) {
    Object ruler = null;
    if (isRulerVisible && provider != null)
      // provider.getRuler() might return null (at least the API does not
      // prevent that)
      ruler = provider.getRuler();

    if (ruler == null) {
      // Ruler is not visible or is not present
      setRulerContainer(null, orientation);
      // Layout right-away to prevent an empty control from showing
      layout(true);
      return;
    }

    GraphicalViewer container = getRulerContainer(orientation);
    if (container == null) {
      container = createRulerContainer(orientation);
      setRulerContainer(container, orientation);
    }
    if (container.getContents() != ruler) {
      container.setContents(ruler);
      needToLayout = true;
      Display.getCurrent().asyncExec(runnable);
    }
  }