com.intellij.formatting
Interface FormattingDocumentModel


public interface FormattingDocumentModel

Represents a model of the document containing the formatted text, as seen by the formatter. Allows a formatter to access information about the document.

See Also:
FormattingModel.getDocumentModel()

Method Summary
 int getLineNumber(int offset)
          Returns the line number corresponding to the specified offset in the document.
 int getLineStartOffset(int line)
          Returns the offset corresponding to the start of the specified line in the document.
 java.lang.CharSequence getText(TextRange textRange)
          Returns the text contained in the specified text range of the document.
 int getTextLength()
          Returns the length of the entire document text.
 

Method Detail

getLineNumber

int getLineNumber(int offset)
Returns the line number corresponding to the specified offset in the document.

Parameters:
offset - the offset for which the line number is requested.
Returns:
the line number corresponding to the offset.

getLineStartOffset

int getLineStartOffset(int line)
Returns the offset corresponding to the start of the specified line in the document.

Parameters:
line - the line number for which the offset is requested.
Returns:
the start offset of the line.

getText

java.lang.CharSequence getText(TextRange textRange)
Returns the text contained in the specified text range of the document.

Parameters:
textRange - the text range for which the text is requested.
Returns:
the text at the specified text range.

getTextLength

int getTextLength()
Returns the length of the entire document text.

Returns:
the document text length.