当前位置: 首页>>代码示例>>Java>>正文


Java ChildAttributes类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:SimpleJavaBlock.java

示例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);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:CodeBlockBlock.java

示例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);
  }
}
 
开发者ID:wangyanxing,项目名称:Buck-IntelliJ-Plugin,代码行数:12,代码来源:BuckBlock.java

示例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);
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:12,代码来源:XQueryFormattingBlock.java

示例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);
  }
}
 
开发者ID:facebook,项目名称:buck,代码行数:11,代码来源:BuckBlock.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:28,代码来源:SyntheticCodeBlock.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:AbstractJavaBlock.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:AbstractJavaBlock.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:34,代码来源:CodeBlockBlock.java

示例10: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
    return new ChildAttributes(getChildIndent(), childAlignment);
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:6,代码来源:ParentBlock.java

示例11: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
    return new ChildAttributes(getIndent(), null);
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:6,代码来源:LeafBlock.java

示例12: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@Override
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
  return myInjectedBlock.getChildAttributes(newChildIndex);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AnotherLanguageBlockWrapper.java

示例13: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
  return new ChildAttributes(Indent.getNormalIndent(), null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ClosureBodyBlock.java

示例14: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
public ChildAttributes getChildAttributes(final int newChildIndex) {
  return myInjectedBlock.getChildAttributes(newChildIndex);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:AnotherLanguageBlockWrapper.java

示例15: getChildAttributes

import com.intellij.formatting.ChildAttributes; //导入依赖的package包/类
@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex)
{
	return new ChildAttributes(null, null);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpDisabledFormattingBlock.java


注:本文中的com.intellij.formatting.ChildAttributes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。