protected class ASTJCompilationUnit.NodeCommenter.LineBreakInserter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected char[] |
charContent |
Modifier | Constructor and Description |
---|---|
protected |
ASTJCompilationUnit.NodeCommenter.LineBreakInserter() |
Modifier and Type | Method and Description |
---|---|
protected InsertEdit |
createLineBreakAfterNode(ITrackedNodePosition nodePosition,
ASTNode node)
Creates line break at the end of the node when there is another node declared at the same line.
|
protected InsertEdit |
createLineBreakBeforeNode(ITrackedNodePosition nodePosition,
ASTNode node)
Creates line break at the beginning of the node when there is another node declared at the same line.
|
protected java.lang.String |
createLineBreakString(int startOfLineOffset,
boolean isCommentedOut)
Creates line break string containing line delimiter, line comment string if
isCommentedOut is true ,
and same indent string as the line that break is inserted at. |
protected java.lang.String |
createLineBreakString(java.lang.String lineDelimiter,
int startOfLineOffset,
boolean isCommentedOut)
Creates line break string containing line delimiter, line comment string if
isCommentedOut is true ,
and indent string that is the same as of the line that break is inserted at. |
protected IDocument |
getDocument() |
protected java.lang.String |
getIndent(int lineStart) |
protected boolean |
isWhitespace(int start,
int end)
Determines if there are only whitespace characters in the given range in char array.
|
protected ASTJCompilationUnit.NodeCommenter.LineBreakInserter()
protected IDocument getDocument()
protected InsertEdit createLineBreakBeforeNode(ITrackedNodePosition nodePosition, ASTNode node) throws BadLocationException
nodePosition
- node
- InsertEdit
or null
if none requiredBadLocationException
protected InsertEdit createLineBreakAfterNode(ITrackedNodePosition nodePosition, ASTNode node) throws BadLocationException
nodePosition
- node
- InsertEdit
or null
if none requiredBadLocationException
protected java.lang.String getIndent(int lineStart)
lineStart
- the first character of the line excluding CR
or LF
characters.lineStart
, empty string if there is no indent or lineStart
is invalid positionIndentManipulation#isIndentChar(char)
protected boolean isWhitespace(int start, int end)
start
- end
- true
if only whitespace characters are between start
and end
Character.isWhitespace(char)
protected java.lang.String createLineBreakString(int startOfLineOffset, boolean isCommentedOut) throws BadLocationException
isCommentedOut
is true
,
and same indent string as the line that break is inserted at.startOfLineOffset
- isCommentedOut
- BadLocationException
protected java.lang.String createLineBreakString(java.lang.String lineDelimiter, int startOfLineOffset, boolean isCommentedOut)
isCommentedOut
is true
,
and indent string that is the same as of the line that break is inserted at.lineDelimiter
- startOfLineOffset
- isCommentedOut
-