Package com.google.gwt.user.datepicker.client

Examples of com.google.gwt.user.datepicker.client.DateBox


  }

 
  private MosaicPanel createEndTimeDateBox(BoxLayoutData bld1) {
    MosaicPanel box4 = new MosaicPanel(new BoxLayout());
    endTime = new DateBox();
    endTime.setWidth("550px");
    box4.add(new Label("End Time: "), bld1);
    box4.add(endTime);
    return box4;
  }
View Full Code Here


  }


  private MosaicPanel createStartTimeDateBox(BoxLayoutData bld1) {
    MosaicPanel box3 = new MosaicPanel(new BoxLayout());
    startTime = new DateBox();
    startTime.setWidth("550px");
    box3.add(new Label("Start Time: "), bld1);
    box3.add(startTime);
    return box3;
  }
View Full Code Here

    // Set the default value
    datePicker.setValue(new Date(), true);

    // Create a DateBox
    DateTimeFormat dateFormat = DateTimeFormat.getLongDateFormat();
    DateBox dateBox = new DateBox();
    dateBox.setFormat(new DateBox.DefaultFormat(dateFormat));

    // Combine the widgets into a panel and return them
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.add(new HTML(constants.cwDatePickerLabel()));
    vPanel.add(text);
View Full Code Here

     * Construct a new {@link DateCellEditor} using a {@link DateBox}.
     *
     * @param dateTimeFormat the {@link DateTimeFormat} used for inline editing
     */
    public DateCellEditor(DateTimeFormat dateTimeFormat) {
      this(new DateBox(), dateTimeFormat);
    }
View Full Code Here

    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();
    Label horasLabel = new Label("24 horas");
    horasLabel.getElement().addClassName("labelHoras");
    horas.add(horaText);
    horas.add(horasLabel);
    mainPanel.add(labelBox);
    mainPanel.add(dateBox);
    mainPanel.add(labelBox2);
    mainPanel.add(horas);
    horaText.clear();
    for (int i = 0; i < 24; i++) {
      if (i < 10) {
        horaText.addItem("0" + i, String.valueOf(i));
      } else {
        horaText.addItem(String.valueOf(i));
      }
    }

    TextBox aux = dateBox.getTextBox();

    aux.addValueChangeHandler(new ValueChangeHandler<String>() {

      @Override
      public void onValueChange(ValueChangeEvent<String> event) {
        if (!(dateBox.getTextBox().getText().isEmpty())) {
          String[] fecha = dateBox.getTextBox().getText().split(" ");
          Integer dia = new Integer(fecha[2]);
          System.out.println(dia);
          Document.get().getElementById("dia")
              .setPropertyInt("value", dia);

        }

      }
    });
    ValueChangeHandler vHandler = new ValueChangeHandler<String>() {

      @Override
      public void onValueChange(ValueChangeEvent<String> event) {
        if (!(dateBox.getTextBox().getText().isEmpty())) {
          String[] fecha = dateBox.getTextBox().getText().split(" ");
          Integer dia = new Integer(fecha[2]);
          System.out.println(dia);
          Document.get().getElementById("dia")
              .setPropertyInt("value", dia);
          Document.get().getElementById("mes")
              .setPropertyInt("value", traduceMes(fecha[1]));
        }

      }

    };
    dateBox.addValueChangeHandler(vHandler);

    horaText.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
View Full Code Here

  private Widget createNarrativeAttributesPanel() {
    headlineTextBox = new TextBox();
    headlineTextBox.setVisibleLength(LONG_TEXTBOX_VISIBLE_LENGTH);
    narrativeTypeSelector = EnumDropdown.newInstance(NarrativeType.class);
    narrativeDateBox = new DateBox();
    narrativeSummaryTextArea = new RichTextEditor();
    narrativeSummaryTextArea.setSize("400px", "100px");
   
    Grid narrativePanel = new Grid(4, 2);
    narrativePanel.setWidget(0, 0, new Label("Headline:"));
View Full Code Here

    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

TOP

Related Classes of com.google.gwt.user.datepicker.client.DateBox

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.