Examples of BidiGlobalDir


Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

    apiCallScope.enter();
    try {
      // Seed the scoped parameters.
      apiCallScope.seed(SoyJavaSrcOptions.class, javaSrcOptions);
      BidiGlobalDir bidiGlobalDir =
          SoyBidiUtils.decodeBidiGlobalDir(javaSrcOptions.getBidiGlobalDir());
      ApiCallScopeUtils.seedSharedParams(apiCallScope, msgBundle, bidiGlobalDir);

      // Do the code generation.
      optimizeBidiCodeGenVisitorProvider.get().exec(soyTree);
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'left'" : "'right'", Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? 'left' : 'right'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JavaExpr computeForJavaSrc(List<JavaExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return toStringJavaExpr(JavaCodeUtils.genNewStringData(
          (bidiGlobalDir.getStaticValue() < 0) ? "\"left\"" : "\"right\""));
    }

    String bidiFunctionName = SoyBidiUtils.class.getName() + ".getBidiFormatter(" +
        bidiGlobalDir.getCodeSnippet() + ").endEdge";
    return toStringJavaExpr(JavaCodeUtils.genNewStringData(
        JavaCodeUtils.genFunctionCall(bidiFunctionName)));
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    return new JsExpr(
        bidiGlobalDirProvider.get().getCodeSnippet(),
        bidiGlobalDir.isStaticValue() ? Integer.MAX_VALUE : Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'\\u200F'" /*RLM*/ : "'\\u200E'" /*LRM*/,
          Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? '\\u200F' : '\\u200E'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JavaExpr computeForJavaSrc(List<JavaExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return toStringJavaExpr(JavaCodeUtils.genNewStringData(
            (bidiGlobalDir.getStaticValue() < 0) ? "\"\\u200F\"" /*RLM*/ : "\"\\u200E\"" /*LRM*/));
    }

    String bidiFunctionName = SoyBidiUtils.class.getName() + ".getBidiFormatter(" +
        bidiGlobalDir.getCodeSnippet() + ").mark";
    return toStringJavaExpr(JavaCodeUtils.genNewStringData(
        JavaCodeUtils.genFunctionCall(bidiFunctionName)));
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'right'" : "'left'", Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? 'right' : 'left'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

  }


  @Override public JavaExpr computeForJavaSrc(List<JavaExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return toStringJavaExpr(JavaCodeUtils.genNewStringData(
          (bidiGlobalDir.getStaticValue() < 0) ? "\"right\"" : "\"left\""));
    }

    String bidiFunctionName = SoyBidiUtils.class.getName() + ".getBidiFormatter(" +
        bidiGlobalDir.getCodeSnippet() + ").startEdge";
    return toStringJavaExpr(JavaCodeUtils.genNewStringData(
        JavaCodeUtils.genFunctionCall(bidiFunctionName)));
  }
View Full Code Here

Examples of com.google.template.soy.internal.i18n.BidiGlobalDir

    apiCallScope.enter();
    try {
      // Seed the scoped parameters.
      apiCallScope.seed(SoyJsSrcOptions.class, jsSrcOptions);
      apiCallScope.seed(Key.get(Boolean.class, IsUsingIjData.class), isUsingIjData);
      BidiGlobalDir bidiGlobalDir = SoyBidiUtils.decodeBidiGlobalDirFromOptions(
          jsSrcOptions.getBidiGlobalDir(),
          jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir());
      ApiCallScopeUtils.seedSharedParams(apiCallScope, msgBundle, bidiGlobalDir);

      // Replace MsgNodes.
      if (jsSrcOptions.shouldGenerateGoogMsgDefs()) {
        replaceMsgsWithGoogMsgsVisitorProvider.get().exec(soyTree);
        (new MoveGoogMsgNodesEarlierVisitor()).exec(soyTree);
        Preconditions.checkState(
            bidiGlobalDir != null,
            "If enabling shouldGenerateGoogMsgDefs, must also set bidi global directionality.");
      } else {
        Preconditions.checkState(
            bidiGlobalDir == null || bidiGlobalDir.isStaticValue(),
            "If using bidiGlobalIsRtlCodeSnippet, must also enable shouldGenerateGoogMsgDefs.");
        try {
          (new InsertMsgsVisitor(msgBundle, false)).exec(soyTree);
        } catch (EncounteredPlrselMsgException e) {
          throw SoySyntaxExceptionUtils.createWithNode(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.