parent.setBorder(BORDER_UPPER);
if (postfix > offset) {
text= parent.getText(range.getOffset(), range.getLength());
final IRegion region= trimLine(text, content);
range.move(region.getOffset());
range.setLength(region.getLength());
}
}
}
}
} else if (line == lines - 1) {
offset= text.indexOf(content);
if (offset >= 0 && text.substring(0, offset).trim().length() != 0)
offset= -1;
postfix= text.lastIndexOf(end);
if (postfix >= 0 && text.substring(postfix + end.length()).trim().length() != 0)
postfix= -1;
if (offset >= 0 && offset == postfix)
// no content on line, only the comment postfix
range.setLength(0);
else {
if (offset >= 0)
// omit the content prefix
range.trimBegin(offset + content.length());
if (postfix >= 0)
// omit the comment postfix
range.trimEnd(-end.length());
text= parent.getText(range.getOffset(), range.getLength());
final IRegion region= trimLine(text, content);
if (region.getOffset() != 0 || region.getLength() != text.length()) {
range.move(region.getOffset());
range.setLength(region.getLength());
parent.setBorder(BORDER_UPPER);
parent.setBorder(BORDER_LOWER);
}
}