Java 类com.intellij.psi.formatter.WrappingUtil 实例源码

项目:intellij-haxe    文件:HaxeWrappingProcessor.java   
private static Wrap createChildWrap(ASTNode child, int parentWrap, boolean newLineAfterLBrace, boolean newLineBeforeRBrace) {
  IElementType childType = child.getElementType();
  if (childType != PLPAREN && childType != PRPAREN) {
    if (FormatterUtil.isPrecededBy(child, PLBRACK)) {
      if (newLineAfterLBrace) {
        return Wrap.createChildWrap(Wrap.createWrap(parentWrap, true), WrapType.ALWAYS, true);
      }
      else {
        return Wrap.createWrap(WrapType.NONE, true);
      }
    }
    return Wrap.createWrap(WrappingUtil.getWrapType(parentWrap), true);
  }
  if (childType == PRBRACK && newLineBeforeRBrace) {
    return Wrap.createWrap(WrapType.ALWAYS, true);
  }
  return Wrap.createWrap(WrapType.NONE, true);
}
项目:consulo-haxe    文件:HaxeWrappingProcessor.java   
private static Wrap createChildWrap(ASTNode child, int parentWrap, boolean newLineAfterLBrace, boolean newLineBeforeRBrace) {
  IElementType childType = child.getElementType();
  if (childType != PLPAREN && childType != PRPAREN) {
    if (FormatterUtil.isPrecededBy(child, PLBRACK)) {
      if (newLineAfterLBrace) {
        return Wrap.createChildWrap(Wrap.createWrap(parentWrap, true), WrapType.ALWAYS, true);
      }
      else {
        return Wrap.createWrap(WrapType.NONE, true);
      }
    }
    return Wrap.createWrap(WrappingUtil.getWrapType(parentWrap), true);
  }
  if (childType == PRBRACK && newLineBeforeRBrace) {
    return Wrap.createWrap(WrapType.ALWAYS, true);
  }
  return Wrap.createWrap(WrapType.NONE, true);
}