Package com.vaadin.ui

Examples of com.vaadin.ui.PopupDateField


        if (InlineDateField.class.isAssignableFrom(fieldType)) {
            field = new InlineDateField();
        } else if (DateField.class.isAssignableFrom(fieldType)
                || fieldType == Field.class) {
            field = new PopupDateField();
        } else if (AbstractTextField.class.isAssignableFrom(fieldType)) {
            field = createAbstractTextField((Class<? extends AbstractTextField>) fieldType);
        } else {
            return null;
        }
View Full Code Here


  }

  @Override
  public Field getPropertyField(FormProperty formProperty) {
    // Writable string
    PopupDateField dateField = new PopupDateField(getPropertyLabel(formProperty));
    String datePattern = (String) formProperty.getType().getInformation("datePattern");
    dateField.setDateFormat(datePattern);
    dateField.setRequired(formProperty.isRequired());
    dateField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty)));
    dateField.setEnabled(formProperty.isWritable());

    if (formProperty.getValue() != null) {
      // Try parsing the current value
      SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern);

      try {
        Date date = dateFormat.parse(formProperty.getValue());
        dateField.setValue(date);
      } catch (ParseException e) {
        // TODO: what happens if current value is illegal date?
      }
    }
    return dateField;
View Full Code Here

    return dateField;
  }
 
  @Override
  public String getFieldValue(FormProperty formProperty, Field field) {
    PopupDateField dateField = (PopupDateField) field;
    Date selectedDate = (Date) dateField.getValue();
   
    if(selectedDate != null) {
      // Use the datePattern specified in the form property type
      String datePattern = (String) formProperty.getType().getInformation("datePattern");
      SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern);
View Full Code Here

* Date: 2012-01-12
* Time: 16:42:06
*/
public class PopupDateFieldWidthTextField extends DateFieldWithTextField<PopupDateField> {
  public PopupDateFieldWidthTextField(String caption, String timeCaption, Locale locale, String timeErrorMessage, boolean initWithEmptyHour) {
    super(new PopupDateField(), caption, timeCaption, locale, timeErrorMessage, initWithEmptyHour);
  }
View Full Code Here

            public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
                toggleDateField(maxRangeCheckBox.booleanValue() ? null : new Date());
            }
        });

        dateField = new PopupDateField();
        dateField.setImmediate(true);
        dateField.setDateFormat(VaadinUtility.SIMPLE_DATE_FORMAT_STRING);
        dateField.setWidth("100px");
        dateField.setResolution(DateField.RESOLUTION_DAY);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.PopupDateField

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.