選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DateTimeFieldKeyboardInput.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.datefield;
  17. import java.time.LocalDateTime;
  18. import com.vaadin.server.VaadinRequest;
  19. import com.vaadin.tests.components.AbstractReindeerTestUI;
  20. import com.vaadin.ui.DateTimeField;
  21. import com.vaadin.ui.Label;
  22. public class DateTimeFieldKeyboardInput extends AbstractReindeerTestUI {
  23. @Override
  24. protected void setup(VaadinRequest request) {
  25. final DateTimeField dateField = new DateTimeField("Select date",
  26. LocalDateTime.of(2014, 1, 15, 7, 2));
  27. dateField.setDateFormat("dd.MM.yyyy HH:mm");
  28. addComponent(dateField);
  29. dateField.addValueChangeListener(
  30. event -> addComponent(new Label("Date has been changed.")));
  31. }
  32. @Override
  33. public Integer getTicketNumber() {
  34. return 16677;
  35. }
  36. @Override
  37. public String getTestDescription() {
  38. return "When a new date is entered in the text field using the keyboard, pressing the return key after typing the date, "
  39. + "a label with the text 'Date has been changed' should appear.";
  40. }
  41. }