Package com.google.gwt.i18n.client

Examples of com.google.gwt.i18n.client.DateTimeFormat$PatternPart


   * @param params
   * @return
   */
  protected String append(Object... params){
    NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
    String srcParam = "";
    for(Object param : params){
      if(param != null){
        if(param instanceof String){
          srcParam += param;
        }
        if(param instanceof Double){
          srcParam += numberFormat.format(((Double) param).doubleValue());
        }
        if(param instanceof Float){
          srcParam += numberFormat.format(((Float) param).floatValue());
        }
        if(param instanceof Date){
          srcParam += dateTimeFormat.format((Date)param);
        }
      } else{
        srcParam += "null";
      }
      srcParam += Constants.SEPRATE;
View Full Code Here


   
    bus.addHandler(ExportFicheStEvent.TYPE, new ExportFicheStHandler() {
      @SuppressWarnings("unchecked")
      @Override
      public void onExport(ExportFicheStEvent event) {
        DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
        NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
        // bus.fireEvent(new DeductionGridUpdateEvent(centerPanel.getDeductionDtoList()));
        // Information Generals
        String chainter = navigation.getContext().getCurrentChantier().getNom();
        ComponentManager componentManager = ComponentManager.get();
        TextField<String> societte = (TextField<String>) componentManager.get("INFORMATION_PANEL_SOCIETE_ID");
        TextField<String> lot = (TextField<String>) componentManager.get("INFORMATION_PANEL_LOT_ID");
        ComboBox<LotTypeDto> lotType = (ComboBox<LotTypeDto>) componentManager.get("INFORMATION_PANEL_LOT_TYPE_ID");
        TextField<String> sitravaux = (TextField<String>) componentManager.get("INFORMATION_PANEL_SITRAVAUX_ID");
        NumberField montant = (NumberField) componentManager.get("INFORMATION_PANEL_MONTANT_ID");
       
        // Conditions Particilifers
        ComboBox<SimpleDto> simpleDto = (ComboBox<SimpleDto>) componentManager.get("INFORMATION_PANEL_PAYMENT_ID");
        NumberField rg = (NumberField) componentManager.get("INFORMATIONAL_PANEL_RG_ID");
        ComboBox<SimpleDto> decennalenecessaire = (ComboBox<SimpleDto>) componentManager.get("INFORMATIONAL_PANEL_DECENNALENECESSAIRE_ID");
        ComboBox<SimpleDto> demandedagrement = (ComboBox<SimpleDto>) componentManager.get("INFORMATIONAL_PANEL_DEMANDEDAGREMENT_ID");
        ComboBox<SimpleDto> dgdpresente = (ComboBox<SimpleDto>) componentManager.get("INFORMATIONAL_PANEL_DGDPRESENTE_ID");
        DateField dgdpresentedate = (DateField) componentManager.get("INFORMATIONAL_PANEL_DGDPRESENTEDATE_ID");
        // Presation
        NumberField pilotage = (NumberField) componentManager.get("INFORMATIONAL_PANEL_PILOTAGE_ID");
        NumberField assurances = (NumberField) componentManager.get("INFORMATIONAL_PANEL_ASSURANCES_ID");
        NumberField prorata = (NumberField) componentManager.get("INFORMATIONAL_PANEL_PRORATE_ID");
        NumberField canto = (NumberField) componentManager.get("INFORMATIONAL_PANEL_CANTO_ID");
        NumberField badge = (NumberField) componentManager.get("INFORMATIONAL_PANEL_BADGE_ID");
        NumberField grue = (NumberField) componentManager.get("INFORMATIONAL_PANEL_GRUE_ID");
        NumberField lift = (NumberField) componentManager.get("INFORMATIONAL_PANEL_LIFT_ID");
        NumberField benne = (NumberField) componentManager.get("INFORMATIONAL_PANEL_BENNE_ID");
        NumberField netoyage = (NumberField) componentManager.get("INFORMATIONAL_PANEL_NETOYAGE_ID");
        // Information Commemlaires
        LabelField conducteur = (LabelField) componentManager.get("INFORMATIONAL_PANEL_CONDUCTEUR_ID");
        DateField dateOfMarket = (DateField) componentManager.get("INFORMATIONAL_PANEL_DATEOFMARKET_ID");
       
        List<NameValuePair> values = new ArrayList<NameValuePair>();
       
        // Add General Information
        String lotype = lotType.getValue() != null ? lotType.getValue().getName() : "";
        String generaleInformation = chainter + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE + societte.getValue() + Constants.SEPRATE
            + lotype + Constants.SEPRATE + montant.getValue();
        values.add(new NameValuePair("generaleInformation", generaleInformation));
       
        // Add Conditions Particilifers
        String dgdpresentedate_ = dgdpresentedate.getValue() != null ? dateTimeFormat.format(dgdpresentedate.getValue()) : "null";
        String conditionsparticulieres = simpleDto.getValue().getLabel() + Constants.SEPRATE + rg.getValue() + Constants.SEPRATE + decennalenecessaire.getValue().getLabel()
            + Constants.SEPRATE + demandedagrement.getValue().getLabel() + Constants.SEPRATE + dgdpresente.getValue().getLabel() + Constants.SEPRATE + dgdpresentedate_;
       
        values.add(new NameValuePair("conditionsparticulieres", conditionsparticulieres));
        // Add Prestations
        String prestations = pilotage.getValue() + Constants.SEPRATE + assurances.getValue() + Constants.SEPRATE + prorata.getValue() + Constants.SEPRATE + canto.getValue()
            + Constants.SEPRATE + badge.getValue() + Constants.SEPRATE + grue.getValue() + Constants.SEPRATE + lift.getValue() + Constants.SEPRATE + benne.getValue() + Constants.SEPRATE
            + netoyage.getValue();
        values.add(new NameValuePair("prestations", prestations));
       
        // Add Informationa Complementaires
        String date_of_market = "null";
        if (dateOfMarket.getValue() != null) {
          date_of_market = dateTimeFormat.format(dateOfMarket.getValue());
        }
        String informationscomplementaires = conducteur.getValue() + Constants.SEPRATE + date_of_market;
        values.add(new NameValuePair("informationscomplementaires", informationscomplementaires));
       
        List<CautionFournieDto> listCautionFournieDto = centerPanel.getCautionFournieDtoList();
        String cautionFournies = "";
        String caution_date = "";
        for (CautionFournieDto cautionFournieDto : listCautionFournieDto) {
          caution_date = cautionFournieDto.getDate() != null ? dateTimeFormat.format(cautionFournieDto.getDate()) : "";
          cautionFournies += caution_date + Constants.SEPRATE + numberFormat.format(cautionFournieDto.getAmount()) + Constants.SEPRATE;
        }
        values.add(new NameValuePair("cautionFournies", cautionFournies));
       
        // Add Gestion
View Full Code Here

    List<DeductionDto> listDeduction = lisDeduction;
    DeductionDto deductionDto = null;
    String deductions = "";
    double amount = 0.0;
    // Grid 1
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
    NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
    for (int j = 0; j < listDeduction.size(); j++) {
      deductionDto = listDeduction.get(j);
      String deductionDate = deductionDto.getDate() != null ? dateTimeFormat.format(deductionDto.getDate()) : "";
      deductions += deductionDate + Constants.SEPRATE + numberFormat.format(deductionDto.getCanto()) + Constants.SEPRATE + numberFormat.format(deductionDto.getBadge()) + Constants.SEPRATE
          + numberFormat.format(deductionDto.getGrue()) + Constants.SEPRATE + numberFormat.format(deductionDto.getLift()) + Constants.SEPRATE + numberFormat.format(deductionDto.getBenne())
          + Constants.SEPRATE + numberFormat.format(deductionDto.getNettoyage()) + Constants.SEPRATE + numberFormat.format(deductionDto.getAutres()) + Constants.SEPRATE
          + numberFormat.format(deductionDto.getProrata()) + Constants.SEPRATE + numberFormat.format(deductionDto.getRefacturations()) + Constants.SEPRATE;
    }
View Full Code Here

    List<ProgressDto> list = listProcess;
    ProgressDto progressDto = null;
    String process = "";
    String totalsituation = "";
    // Grid 1
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
    NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
    String process_date = "";
   
    for (int j = 0; j < list.size(); j++) {
      progressDto = list.get(j);
      process_date = progressDto.getDate() != null ? dateTimeFormat.format(progressDto.getDate()) : "";
      process += (j + 1) + Constants.SEPRATE + progressDto.getLabel() + Constants.SEPRATE + process_date + Constants.SEPRATE + numberFormat.format(progressDto.getCumule()) + Constants.SEPRATE
          + numberFormat.format(progressDto.getMois()) + Constants.SEPRATE + numberFormat.format(progressDto.getCumule2()) + Constants.SEPRATE + numberFormat.format(progressDto.getMois2())
          + Constants.SEPRATE;
    }
    if (process != null && process.length() > 0) {
View Full Code Here

     *            the date to format
     *
     * @return given Date as String, for communicating to server-side
     */
    public static String formatClientSideDate(Date date) {
        DateTimeFormat dateformat_date = DateTimeFormat
                .getFormat(CLIENT_DATE_FORMAT);
        return dateformat_date.format(date);
    }
View Full Code Here

     * @param date
     *            the date to format
     * @return given Date as String, for communicating to server-side
     */
    public static String formatClientSideTime(Date date) {
        DateTimeFormat dateformat_date = DateTimeFormat
                .getFormat(CLIENT_TIME_FORMAT);
        return dateformat_date.format(date);
    }
View Full Code Here

     * @return
     * @throws ParseException
     */
    public Date getActionStartDate(String actionKey) throws ParseException {
        String dateStr = actionMap.get(actionKey + "_s");
        DateTimeFormat formatter = DateTimeFormat
                .getFormat(VCalendarAction.ACTION_DATE_FORMAT_PATTERN);
        return formatter.parse(dateStr);
    }
View Full Code Here

     * @return
     * @throws ParseException
     */
    public Date getActionEndDate(String actionKey) throws ParseException {
        String dateStr = actionMap.get(actionKey + "_e");
        DateTimeFormat formatter = DateTimeFormat
                .getFormat(VCalendarAction.ACTION_DATE_FORMAT_PATTERN);
        return formatter.parse(dateStr);
    }
View Full Code Here

        if (value.length() < 1) { // if it's blank and textfield didn't flag it then
            // it's valid
            return true;
        }

        DateTimeFormat format = getPropertyEditor().getFormat();

        Date date = null;

        try {
            date = getPropertyEditor().convertStringValue(value);
        } catch (Exception e) {

        }

        if (date == null) {
            String error = null;
            if (getMessages().getInvalidText() != null) {
                error = Format.substitute(getMessages().getInvalidText(), 0);
            } else {
                error = GXT.MESSAGES.dateField_invalidText(value, format.getPattern().toUpperCase());
            }
            markInvalid(error);
            return false;
        }

        if (minValue != null && date.before(minValue)) {
            String error = null;
            if (getMessages().getMinText() != null) {
                error = Format.substitute(getMessages().getMinText(), format.format(minValue));
            } else {
                error = GXT.MESSAGES.dateField_minText(format.format(minValue));
            }
            markInvalid(error);
            return false;
        }
        if (maxValue != null && date.after(maxValue)) {
            String error = null;
            if (getMessages().getMaxText() != null) {
                error = Format.substitute(getMessages().getMaxText(), format.format(maxValue));
            } else {
                error = GXT.MESSAGES.dateField_maxText(format.format(maxValue));
            }
            markInvalid(error);
            return false;
        }
View Full Code Here

    // TODO GXT 2

    public CalendarPanel(final String callback, String activeDate) {
        setLayout(new FlowLayout());
        final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("dd/MM/yyyy");
        final DateMenu menu = new DateMenu();
        if(activeDate !=null && !"".equals(activeDate.trim()))
        menu.getDatePicker().setValue(dateTimeFormat.parse(activeDate),true);
        menu.addListener(new EventType(Event.ONKEYDOWN+Event.ONKEYUP), new Listener<ComponentEvent>() {
            public void handleEvent(ComponentEvent ce){
                nativeCallback(callback, dateTimeFormat.format(menu.getDate()));
            }
        });

        add(menu.getDatePicker());
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.client.DateTimeFormat$PatternPart

Copyright © 2018 www.massapicom. 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.