org.eclipse.jdt.internal.formatter.comment
Class CommentRegion

java.lang.Object
  extended by org.eclipse.jface.text.Position
      extended by org.eclipse.jdt.internal.formatter.comment.CommentRegion
All Implemented Interfaces:
IBorderAttributes, ICommentAttributes, IHtmlTagDelimiters
Direct Known Subclasses:
MultiCommentRegion

public class CommentRegion
extends org.eclipse.jface.text.Position
implements IHtmlTagDelimiters, IBorderAttributes, ICommentAttributes

Comment region in a source code document.

Since:
3.0

Field Summary
 
Fields inherited from class org.eclipse.jface.text.Position
isDeleted, length, offset
 
Fields inherited from interface org.eclipse.jdt.internal.formatter.comment.IHtmlTagDelimiters
HTML_CLOSE_PREFIX, HTML_TAG_POSTFIX, HTML_TAG_PREFIX
 
Fields inherited from interface org.eclipse.jdt.internal.formatter.comment.IBorderAttributes
BORDER_LOWER, BORDER_UPPER
 
Fields inherited from interface org.eclipse.jdt.internal.formatter.comment.ICommentAttributes
COMMENT_BLANKLINE, COMMENT_BREAK, COMMENT_CLOSE, COMMENT_CODE, COMMENT_FIRST_TOKEN, COMMENT_HTML, COMMENT_IMMUTABLE, COMMENT_NEWLINE, COMMENT_OPEN, COMMENT_PARAGRAPH, COMMENT_PARAMETER, COMMENT_ROOT, COMMENT_SEPARATOR, COMMENT_STARTS_WITH_RANGE_DELIMITER
 
Constructor Summary
CommentRegion(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.Position position, CodeFormatterVisitor formatter)
          Creates a new comment region.
 
Method Summary
 org.eclipse.text.edits.TextEdit format(int indentationLevel, boolean returnEdit)
          Formats the comment region with the given indentation level.
 
Methods inherited from class org.eclipse.jface.text.Position
delete, equals, getLength, getOffset, hashCode, includes, isDeleted, overlapsWith, setLength, setOffset, undelete
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentRegion

public CommentRegion(org.eclipse.jface.text.IDocument document,
                     org.eclipse.jface.text.Position position,
                     CodeFormatterVisitor formatter)
Creates a new comment region.

Parameters:
document - the document which contains the comment region
position - the position of this comment region in the document
formatter - the given code formatter
Method Detail

format

public final org.eclipse.text.edits.TextEdit format(int indentationLevel,
                                                    boolean returnEdit)
Formats the comment region with the given indentation level.

Parameters:
indentationLevel - the indentation level
Returns:
the resulting text edit of the formatting process
Since:
3.1