本文整理汇总了Java中com.intellij.formatting.ChildAttributes类的典型用法代码示例。如果您正苦于以下问题:Java ChildAttributes类的具体用法?Java ChildAttributes怎么用?Java ChildAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChildAttributes类属于com.intellij.formatting包,在下文中一共展示了ChildAttributes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex)
{
if(myNode.getElementType() == JavaElementType.CONDITIONAL_EXPRESSION && mySettings.ALIGN_MULTILINE_TERNARY_OPERATION)
{
final Alignment usedAlignment = getUsedAlignment(newChildIndex);
if(usedAlignment != null)
{
return new ChildAttributes(null, usedAlignment);
}
else
{
return super.getChildAttributes(newChildIndex);
}
}
else if(myNode.getElementType() == JavaElementType.SWITCH_LABEL_STATEMENT)
{
return new ChildAttributes(Indent.getNormalIndent(), null);
}
else
{
return super.getChildAttributes(newChildIndex);
}
}
示例2: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex)
{
if(isAfter(newChildIndex, new IElementType[]{
JavaDocElementType.DOC_COMMENT,
JavaElementType.MODIFIER_LIST
}))
{
return new ChildAttributes(Indent.getNoneIndent(), null);
}
else
{
if(getSubBlocks().size() == newChildIndex)
{
return new ChildAttributes(Indent.getNoneIndent(), null);
}
else
{
return new ChildAttributes(getCodeBlockInternalIndent(myChildrenIndent), null);
}
}
}
示例3: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
if (hasElementType(myNode, BUCK_CONTAINERS)) {
return new ChildAttributes(Indent.getNormalIndent(), null);
} else if (myNode.getPsi() instanceof PsiFile) {
return new ChildAttributes(Indent.getNoneIndent(), null);
} else {
return new ChildAttributes(null, null);
}
}
示例4: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
IElementType type = myNode.getElementType();
Indent childIndent = calculateChildIndent(type, false);
if (childIndent == null && newChildIndex > 0) {
IElementType calculatedType = getIElementType(newChildIndex);
childIndent = calculateChildIndent(calculatedType, true);
}
return new ChildAttributes(childIndent != null ? childIndent : Indent.getNoneIndent(), null);
}
示例5: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
if (hasElementType(myNode, BUCK_CONTAINERS)) {
return new ChildAttributes(Indent.getNormalIndent(), null);
} else if (myNode.getPsi() instanceof PsiFile) {
return new ChildAttributes(Indent.getNoneIndent(), null);
} else {
return new ChildAttributes(null, null);
}
}
示例6: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex)
{
if(myChildAttributes != null)
{
return myChildAttributes;
}
else
{
Alignment alignment = null;
if(mySubBlocks.size() > newChildIndex)
{
Block block = mySubBlocks.get(newChildIndex);
alignment = block.getAlignment();
}
else if(mySubBlocks.size() == newChildIndex)
{
if(isRParenth(getRightMostBlock()))
{
alignment = getDotAlignment();
}
}
return new ChildAttributes(getIndent(), alignment);
}
}
示例7: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex)
{
if(myUseChildAttributes)
{
return new ChildAttributes(myChildIndent, myChildAlignment);
}
if(isAfter(newChildIndex, new IElementType[]{JavaDocElementType.DOC_COMMENT}))
{
return new ChildAttributes(Indent.getNoneIndent(), myChildAlignment);
}
return super.getChildAttributes(newChildIndex);
}
示例8: createCodeBlockBlock
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
public SyntheticCodeBlock createCodeBlockBlock(final List<Block> localResult, final Indent indent, final int childrenIndent)
{
final SyntheticCodeBlock result = new SyntheticCodeBlock(localResult, null, getSettings(), myJavaSettings, indent, null);
result.setChildAttributes(new ChildAttributes(getCodeBlockInternalIndent(childrenIndent), null));
return result;
}
示例9: createCaseSectionBlock
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
private SyntheticCodeBlock createCaseSectionBlock(final List<Block> localResult, final Alignment childAlignment, final Indent indent, final Wrap childWrap)
{
final SyntheticCodeBlock result = new SyntheticCodeBlock(localResult, childAlignment, getSettings(), myJavaSettings, indent, childWrap)
{
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex)
{
IElementType prevElementType = null;
if(newChildIndex > 0)
{
final Block previousBlock = getSubBlocks().get(newChildIndex - 1);
if(previousBlock instanceof AbstractBlock)
{
prevElementType = ((AbstractBlock) previousBlock).getNode().getElementType();
}
}
if(prevElementType == JavaElementType.BLOCK_STATEMENT || prevElementType == JavaElementType.BREAK_STATEMENT || prevElementType == JavaElementType.RETURN_STATEMENT)
{
return new ChildAttributes(Indent.getNoneIndent(), null);
}
else
{
return super.getChildAttributes(newChildIndex);
}
}
};
result.setChildAttributes(new ChildAttributes(Indent.getNormalIndent(), null));
result.setIsIncomplete(true);
return result;
}
示例10: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
return new ChildAttributes(getChildIndent(), childAlignment);
}
示例11: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
return new ChildAttributes(getIndent(), null);
}
示例12: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
return myInjectedBlock.getChildAttributes(newChildIndex);
}
示例13: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
return new ChildAttributes(Indent.getNormalIndent(), null);
}
示例14: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
return myInjectedBlock.getChildAttributes(newChildIndex);
}
示例15: getChildAttributes
import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex)
{
return new ChildAttributes(null, null);
}