}
else {
g.drawLine(w2,y, w2,y+cellHeight);
}
}
Fold fold = fm.getFoldForLine(line);
if (fold!=null) {
if (fold==foldWithOutlineShowing && !fold.isCollapsed()) {
g.setColor(getForeground());
int w2 = width/2;
g.drawLine(w2,y+cellHeight/2, w2,y+cellHeight);
paintingOutlineLine = true;
}
if (fold.isCollapsed()) {
collapsedFoldIcon.paintIcon(this, g, x, y);
// Skip to next line to paint, taking extra care for lines with
// block ends and begins together, e.g. "} else {"
do {
int hiddenLineCount = fold.getLineCount();
if (hiddenLineCount==0) {
// Fold parser identified a zero-line fold region.
// This is really a bug, but we'll be graceful here
// and avoid an infinite loop.
break;
}
line += hiddenLineCount;
fold = fm.getFoldForLine(line);
} while (fold!=null && fold.isCollapsed());
}
else {
expandedFoldIcon.paintIcon(this, g, x, y);
}
}