Examples of format()


Examples of com.google.gerrit.prettify.common.PrettyFormatter.format()

    PrettyFormatter f = ClientSideFormatter.FACTORY.get();
    f.setDiffPrefs(dp);
    f.setFileName(s.getA().getPath());
    f.setEditFilter(PrettyFormatter.A);
    f.setEditList(s.getEdits());
    f.format(s.getA());
    return f;
  }

  protected SparseHtmlFile getSparseHtmlFileB(PatchScript s) {
    AccountDiffPreference dp = new AccountDiffPreference(s.getDiffPrefs());
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat.format()

            if ("=".equals(operatorString)) {
              // Date equals not supported by CQL, so we use the DURING operator instead:
              operatorString = "DURING";
              Date date1 = (Date) value;
              Date date2 = new Date(date1.getTime() + 86400000); // total milliseconds in a day
              valueString = format.format(date1) + "/" + format.format(date2);
            } else {
              // Simply format the date:
              valueString = format.format((Date) value);
            }
          }
View Full Code Here

Examples of com.google.gwt.i18n.client.LocalizableResource.Generate.format()

      } else {
        // Since they want all locales, this is guaranteed to be one of them.
        found = true;
      }
      if (found) {
        for (String genClassName : generate.format()) {
          MessageCatalogFormat msgWriter = null;
          MessageCatalogFactory msgCatFactory = null;
          try {
            // TODO(jat): if GWT is ever modified to take a classpath for user
            // code as an option, we would need to use the user classloader here
View Full Code Here

Examples of com.google.gwt.i18n.client.NumberFormat.format()

     * @param ms
     * @return
     */
    static String formatDuration(int ms) {
        NumberFormat fmt = NumberFormat.getFormat("00");
        String seconds = fmt.format((ms / 1000) % 60);
        String minutes = fmt.format((ms / (1000 * 60)) % 60);
        String hours = fmt.format((ms / (1000 * 60 * 60)) % 24);

        String millis = NumberFormat.getFormat("000").format(ms % 1000);

View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat.format()

  }

  public String dateString()
  {
    DateTimeFormat fmt = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_SHORT);
    return fmt.format(date);
  }
 
  @Override
  public String toString()
  {
View Full Code Here

Examples of com.google.gwt.visualization.client.formatters.ArrowFormat.format()

        assertEquals("3.333", dataTable.getFormattedValue(3, 1));

        Options options = Options.create();
        options.setBase(6);
        ArrowFormat formatter = ArrowFormat.create(options);
        formatter.format(dataTable, 1);
        // TODO(zundel): I commented out this assert - it is breaking the tests
        //   and is undocumented so I don't know how to fix it.
        // assertEquals("google-visualization-table-arrow-dr",
        // dataTable.getProperty(1, 1, "__td-class"));
      }
View Full Code Here

Examples of com.google.gwt.visualization.client.formatters.BarFormat.format()

        assertEquals("3.333", dataTable.getFormattedValue(3, 1));

        Options options = Options.create();
        options.setBase(6);
        BarFormat formatter = BarFormat.create(options);
        formatter.format(dataTable, 1);
      }
    });
  }

  @Override
View Full Code Here

Examples of com.google.gwt.visualization.client.formatters.ColorFormat.format()

        dataTable.setFormattedValue(3, 1, "3.333");
        assertEquals("3.333", dataTable.getFormattedValue(3, 1));

        ColorFormat formatter = ColorFormat.create();
        formatter.addGradientRange(4, 6, "#00FF00", "#FF00FF", "#FFFFFF");
        formatter.format(dataTable, 1);
        // TODO(zundel): Unit tests are curently broken with this assertion.
        //   dataTable.getProperty() returns null.
        // assertEquals("color:#00FF00;background-color:#ff80ff;",
        //    dataTable.getProperty(1, 1, "__td-style"));
     
View Full Code Here

Examples of com.google.gwt.visualization.client.formatters.DateFormat.format()

       
        options = Options.create();
        options.setPattern(FormatType.LONG);
        options.setTimeZone(2);
        DateFormat formatter = DateFormat.create(options);
        formatter.format(dataTable, 1);
        formatter.format(dataTable, 2);
        assertEquals("March 11, 2005", dataTable.getFormattedValue(0, 1));
        assertEquals("February 16, 2009 1:00:00 PM UTC+2",
                     dataTable.getFormattedValue(0, 2));
        // Verify that using a formatter on a column overrides all previously set
View Full Code Here

Examples of com.google.gwt.visualization.client.formatters.NumberFormat.format()

        options.setNegativeParens(false);
        options.setPrefix("$");
        options.setSuffix("%");

        NumberFormat formatter = NumberFormat.create(options);
        formatter.format(dataTable, 0);
        assertEquals("$-3_142%", dataTable.getFormattedValue(0, 0));
        // TODO(zundel): Unit tests are curently broken with this assertion.
        // dataTable.getProperty() returns null.
        // assertEquals("color:red;",
        // dataTable.getProperty(0, 0, "__td-style"));
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.