{
IDocument doc = getSourceFile().getDocument();
while (elements.hasNext())
{
IMultilineElement e = (IMultilineElement) elements.next();
if (e.getStartLine() == e.getEndLine())
{
continue;
}
int offset = doc.getLineOffset(e.getStartLine());
int length =
doc.getLineOffset(e.getEndLine()) - offset + doc.getLineLength(e.getEndLine());
/*
* store the position and annotation - the position is needed to create the fold, while
* the annotation is needed to remove it
*/