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

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


    private HandlerManager handlerManager;
    private DateBox datebox;

    public UTCDateBoxImplHtml4() {
        handlerManager = new HandlerManager(this);
        datebox = new DateBox();
        datebox.addValueChangeHandler(new ValueChangeHandler<Date>() {

            @Override
            public void onValueChange(ValueChangeEvent<Date> event) {
                // pass this event onto our handlers after converting
View Full Code Here


    return ((DateBox) w).getValue();
  }

  @Override
  protected Widget editField() {
    final DateBox box = new DateBox();
    box.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat(PredefinedFormat.DATE_LONG)));
    return box;
  }
View Full Code Here

   
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    tabPanel.add(horizontalPanel, "New tab", false);
    horizontalPanel.setSize("5cm", "3cm");
   
    DateBox dateBox_1 = new DateBox();
    horizontalPanel.add(dateBox_1);
   
    Button btnNewButton = new Button("New button");
    horizontalPanel.add(btnNewButton);
   
    Label lblNewLabel = new Label("New label");
    horizontalPanel.add(lblNewLabel);
   
    Button btnNewButton_1 = new Button("New button");
    horizontalPanel.add(btnNewButton_1);
   
    VerticalPanel verticalPanel = new VerticalPanel();
    tabPanel.add(verticalPanel, "New tab", false);
    verticalPanel.setSize("5cm", "3cm");
   
    Button btnNewButton_2 = new Button("New button");
    verticalPanel.add(btnNewButton_2);
   
    DateBox dateBox = new DateBox();
    verticalPanel.add(dateBox);
   
    ListBox comboBox = new ListBox();
    verticalPanel.add(comboBox);
   
View Full Code Here

        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

  }

 
  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

    @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

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

    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

  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

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.