Exemplo n.º 1
0
 /** {@inheritDoc} */
 public int yForLineContaining(Rectangle alloc, int offs) throws BadLocationException {
   if (isAllocationValid()) {
     // TODO: make cached Y_AXIS offsets valid even with folding enabled
     // to speed this back up!
     Rectangle r = (Rectangle) modelToView(offs, alloc, Bias.Forward);
     if (r != null) {
       if (host.isCodeFoldingEnabled()) {
         int line = host.getLineOfOffset(offs);
         FoldManager fm = host.getFoldManager();
         if (fm.isLineHidden(line)) {
           return -1;
         }
       }
       return r.y;
     }
   }
   return -1;
 }