Package com.extjs.gxt.ui.client.widget.form

Examples of com.extjs.gxt.ui.client.widget.form.NumberField


  public InputSlider() {
    if (GXT.isAriaEnabled()) {
      inputWidth = 9;
    } else {
      input = new NumberField() {
        @Override
        protected void onFocus(ComponentEvent be) {
          FocusFrame.get().unframe();
          super.onFocus(be);
          setValue(InputSlider.this.getValue());
View Full Code Here


  public void setRangeItems(List<RangeItem> rangeItems) {
    this.rangeItems = rangeItems;
    removeAll();
    AbstractImagePrototype icon = null;
    for (RangeItem item : rangeItems) {
      NumberField field = new NumberField() {
        @Override
        protected void onKeyUp(FieldEvent fe) {
          super.onKeyUp(fe);
          RangeMenu.this.onFilterKeyUp(fe);
        }
      };
      field.setEmptyText(filter.getMessages().getEmptyText());
      field.setWidth(filter.getWidth());

      switch (item) {
        case LESSTHAN:
          icon = GXT.IMAGES.grid_filter_lessThan();
          lt = field;
View Full Code Here

        List<AnonymousDto> models = new ArrayList<AnonymousDto>();
        AnonymousDto model = null;

        String[] column1s = { messages.nombre(), messages.amount() }
       
        NumberField canto = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_CANTO_ID");
        NumberField badge = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_BADGE_ID");       
        NumberField grue = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_GRUE_ID");
        NumberField lift = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_LIFT_ID");
        NumberField benne = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_BENNE_ID");     
        NumberField netoyage = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_NETOYAGE_ID");
       
        double cantoValue = 0.0;
        double badgeValue = 0.0;
        double grueValue = 0.0;
        double liftValue = 0.0;
        double benneValue = 0.0;
        double netoyageValue = 0.0;
        if(canto!=null && canto.getValue()!=null)
          cantoValue = canto.getValue().doubleValue();
        if(badge!=null && badge.getValue()!=null)
          badgeValue = badge.getValue().doubleValue();
        if(grue!=null && grue.getValue()!=null)
          grueValue = grue.getValue().doubleValue();
        if(lift!=null && lift.getValue()!=null)
          liftValue = lift.getValue().doubleValue();
        if(benne!=null && benne.getValue()!=null)
          benneValue = benne.getValue().doubleValue();
        if(netoyage!=null && netoyage.getValue()!=null)
          netoyageValue = netoyage.getValue().doubleValue();
        double[] column2s = { cantoQuantity, (cantoQuantity * cantoValue) };
        double[] column3s = { badgeQuantity, (badgeQuantity * badgeValue) };
        double[] column4s = { grueQuantity, (grueQuantity * grueValue) };
        double[] column5s = { liftQuantity, (liftQuantity * liftValue) };
        double[] column6s = { benneQuantity, (benneQuantity * benneValue) };
View Full Code Here

    String chainter = navigation.getContext().getCurrentChantier().getNom();
    TextField<String> societte = (TextField<String>)ComponentManager.get().get("INFORMATION_PANEL_SOCIETE_ID");
    TextField<String> lot = (TextField<String>)ComponentManager.get().get("INFORMATION_PANEL_LOT_ID");
    ComboBox<LotTypeDto> lotType =  (ComboBox<LotTypeDto>)ComponentManager.get().get("INFORMATION_PANEL_LOT_TYPE_ID");
    TextField<String> sitravaux = (TextField<String>)ComponentManager.get().get("INFORMATION_PANEL_SITRAVAUX_ID");
    NumberField montant = (NumberField)ComponentManager.get().get("INFORMATION_PANEL_MONTANT_ID");
   
    List<NameValuePair> params = new ArrayList<NameValuePair>()
    List<ProgressDto> list = progressGrid.getStore().getModels();   
   
    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 = "";
    //String [] arrMois = mois.split(Constants.SEPRATE);
    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;
    }

    String generaleInformation = chainter + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE +
    societte.getValue() + Constants.SEPRATE + lotType.getValue().getName() + Constants.SEPRATE + montant.getValue();
    params.add(new NameValuePair("generaleInformation", generaleInformation));
   
    params.add(new NameValuePair(ConstantClient.PROCESSDTO_ID_STR, process));
   
    if((cumule != null && cumule.length() > 0) && (mois !=null && mois.length() > 0)){
View Full Code Here

    layoutContainer_4.setLayout(fl_layoutContainer_4);

    initPaymentData();
    layoutContainer_4.add(payment, new FormData(ANCHOR_SPEC_1));

    NumberField rg = createNumberField(messages.rg());
    rg.setName(FicheStDto.RG);
    rg.setMinValue(0);
    rg.setMaxValue(100);
    rg.setId("INFORMATIONAL_PANEL_RG_ID");
    layoutContainer_4.add(rg, new FormData("70%"));

    initDecennaleNecessaireData();
    layoutContainer_4.add(decennaleNecessaire, new FormData(ANCHOR_SPEC_1));

    initDemandeDagrementData();
    layoutContainer_4.add(demandeDagrement, new FormData(ANCHOR_SPEC_1));
    conditionFieldSet.add(layoutContainer_4);

    HTML newLine = new HTML("<br>", true);
    conditionFieldSet.add(newLine);

    LayoutContainer layoutContainer_6 = new LayoutContainer();
    TableLayout tl3 = new TableLayout(3);
    tl3.setWidth("90%");
    layoutContainer_6.setLayout(tl3);

    LayoutContainer layoutContainer_5 = new LayoutContainer();
    FormLayout fl_layoutContainer_5 = new FormLayout();
    fl_layoutContainer_5.setLabelWidth(110);
    layoutContainer_5.setLayout(fl_layoutContainer_5);

    initDgdPresenteData();
    layoutContainer_5.add(dgdPresente, new FormData("65%"));
    dgdPresente.setWidth(50);
    layoutContainer_6.add(layoutContainer_5);

    HTML space4 = new HTML(SPACES_3);
    layoutContainer_6.add(space4);

    LayoutContainer layoutContainer_7 = new LayoutContainer();
    FormLayout fl_layoutContainer_7 = new FormLayout();
    fl_layoutContainer_7.setLabelWidth(50);
    layoutContainer_7.setLayout(fl_layoutContainer_7);
    DateField dgdPresenteDate = new DateField();
    dgdPresenteDate.setId("INFORMATIONAL_PANEL_DGDPRESENTEDATE_ID");
    dgdPresenteDate.setName(FicheStDto.DATEDGDPRESENTE);
    dgdPresenteDate.setWidth(100);
    layoutContainer_7.add(dgdPresenteDate, new FormData("90%"));
    dgdPresenteDate.setFieldLabel(messages.date());
    layoutContainer_6.add(layoutContainer_7);
    conditionFieldSet.add(layoutContainer_6);
    conditionFieldSet.setStyleAttribute("height", HEIGHT_1);
    conditionFieldSet.setHeading(messages.conditions());
    informationFieldSet.add(conditionFieldSet, layoutData);

    HTML space0 = new HTML(SPACES_3);
    TableData tableData2 = new TableData();
    tableData2.setWidth(COLUMNS_WIDTH[1]);
    informationFieldSet.add(space0, tableData2);

    FieldSet prestationsFieldSet = new FieldSet();
    if(RootPanel.get().getOffsetWidth() <= 1900){//Constants.MIN_WIDTH){
      panel3 -= 50;
    }
    prestationsFieldSet.setWidth(panel2);

    prestationsFieldSet.setStyleAttribute("height", HEIGHT_1);
    FormLayout fl_prestationsFieldSet = new FormLayout();
    fl_prestationsFieldSet.setLabelWidth(120);
    prestationsFieldSet.setLayout(fl_prestationsFieldSet);

    NumberField pilotage = addNumberField(
        prestationsFieldSet, messages.pilotage(), FicheStDto.PRESTAPILOTAGE, "INFORMATIONAL_PANEL_PILOTAGE_ID", true);

    NumberField assurances = addNumberField(
        prestationsFieldSet, messages.assurances(), FicheStDto.PRESTAASSURANCES,
        "INFORMATIONAL_PANEL_ASSURANCES_ID", true);

    prorata = addNumberField(
        prestationsFieldSet, messages.prorata(), FicheStDto.PRESTA_PRORATA, "INFORMATIONAL_PANEL_PRORATE_ID", true);
    prorata.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(6, prorata.getValue().doubleValue()));
      }
    });

    canto = addNumberField(prestationsFieldSet, messages.canto(), FicheStDto.PRESTACANTO, "INFORMATIONAL_PANEL_CANTO_ID", false);
    canto.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(0, canto.getValue().doubleValue()));
      }
    });

    badge = addNumberField(prestationsFieldSet, messages.badge(), FicheStDto.PRESTABADGE, "INFORMATIONAL_PANEL_BADGE_ID", false);
    badge.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(1, badge.getValue().doubleValue()));
      }
    });

    grue = addNumberField(prestationsFieldSet, messages.grue(), FicheStDto.PRESTAGRUE, "INFORMATIONAL_PANEL_GRUE_ID", false);
    grue.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(2, grue.getValue().doubleValue()));
      }
    });

    lift = addNumberField(prestationsFieldSet, messages.lift(), FicheStDto.PRESTALIFT, "INFORMATIONAL_PANEL_LIFT_ID", false);
    lift.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(3, lift.getValue().doubleValue()));
      }
    });

    benne = addNumberField(prestationsFieldSet, messages.benne(), FicheStDto.PRESTABENNE, "INFORMATIONAL_PANEL_BENNE_ID", false);
    benne.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(4, benne.getValue().doubleValue()));
      }
    });

    netoyage = addNumberField(
        prestationsFieldSet, messages.nettoyage(), FicheStDto.PRESTANETTOYAGE, "INFORMATIONAL_PANEL_NETOYAGE_ID", false);
    netoyage.addListener(Events.KeyUp, new KeyListener() {
      @Override
      public void handleEvent(ComponentEvent e) {
        bus.fireEvent(new PrestationEvent(5, netoyage.getValue().doubleValue()));
      }
    });

    TableData tableData6 = new TableData();
    tableData6.setVerticalAlign(VerticalAlignment.MIDDLE);
    tableData6.setWidth(COLUMNS_WIDTH[2]);
    prestationsFieldSet.setHeading(messages.prestations());
    informationFieldSet.add(prestationsFieldSet, tableData6);

    HTML space1 = new HTML(SPACES_3);
    TableData tableData7 = new TableData();
    tableData7.setWidth(COLUMNS_WIDTH[3]);
    informationFieldSet.add(space1, tableData7);

    FieldSet informationComplementaries = new FieldSet();
    informationComplementaries.setWidth(panel3);
    TableLayout tl_informationComplementaries = new TableLayout(1);
    tl_informationComplementaries.setWidth("96%");
    informationComplementaries.setLayout(tl_informationComplementaries);

    Map<Integer,String> mapConducteurdetravaux = navigation.getContext().getMapConducteurdetravaux();
    String conducteur_ = mapConducteurdetravaux.get(ficheStId_) !=null ? mapConducteurdetravaux.get(ficheStId_) : "";
    final LabelField conducteur = new LabelField(conducteur_);
    bus.addHandler(ConducteurEvent.TYPE, new ConducteurHandler() {   
      @Override
      public void onChangeConducteur(ConducteurEvent conducteurEvent) {
        conducteur.setValue(conducteurEvent.getConducter());
      }
    });
    conducteur.setId("INFORMATIONAL_PANEL_CONDUCTEUR_ID");
    conducteur.setFieldLabel(messages.conducteur() + ":");

    LayoutContainer layoutContainer_8 = new LayoutContainer();
    FormLayout fl_layoutContainer_8 = new FormLayout();
    fl_layoutContainer_8.setLabelWidth(165);
    layoutContainer_8.setLayout(fl_layoutContainer_8);
    layoutContainer_8.add(conducteur, new FormData("100%"));

    DateField dateOfMarket = new DateField();
    dateOfMarket.setName(FicheStDto.DATEMARCHEBASE);
    dateOfMarket.setId("INFORMATIONAL_PANEL_DATEOFMARKET_ID");
    layoutContainer_8.add(dateOfMarket, new FormData("50%"));
    dateOfMarket.setFieldLabel(messages.dateOfMarket());
    TableData layoutData5 = new TableData();
    layoutData5.setWidth("50%");
    informationComplementaries.add(layoutContainer_8, layoutData5);

    LayoutContainer layoutContainer_3 = new LayoutContainer();
    layoutContainer_3.setHeight("315px");
    layoutContainer_3.setLayout(new RowLayout(Orientation.VERTICAL));
    layoutContainer_3.setStyleAttribute("height", HEIGHT_1);
    layoutContainer_3.add(informationComplementaries);
    informationComplementaries.setHeight("85px");
    TableData layoutData3 = new TableData();
    layoutData3.setVerticalAlign(VerticalAlignment.MIDDLE);
    layoutData3.setWidth(COLUMNS_WIDTH[4]);

    FieldSet cautionFieldset = new FieldSet();
    cautionFieldset.setLayout(new RowLayout(Orientation.VERTICAL));

    layoutContainer_3.add(cautionFieldset);
    cautionFieldset.setHeight("205px");
    cautionFieldset.setHeading(messages.cautionFournie());
    informationFieldSet.add(layoutContainer_3, layoutData3);
    informationComplementaries.setHeading(messages.informationComplementaries());
   
    lc1.setId("informationFieldSet");
    prestationsFieldSet.setId("prestationsFieldSet");
    conditionFieldSet.setId("conditionFieldSet");
    informationComplementaries.setId("informationComplementaries");

    formPanel.add(new HTML("<br>"));
    formPanel.add(informationFieldSet);

    int[] columnWidth5 = { DELETE_BUTTON_WIDTH, 150, 160 };
    GridCellRenderer<AbstractDto> dateRenderer = createDateRendererWithPermision(columnWidth5[1] - PADDING_2,role,user);//25);
    GridCellRenderer<AbstractDto> numberRenderer = createNumberRendererWithPermission(columnWidth5[2] - PADDING,role,user);//25);

    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

    ColumnConfig column1 = new ColumnConfig();
    column1.setId(CautionFournieDto.ID);
    column1.setAlignment(HorizontalAlignment.CENTER);
    column1.setMenuDisabled(true);
    column1.setHeader(messages.del());
    column1.setWidth(columnWidth5[0]);
    column1.setRenderer(createDeleteButtonRenderer());
    configs.add(column1);

    ColumnConfig column2 = new ColumnConfig();
    column2.setId(CautionFournieDto.DATE);
    column2.setMenuDisabled(true);
    column2.setHeader(messages.date());
    column2.setWidth(columnWidth5[1]);
    column2.setDateTimeFormat(DateTimeFormat.getFormat(DATE_FORMAT));
    configs.add(column2);
    column2.setRenderer(dateRenderer);

    ColumnConfig column3 = new ColumnConfig();
    column3.setId(CautionFournieDto.AMOUNT);
    column3.setAlignment(HorizontalAlignment.RIGHT);
    column3.setMenuDisabled(true);
    column3.setHeader(messages.amount());
    column3.setWidth(columnWidth5[2]);
    column3.setNumberFormat(NumberFormat.getFormat(NUMBER_FORMAT));
    NumberField numberField = createNumberField(null);
    column3.setEditor(new CellEditor(numberField));
    column3.setRenderer(numberRenderer);
    configs.add(column3);

    ColumnModel cm = new ColumnModel(configs);
