public abstract class AbstractBlockWrapper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
myEnd |
protected int |
myFlags |
protected IndentInfo |
myIndentFromParent |
protected CompositeBlockWrapper |
myParent |
protected int |
myStart |
Constructor and Description |
---|
AbstractBlockWrapper(Block block,
WhiteSpace whiteSpaceBefore,
CompositeBlockWrapper parent,
TextRange textRange) |
Modifier and Type | Method and Description |
---|---|
void |
arrangeParentTextRange()
Applies start offset of the current block wrapper to the parent block wrapper if the one is defined.
|
protected void |
arrangeStartOffset(int startOffset)
Applies given start offset to the current block wrapper and recursively calls this method on parent block wrapper
if it starts at the same place as the current one.
|
IndentData |
calculateChildOffset(CommonCodeStyleSettings.IndentOptions indentOption,
ChildAttributes childAttributes,
int index) |
void |
dispose() |
protected AbstractBlockWrapper |
findFirstIndentedParent()
Tries to find first parent block of the current block that starts before the current block and which
white space contains line feeds. |
AlignmentImpl |
getAlignment() |
AlignmentImpl |
getAlignmentAtStartOffset()
Allows to retrieve alignment applied to any block that conforms to the following conditions:
that block is current block or its ancestor (direct or indirect parent);
that block starts at the same offset as the current one;
|
IndentData |
getChildOffset(AbstractBlockWrapper child,
CommonCodeStyleSettings.IndentOptions options,
int targetBlockStartOffset) |
int |
getEndOffset() |
IndentImpl |
getIndent() |
Language |
getLanguage()
There is a possible case that particular block's language differs from the language implied by the file type.
|
int |
getLength() |
ASTNode |
getNode()
Returns the AST node corresponding to the block, if known.
|
abstract IndentData |
getNumberOfSymbolsBeforeBlock()
Allows to retrieve object that encapsulates information about number of symbols before the current block starting
from the line start.
|
WrapImpl |
getOwnWrap() |
CompositeBlockWrapper |
getParent() |
protected abstract LeafBlockWrapper |
getPreviousBlock() |
int |
getStartOffset() |
WhiteSpace |
getWhiteSpace()
Returns the whitespace preceding the block.
|
WrapImpl |
getWrap() |
java.util.ArrayList<WrapImpl> |
getWraps()
Returns the list of wraps for this block and its parent blocks that start at the same offset.
|
protected abstract boolean |
indentAlreadyUsedBefore(AbstractBlockWrapper child)
Allows to answer if current wrapped block has a child block that is located before given block and has line feed.
|
boolean |
isIncomplete() |
void |
reset() |
protected void |
setCanUseFirstChildIndentAsBlockIndent(boolean newValue) |
void |
setIndent(IndentImpl indent) |
void |
setIndentFromParent(IndentInfo indentFromParent)
Applies given indent value to '
indentFromParent' property of the current wrapped block. |
java.lang.String |
toString() |
protected CompositeBlockWrapper myParent
protected int myStart
protected int myEnd
protected int myFlags
protected IndentInfo myIndentFromParent
public AbstractBlockWrapper(Block block, WhiteSpace whiteSpaceBefore, CompositeBlockWrapper parent, TextRange textRange)
public WhiteSpace getWhiteSpace()
public ASTNode getNode()
public java.util.ArrayList<WrapImpl> getWraps()
public int getStartOffset()
public int getEndOffset()
public int getLength()
public Language getLanguage()
protected void arrangeStartOffset(int startOffset)
startOffset
- new start offset value to applypublic IndentImpl getIndent()
public CompositeBlockWrapper getParent()
public WrapImpl getWrap()
public WrapImpl getOwnWrap()
null
otherwisepublic void reset()
public IndentData getChildOffset(AbstractBlockWrapper child, CommonCodeStyleSettings.IndentOptions options, int targetBlockStartOffset)
protected abstract boolean indentAlreadyUsedBefore(AbstractBlockWrapper child)
child
- target child block to processtrue
if current block has a child that is located before the given block and contains line feed;
false
otherwisepublic abstract IndentData getNumberOfSymbolsBeforeBlock()
protected abstract LeafBlockWrapper getPreviousBlock()
null
otherwiseprotected final void setCanUseFirstChildIndentAsBlockIndent(boolean newValue)
public void arrangeParentTextRange()
public IndentData calculateChildOffset(CommonCodeStyleSettings.IndentOptions indentOption, ChildAttributes childAttributes, int index)
public AlignmentImpl getAlignmentAtStartOffset()
null
otherwisepublic void setIndentFromParent(IndentInfo indentFromParent)
indentFromParent'
property of the current wrapped block.
Given value is also applied to 'indentFromParent'
properties of all parents of the current wrapped block if the
value is defined (not null
).
This property is used later during
LeafBlockWrapper.calculateOffset(CommonCodeStyleSettings.IndentOptions)
leaf block offset calculation}.indentFromParent
- indent value to applyprotected AbstractBlockWrapper findFirstIndentedParent()
white space
contains line feeds.null
otherwisepublic void setIndent(IndentImpl indent)
public AlignmentImpl getAlignment()
public boolean isIncomplete()
public void dispose()
public java.lang.String toString()
toString
in class java.lang.Object