int indLine= findMatchingOpenBracket(d, line, c.offset, 1); if (indLine != -1 && indLine != line)  return getIndentOfLine(d, indLine);
IRegion region= document.getLineInformation(line); String string= document.get(region.getOffset(), command.offset - region.getOffset()); if (line != 0 && string.trim().length() == 0) --line;  while (line != 0 && isLineEmpty(document, line)) --line;  int start= document.getLineOffset(line);   IDocumentPartitioner partitioner= document.getDocumentPartitioner(); if (partitioner != null) { ITypedRegion typedRegion= partitioner.getPartition(start); if (JavaPartitionScanner.JAVA_DOC.equals(typedRegion.getType())) start= document.getLineInformationOfOffset(typedRegion.getOffset()).getOffset(); } int whiteend= findEndOfWhiteSpace(document, start, command.offset); buf.append(document.get(start, whiteend - start)); if (getBracketCount(document, start, command.offset, true) > 0) { buf.append(getOneIndentLevel()); }
	private String getIndent(IDocument d, DocumentCommand c) {		if (c.offset < 0 || d.getLength() == 0)			return null;		try {			int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);			int line= d.getLineOfOffset(p);			// evaluate the line with the opening bracket that matches out closing bracket			int indLine= findMatchingOpenBracket(d, line, c.offset, 1);			if (indLine != -1 && indLine != line)				// take the indent of the found line				return getIndentOfLine(d, indLine);		} catch (BadLocationException e) {			JavaPlugin.log(e);		}		return null;	}