View Full Code Here

    bindModel(ficheStDto);
  }

  private static NumberField addNumberField(FieldSet prestationsFieldSet, String fieldLabel, String fieldName,
      String fieldId, boolean percentage) {
    NumberField numberField = createNumberField(fieldLabel);
    numberField.setName(fieldName);
    numberField.setId(fieldId);
    numberField.setWidth(70);
    prestationsFieldSet.add(numberField, new FormData(ANCHOR_SPEC_1));
    if( percentage ) {
      numberField.setMinValue(0);
      numberField.setMaxValue(100);
    }
    return numberField;
  }
View Full Code Here

    date.setName(DeductionDto.DATE);
   
    date.setFieldLabel(messages.date());
    formPanel.add(date, new FormData(ANCHOR_SPEC));

    NumberField canto = createIntegerField(messages.canto());
    canto.setName(DeductionDto.CANTO);
    formPanel.add(canto, new FormData(ANCHOR_SPEC));

    NumberField badge = createIntegerField(messages.badge());
    badge.setName(DeductionDto.BADGE);
    formPanel.add(badge, new FormData(ANCHOR_SPEC));

    NumberField grue = createIntegerField(messages.grue());
    grue.setName(DeductionDto.GRUE);
    formPanel.add(grue, new FormData(ANCHOR_SPEC));

    NumberField lift = createIntegerField(messages.lift());
    lift.setName(DeductionDto.LIFT);
    formPanel.add(lift, new FormData(ANCHOR_SPEC));

    NumberField benne = createIntegerField(messages.benne());
    benne.setName(DeductionDto.BENNE);
    formPanel.add(benne, new FormData(ANCHOR_SPEC));

    NumberField nettoyage = createIntegerField(messages.nettoyage());
    nettoyage.setName(DeductionDto.NETTOYAGE);
    formPanel.add(nettoyage, new FormData(ANCHOR_SPEC));

    NumberField autres = createNumberField(messages.autres());
    autres.setName(DeductionDto.AUTRES);
    formPanel.add(autres, new FormData(ANCHOR_SPEC));

    NumberField prorata = createNumberField(messages.prorata());
    prorata.setName(DeductionDto.PRORATA);
    prorata.setMinValue(0);
    prorata.setMaxValue(100);
    formPanel.add(prorata, new FormData(ANCHOR_SPEC));

    NumberField refacturations = createNumberField(messages.refacturations());
    refacturations.setName(DeductionDto.REFACTURATIONS);
    formPanel.add(refacturations, new FormData(ANCHOR_SPEC));
    add(formPanel);

    DeductionDto dataModel = new DeductionDto();
    dataModel.initData();
