Alignment () { IElementType nodeType = myNode.getElementType(); if (nodeType == JavaElementType.POLYADIC_EXPRESSION) nodeType = JavaElementType.BINARY_EXPRESSION; if (nodeType == JavaElementType.ASSIGNMENT_EXPRESSION) { if (myNode.getTreeParent() != null && myNode.getTreeParent().getElementType() == JavaElementType.ASSIGNMENT_EXPRESSION && myAlignment != null) { return myAlignment; } return createAlignment(mySettings.ALIGN_MULTILINE_ASSIGNMENT, null); } if (nodeType == JavaElementType.PARENTH_EXPRESSION) { return createAlignment(mySettings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION, null); } if (nodeType == JavaElementType.CONDITIONAL_EXPRESSION) { return createAlignment(mySettings.ALIGN_MULTILINE_TERNARY_OPERATION, null); } if (nodeType == JavaElementType.FOR_STATEMENT) { return createAlignment(mySettings.ALIGN_MULTILINE_FOR, null); } if (nodeType == JavaElementType.EXTENDS_LIST || nodeType == JavaElementType.IMPLEMENTS_LIST || nodeType == JavaElementType.PERMITS_LIST) { return createAlignment(mySettings.ALIGN_MULTILINE_EXTENDS_LIST, null); } if (nodeType == JavaElementType.THROWS_LIST) { return createAlignment(mySettings.ALIGN_MULTILINE_THROWS_LIST, null); } if (nodeType == JavaElementType.PARAMETER_LIST) { return createAlignment(mySettings.ALIGN_MULTILINE_PARAMETERS, null); } if (nodeType == JavaElementType.RESOURCE_LIST) { return createAlignment(mySettings.ALIGN_MULTILINE_RESOURCES, null); } if (nodeType == JavaElementType.BINARY_EXPRESSION) { Alignment defaultAlignment = null; if (shouldInheritAlignment()) { defaultAlignment = myAlignment; } return createAlignment(mySettings.ALIGN_MULTILINE_BINARY_OPERATION, defaultAlignment); } if (JavaFormatterUtil.isTopLevelTypeInCatchSection(nodeType, myNode)) { return createAlignment(myJavaSettings.ALIGN_TYPES_IN_MULTI_CATCH, null); } if (isTextBlock(myNode.getPsi())) { return createAlignment(myJavaSettings.ALIGN_MULTILINE_TEXT_BLOCKS,null); } return null; }