public abstract class AbstractBlockAlignmentProcessor extends java.lang.Object implements BlockAlignmentProcessor
BlockAlignmentProcessor.Context, BlockAlignmentProcessor.Result
Constructor and Description |
---|
AbstractBlockAlignmentProcessor() |
Modifier and Type | Method and Description |
---|---|
BlockAlignmentProcessor.Result |
applyAlignment(BlockAlignmentProcessor.Context context)
Asks current processor to perform alignment processing for the parameters encapsulated at the given context.
|
protected abstract boolean |
applyIndentToTheFirstBlockOnLine(IndentData alignmentAnchorIndent,
BlockAlignmentProcessor.Context context)
Encapsulates logic of applying alignment anchor indent to the target block that starts new line.
|
protected abstract IndentData |
calculateAlignmentAnchorIndent(BlockAlignmentProcessor.Context context)
Asks to calculate indent used for the anchor block of the alignment used by the
target block . |
protected abstract int |
getAlignmentIndentDiff(IndentData alignmentAnchorIndent,
BlockAlignmentProcessor.Context context)
Calculates the difference between alignment anchor indent and current target block indent.
|
public BlockAlignmentProcessor.Result applyAlignment(BlockAlignmentProcessor.Context context)
BlockAlignmentProcessor
applyAlignment
in interface BlockAlignmentProcessor
context
- target parameters holderprotected abstract IndentData calculateAlignmentAnchorIndent(BlockAlignmentProcessor.Context context)
target block
.context
- current processing contextprotected abstract boolean applyIndentToTheFirstBlockOnLine(IndentData alignmentAnchorIndent, BlockAlignmentProcessor.Context context)
alignmentAnchorIndent
- alignment anchor indentcontext
- current processing contexttrue
if desired alignment indent is applied to the current block;
false
otherwiseprotected abstract int getAlignmentIndentDiff(IndentData alignmentAnchorIndent, BlockAlignmentProcessor.Context context)
alignmentAnchorIndent
- alignment anchor indentcontext
- current processing context