Examples of DateBox


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

        textBox_1.setSize("155px", "25px");
       
        lblNewLabel_2 = new Label("Target Date: (MM-DD-YYYY)");
        flexTable.setWidget(2, 0, lblNewLabel_2);
       
        dateBox = new DateBox();
        dateBox.setFormat(new DefaultFormat(DateTimeFormat.getFormat("MM-dd-yyyy")));
        dateBox.getDatePicker().setStyleName("gwt-DatePicker");
       
        flexTable.setWidget(2, 1, dateBox);
        dateBox.setSize("150px", "25px");
View Full Code Here

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

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

  }


  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

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

    @UiField
    DialogBox savedOkDialogBox;

    public InitJizzViewImpl() {
        broadcastEnd = new DateBox();
        broadcastEnd.setFormat(new DateBox.DefaultFormat(DateTimeFormat
                .getFormat("E H:m")));
        initWidget(uiBinder.createAndBindUi(this));
    }
View Full Code Here

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

import java.util.Date;

public class DateBoxExample implements EntryPoint {

  public void onModuleLoad() {
    DateBox dateBox = new DateBox();
    dateBox.setValue(new Date());
    RootPanel.get().add(dateBox);
  }
View Full Code Here

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

    datePicker.setValue(new Date(), true);
    advancedDatePicker.setValue(new Date(), true);

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

    // 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

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

  private Widget dateRange() {
    VerticalPanel v = new VerticalPanel();
    HorizontalPanel p = new HorizontalPanel();
    v.add(p);
    final DateBox start = new DateBox(new DatePicker(), null,
        new FormatWithNewYearsEve());

    start.setWidth("13em");
    final DateBox end = new DateBox();
    end.setWidth("13em");

    end.getDatePicker().addValueChangeHandler(new ValueChangeHandler<Date>() {
      public void onValueChange(ValueChangeEvent<Date> event) {
        start.removeStyleName("user-modified");
      }
    });

    final TextBox startText = start.getTextBox();
    startText.addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(KeyDownEvent e) {
        if (e.isRightArrow()
            && start.getCursorPos() == startText.getText().length()) {
          start.hideDatePicker();
          end.setFocus(true);
        }
      }
    });

    end.getTextBox().addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(KeyDownEvent e) {
        if ((e.isLeftArrow()) && end.getCursorPos() == 0) {
          end.hideDatePicker();
          start.setFocus(true);
        }
      }
    });

    end.setValue(new Date());
    p.add(start);
    Label l = new Label(" - ");
    l.setStyleName("filler");
    p.add(l);
    p.add(end);
    final Label value = new Label();
    p.add(value);
    HorizontalPanel h2 = new HorizontalPanel();
    v.add(h2);
    h2.add(new Button("Short format", new ClickHandler() {
      public void onClick(ClickEvent event) {
        updateFormat(start, end, DateTimeFormat.getShortDateFormat());
      }
    }));
    h2.add(new Button("Long format", new ClickHandler() {

      public void onClick(ClickEvent event) {
        updateFormat(start, end, DateTimeFormat.getMediumDateFormat());
      }
    }));

    h2.add(new Button("Clear", new ClickHandler() {
      public void onClick(ClickEvent sender) {
        start.setValue(null);
        end.setValue(null);
      }
    }));

    h2.add(new Button("Show Values", new ClickHandler() {
      public void onClick(ClickEvent event) {
        DateTimeFormat f = DateTimeFormat.getShortDateFormat();
        Date d1 = start.getValue();
        Date d2 = end.getValue();
        value.setText("Start: \"" + (d1 == null ? "null" : f.format(d1))
            + "\" End: \"" + (d2 == null ? "null" : f.format(d2)) + "\"");
      }
    }));

    EventReporter<Date, DateBox> reporter = new EventReporter<Date, DateBox>();
    start.addValueChangeHandler(reporter);
    end.addValueChangeHandler(reporter);
    reporter.report("Events are logged here");
    v.add(reporter);
    return v;
  }
View Full Code Here

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

  public String getModuleName() {
    return "com.google.gwt.user.User";
  }

  public void testAccessors() {
    DateBox db = new DateBox();
    assertFalse(db.isDatePickerShowing());
    db.showDatePicker();
    assertTrue(db.isDatePickerShowing());
    db.hideDatePicker();
    assertFalse(db.isDatePickerShowing());
  }
View Full Code Here

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

      highResolutionDate.setTime((highResolutionDate.getTime() / 1000) * 1000);
    }
  }

  public void testValueChangeEvent() {
    final DateBox db = new DateBox();
    RootPanel.get().add(db);

    // Checks setValue(date, true). Should preserve precision so getValue returns the exact value
    // passed by setValue.
    new DateValueChangeTester(db).run();
View Full Code Here

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

    }
  }

  public void testValueChangeEventWithCustomFormat() {
    Format format = new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
    final DateBox db = new DateBox(new DatePicker(), null, format);
    RootPanel.get().add(db);

    // Checks setValue(date, true). Should preserve precision so getValue returns the exact value
    // passed by setValue.
    new DateValueChangeTester(db).run();
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.