IndentData (final CommonCodeStyleSettings.IndentOptions options) { // Calculate result as an indent of current block from parent plus parent block indent. if (myIndentFromParent != null) { final AbstractBlockWrapper firstIndentedParent = findFirstIndentedParent(); final IndentData indentData = new IndentData(myIndentFromParent.getIndentSpaces(), myIndentFromParent.getSpaces()); if (firstIndentedParent == null) { return indentData; } else { final WhiteSpace whiteSpace = firstIndentedParent.getWhiteSpace(); return new IndentData(whiteSpace.getIndentOffset(), whiteSpace.getSpaces()).add(indentData); } } // Consider that current block is not indented if it doesn't have a parent block. if (myParent == null) return new IndentData(0); // Define that current block and all its parents that start at the same offset can't use first child indent as block indent. if (getIndent().isAbsolute()) { setCanUseFirstChildIndentAsBlockIndent(false); AbstractBlockWrapper current = this; while (current != null && current.getStartOffset() == getStartOffset()) { current.setCanUseFirstChildIndentAsBlockIndent(false); current = current.myParent; } } return myParent.getChildOffset(this, options, this.getStartOffset()); }