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


        fields.add(t);
        fields.add(new ComboBox());
        fields.add(new NativeSelect());
        fields.add(new ListSelect());
        fields.add(new TextField());
        fields.add(new PopupDateField());
        fields.add(new InlineDateField());
        OptionGroup og = new OptionGroup();
        og.addItem("Item 1");
        og.addItem("Item 2");
        fields.add(og);
View Full Code Here

    private Button.ClickListener listener;

    @Override
    protected void setup() {
        popupDateField = new PopupDateField("PopupDateField");
        popupDateField.setRequired(true);
        popupDateField.setRequiredError("abcd");
        addComponent(popupDateField);

        listener = new Button.ClickListener() {
View Full Code Here

        Assert.assertEquals(PopupDateField.class, f.getClass());
    }

    @Test
    public void clearFields() {
        PopupDateField sqlDate = new PopupDateField();
        PopupDateField javaDate = new PopupDateField();
        fieldGroup.bind(sqlDate, "sqlDate");
        fieldGroup.bind(javaDate, "javaDate");

        Assert.assertEquals(new Date(2010, 5, 7), javaDate.getValue());
        Assert.assertEquals(new Date(2011, 6, 8), sqlDate.getValue());

        fieldGroup.clear();
        Assert.assertEquals(null, javaDate.getValue());
        Assert.assertEquals(null, sqlDate.getValue());

    }
View Full Code Here

public class FieldGroupExceptionTest {

    @Test(expected = CommitException.class)
    public void testUnboundCommitException() throws CommitException {
        FieldGroup fieldGroup = new FieldGroup();
        PopupDateField dateField = new PopupDateField();
        fieldGroup.bind(dateField, "date");
        fieldGroup.commit();
    }
View Full Code Here

        return 6718;
    }

    private DateField makeDateField(boolean isPopup, Locale locale,
            String caption) {
        DateField df = isPopup ? new PopupDateField() : new InlineDateField();
        df.setResolution(DateField.RESOLUTION_DAY);
        df.setValue(date.getTime());
        df.setLocale(locale);
        df.setCaption(caption);
        return df;
View Full Code Here

    protected void setup() {
        BeanItem<Range> bi = new BeanItem<Range>(range);
        range.setFrom(new Date(2011 - 1900, 12 - 1, 4));
        range.setTo(new Date(2011 - 1900, 12 - 1, 15));

        PopupDateField fromField = createDateField();
        fromField.setPropertyDataSource(bi.getItemProperty("from"));
        CheckBox fromInclusive = new CheckBox("From inclusive",
                bi.getItemProperty("fromInclusive"));
        CheckBox toInclusive = new CheckBox("To inclusive",
                bi.getItemProperty("toInclusive"));
        fromInclusive.setImmediate(true);
        fromInclusive.addListener(refreshField);
        toInclusive.setImmediate(true);
        toInclusive.addListener(refreshField);

        PopupDateField toField = createDateField();
        toField.setPropertyDataSource(bi.getItemProperty("to"));

        actualDateField = createDateField();
        actualDateField.setValue(new Date(2011 - 1900, 12 - 1, 1));
        actualDateField.addValidator(new RangeValidator<Date>("", Date.class,
                null, null) {
View Full Code Here

        addComponent(toInclusive);
        addComponent(actualDateField);
    }

    private PopupDateField createDateField() {
        PopupDateField df = new PopupDateField();
        df.setLocale(new Locale("en", "US"));
        df.setResolution(Resolution.DAY);
        df.setBuffered(false);
        df.setImmediate(true);
        return df;
    }
View Full Code Here

public class FormLayoutErrorHover extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        FormLayout formLayout = new FormLayout();
        PopupDateField fromDate = new PopupDateField("Date");
        fromDate.setImmediate(true);
        formLayout.addComponent(fromDate);

        addComponent(formLayout);
    }
View Full Code Here

    protected Integer getTicketNumber() {
        return 6718;
    }

    private PopupDateField makeDateField() {
        PopupDateField pdf = new PopupDateField();
        pdf.setResolution(Resolution.DAY);
        pdf.setValue(date.getTime());
        return pdf;
    }
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.