View Full Code Here

    DateField date = new DateField();
    date.setName(ProgressDto.DATE);
    date.setFieldLabel(messages.date());
    formPanel.add(date, new FormData(ANCHOR_SPEC));
   
    NumberField cumule1 = createNumberField(messages.cumule() + " avancement");
    cumule1.setName(ProgressDto.CUMULE);
    formPanel.add(cumule1, new FormData(ANCHOR_SPEC));
   
    NumberField cumule2 = createNumberField(messages.cumule() + " reteneus");
    cumule2.setName(ProgressDto.CUMULE2);
    formPanel.add(cumule2, new FormData(ANCHOR_SPEC));
   
    add(formPanel);
   
    ProgressDto dataModel = new ProgressDto();
View Full Code Here

    DateField date = new DateField();
    date.setName(CautionFournieDto.DATE);
    date.setFieldLabel(messages.date());
    formPanel.add(date, new FormData(ANCHOR_SPEC));
   
    NumberField amount = createNumberField(messages.amount());
    amount.setName(CautionFournieDto.AMOUNT);
    formPanel.add(amount, new FormData(ANCHOR_SPEC));
   
    add(formPanel);
   
    CautionFournieDto dataModel = new CautionFournieDto();
View Full Code Here

    estimate.setSummaryRenderer(new SummaryRenderer() {
      public String render(Number value, Map<String, Number> data) {
        return value.intValue() + " hours";
      }
    });
    estimate.setEditor(new CellEditor(new NumberField()));

    SummaryColumnConfig<Double> rate = new SummaryColumnConfig<Double>("rate", "Rate", 20);
    rate.setNumberFormat(NumberFormat.getCurrencyFormat());
    rate.setSummaryFormat(NumberFormat.getCurrencyFormat());
    rate.setSummaryType(SummaryType.AVG);
    rate.setAlignment(HorizontalAlignment.RIGHT);

    NumberField nf = new NumberField();
    nf.setAutoValidate(true);
    CellEditor ce = new CellEditor(nf);
    ce.setCancelOnEsc(true);
    rate.setEditor(ce);

    SummaryColumnConfig<Double> cost = new SummaryColumnConfig<Double>("cost", "Cost", 20);
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.form.NumberField

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.