Examples of PredefinedFormat


Examples of com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat

          tzParam = ", com.google.gwt.i18n.client.TimeZone.createTimeZone(" + tzArg + ")";
        }
      }
      if (subformat.startsWith(PREDEF)) {
        // TODO(jat): error checking/logging
        PredefinedFormat predef;
        try {
          predef = PredefinedFormat.valueOf(subformat.substring(PREDEF.length()));
        } catch (IllegalArgumentException e) {
          logger.log(TreeLogger.ERROR, "Unrecognized predefined format '" + subformat + "'");
          return true;
        }
        out.appendStringValuedExpression(
            dtFormatClassName + ".getFormat("
                + PredefinedFormat.class.getCanonicalName() + "."
                + predef.toString() + ").format(" + argName + tzParam + ")");
        return false;
      }
      DateTimePatternGenerator dtpg = new DateTimePatternGenerator(locale);
      try {
        String pattern = dtpg.getBestPattern(subformat);
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat

          tzParam = ", com.google.gwt.i18n.client.TimeZone.createTimeZone(" + tzArg + ")";
        }
      }
      if (subformat.startsWith(PREDEF)) {
        // TODO(jat): error checking/logging
        PredefinedFormat predef;
        try {
          predef = PredefinedFormat.valueOf(subformat.substring(PREDEF.length()));
        } catch (IllegalArgumentException e) {
          logger.log(TreeLogger.ERROR, "Unrecognized predefined format '" + subformat + "'");
          return true;
        }
        out.appendStringValuedExpression(
            dtFormatClassName + ".getFormat("
                + PredefinedFormat.class.getCanonicalName() + "."
                + predef.toString() + ").format(" + argName + tzParam + ")");
        return false;
      }
      DateTimePatternGenerator dtpg = new DateTimePatternGenerator(locale);
      try {
        String pattern = dtpg.getBestPattern(subformat);
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat

      if (subformat == null || subformat.length() == 0) {
        return "localdatetime format requires a skeleton pattern";
      }
      if (subformat.startsWith(PREDEF)) {
        // TODO(jat): error checking/logging
        PredefinedFormat predef;
        try {
          predef = PredefinedFormat.valueOf(subformat.substring(
              PREDEF.length()));
        } catch (IllegalArgumentException e) {
          return e.getMessage();
        }
        out.appendExpression(dtFormatClassName + ".getFormat("
            + PredefinedFormat.class.getName() + "." + predef.toString()
            + ").format(" + argName + ")", true);
        return null;
      }
      DateTimePatternGenerator dtpg = new DateTimePatternGenerator(locale);
      String pattern = dtpg.getBestPattern(subformat);
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat

    Label labelBox2 = new Label("Y una hora:");
    final ListBox horaText = new ListBox();
    horaText.getElement().addClassName("selectorHora");
    labelBox.getElement().addClassName("labelDatePicker");
    labelBox2.getElement().addClassName("labelDatePicker");
    PredefinedFormat format = DateTimeFormat.PredefinedFormat.DATE_LONG;
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(format);
    final DateBox dateBox = new DateBox();
    dateBox.setFormat(new DateBox.DefaultFormat(dateTimeFormat));

    HorizontalPanel horas = new HorizontalPanel();
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat

   
    mainPanel.getElement().addClassName("panelPicker");

    Label labelBox = new Label("Elija una fecha:");
    labelBox.getElement().addClassName("labelDatePicker");
    PredefinedFormat format = DateTimeFormat.PredefinedFormat.DATE_LONG;
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(format);
    DateBox dateBox = new DateBox();
    dateBox.setFormat(new DateBox.DefaultFormat(dateTimeFormat));
    mainPanel.add(labelBox);
    mainPanel.add(dateBox);
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat.PredefinedFormat

  }

  private String getFormattedDate() {
    // If today, only put the time. Else, only put the date.
    // TODO: Figure out what's the best way to display dates like this
    PredefinedFormat format;
    if (dateIsToday(new Date(Long.valueOf(revision.getTimestamp())))) {
      format = PredefinedFormat.TIME_SHORT;
    } else {
      format = PredefinedFormat.DATE_SHORT;
    }
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat.PredefinedFormat

               return new DateLabel(format);
            }

            String predefinedFormat = (String) attributes.get("predefinedFormat");
            if (predefinedFormat != null) {
               PredefinedFormat predef = PredefinedFormat.valueOf(predefinedFormat);
               return new DateLabel(DateTimeFormat.getFormat(predef));
            }

            String customFormat = (String) attributes.get("customFormat");
            if (customFormat != null) {
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.