Package com.vaadin.ui

Examples of com.vaadin.ui.DateField


        binder.bind(button, controller);
    }

    @Test
    public void bind_dataSource_dataSourceAttached() {
        DateField view = (DateField) inflater
                .inflate(getXml("single-datefield.xml"));

        Binder binder = new Binder();
        binder.bind(view, new ControllerWithDataSource());

        Date value = (Date) view.getValue();
        assertEquals(1337337477578L, value.getTime());
    }
View Full Code Here


   
    Field f = super.createField(item, propertyId, uiContext);
    
    if ("date".equals(propertyId))
     {
       DateField pdate = (DateField)f;
       pdate.setRequired(true);
       pdate.setLocale(new Locale("fr","FR"));
       pdate.setDateFormat("yyyy-MM-dd");
       pdate.setWidth("14em");
     }
     else if ("nVol".equals(propertyId))
     {
       TextField tf = (TextField)f;
       tf.setCaption("N° Vol");
View Full Code Here

        return c;
    }

    /** Create new DateField and add it to current component container. */
    public DateField datefield() {
        DateField c = new DateField();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

    /**
     * Create new DateField with given caption and add it to current component
     * container.
     */
    public DateField datefield(String caption) {
        DateField c = datefield();
        c.setCaption(caption);
        return c;
    }
View Full Code Here

    }

    /** Create new DateField with given caption and listener. */
    public DateField datefield(String caption,
            Property.ValueChangeListener changeListener) {
        DateField c = datefield(caption);
        c.addListener(changeListener);
        return c;
    }
View Full Code Here

      }
    });
  }

  private void addDateFIeld() {
    DateField dateField = new DateField("A");
    dateField.setDateFormat("yyyy");
    dateField.setResolution(DateField.RESOLUTION_MONTH);
    window.addComponent(dateField);
  }
View Full Code Here

public class UiDate extends UiText {

 

  protected AbstractField createTextField() {
    return new DateField();
  }
View Full Code Here

          .getValue() instanceof Timestamp
          || container.getItem(itemId).getItemProperty(propertyId)
              .getValue() instanceof Date) {
        Object objData = container.getItem(itemId)
            .getItemProperty(propertyId).getValue();
        DateField dateField = new DateField();
        dateField.setImmediate(true);
        dateField.setWidth("90%");

        if (objData instanceof Timestamp) {
          dateField.setValue((Timestamp) objData);
          dateField.setResolution(Resolution.SECOND);
        } else if (objData instanceof Date) {
          dateField.setValue((Date) objData);
          dateField.setResolution(Resolution.DAY);
        }

        return dateField;
      } else
        return texto;
View Full Code Here

      private static final long serialVersionUID = -2072811965092456470L;

      public void buttonClick(ClickEvent event) {

        final Window editWindow = new Window("Edit");
        final DateField dateUpdate = new DateField();
        Button saveDate = new Button("Save");

        dateUpdate.setValue(new Date());
        dateUpdate.setDateFormat("dd-MM-yyyy");

        editWindow.addComponent(dateUpdate);
        editWindow.addComponent(saveDate);

        saveDate.addListener(new ClickListener() {
          /**
           *
           */
          private static final long serialVersionUID = 5481286266721721638L;

          public void buttonClick(ClickEvent event) {

            Date projectStart = p.getStartDate();
            Date projectEnd = (Date) dateUpdate.getValue();
            System.out.println(projectEnd.toString());
            Date dateNow = new Date();

            if (projectEnd.after(projectStart)
                && projectEnd.after(dateNow)) {
View Full Code Here

    dueDateLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    addComponent(dueDateLabel);
  }
 
  protected void initDueDateField() {
    dueDateField = new DateField();
    if (task.getDueDate() != null) {
      dueDateField.setValue(task.getDueDate());
    } else {
      dueDateField.setValue(new Date());
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.DateField

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.