Package com.vaadin.ui

Examples of com.vaadin.ui.DateField$UnparsableDateString


        testDate = cal.getTime();
    }

    @Override
    protected void setup(VaadinRequest request) {
        DateField df = new InlineDateField("Disabled");
        df.setValue(testDate);
        df.setEnabled(false);
        addComponent(df);

        df = new InlineDateField("Read-only");
        df.setValue(testDate);
        df.setReadOnly(true);
        addComponent(df);
    }
View Full Code Here


    protected void setup(VaadinRequest request) {
        VerticalLayout content = new VerticalLayout();
        content.setMargin(true);
        content.setSpacing(true);

        final DateField disabledDateField = new DateField("Disabled DateField");
        disabledDateField.setEnabled(false);

        setContent(content);
        content.addComponent(disabledDateField);
        content.addComponent(new DateField("Enabled DateField"));
    }
View Full Code Here

public class DateFieldPrimaryStyleNames extends TestBase {

    @Override
    protected void setup() {
        final DateField df = new DateField();
        df.setPrimaryStyleName("my-datefield");
        addComponent(df);

        final InlineDateField idf = new InlineDateField();
        idf.setPrimaryStyleName("my-inline-datefield");
        addComponent(idf);

        addComponent(new Button("Set primary stylename",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        df.setPrimaryStyleName("my-second-datefield");
                        idf.setPrimaryStyleName("my-second-inline-datefield");
                    }
                }));

    }
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        Calendar cal = Calendar.getInstance();
        cal.set(2014, 2, 14); // Friday

        DateField df = new DateField("Should display 14/03/2014 Fri");
        df.setResolution(Resolution.DAY);
        df.setLocale(new Locale("en", "US"));

        String pattern = "dd/MM/yyyy EEE";
        df.setDateFormat(pattern);
        df.setValue(cal.getTime());
        df.setWidth("200px");

        VerticalLayout layout = new VerticalLayout();
        layout.addComponent(df);
        layout.setMargin(true);
        setContent(layout);
View Full Code Here

        createDateFieldWith(null, null, null);
        createDateFieldWith("Small", ChameleonTheme.DATEFIELD_SMALL, null);
        createDateFieldWith("Big", ChameleonTheme.DATEFIELD_BIG, null);

        DateField df = new PopupDateField("Popup date field");
        df.setId("datefield" + debugIdCounter++);
        df.setValue(cal.getTime());
        addComponent(df);

        df = new InlineDateField("Inline date field");
        df.setId("datefield" + debugIdCounter++);
        df.setValue(cal.getTime());
        addComponent(df);

        createDateFieldWith(null, null, "130px");
        createDateFieldWith("Small 130px", ChameleonTheme.DATEFIELD_SMALL,
                "130px");
View Full Code Here

    }

    private void createDateFieldWith(String caption, String primaryStyleName,
            String width) {
        DateField df = new DateField("Date field");
        df.setId("datefield" + debugIdCounter++);
        df.setValue(cal.getTime());

        if (caption != null) {
            df.setCaption(caption);
        }

        if (primaryStyleName != null) {
            df.addStyleName(primaryStyleName);
        }
        if (width != null) {
            df.setWidth(width);
        }

        addComponent(df);

    }
View Full Code Here

                "dd/MM/yyyy HH:mm");

        Calendar cal = Calendar.getInstance();
        cal.set(2019, 1, 1, 1, 1);

        DateField df = new DateField("foo");
        df.setResolution(DateField.RESOLUTION_MIN);
        df.setDateFormat(dformat.toPattern());
        df.setValue(cal.getTime());
        df.setImmediate(true);

        addComponent(df);

        final Label lbl = new Label(dformat.format(cal.getTime()));
        lbl.setCaption("Selected date");
View Full Code Here

    static final String DATEFIELD_ID = "datefield";

    @Override
    protected void setup(VaadinRequest request) {
        final DateField df = new DateField();
        df.setId(DATEFIELD_ID);
        addComponent(df);
    }
View Full Code Here

    // The ID of a button is BUTTON_BASE_ID + resolution, e.g. button-month
    public static final String BUTTON_BASE_ID = "button-";

    @Override
    protected void setup(VaadinRequest request) {
        final DateField dateField = new PopupDateField("Enter date");
        dateField.setResolution(Resolution.YEAR);
        dateField.setId(DATEFIELD_ID);
        dateField.setImmediate(true);
        addComponent(dateField);

        Label l = new Label("Select resolution");
        addComponent(l);
        HorizontalLayout hlayout = new HorizontalLayout();
        addComponent(hlayout);
        for (final Resolution value : Resolution.values()) {
            String resolutionString = value.toString().toLowerCase();
            Button b = new Button(resolutionString);
            b.addClickListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    dateField.setResolution(value);
                }
            });
            b.setId(BUTTON_BASE_ID + resolutionString);
            hlayout.addComponent(b);
        }
View Full Code Here

        TextField name = new TextField("Name");
        name.setValue(sg.nextString(true) + " " + sg.nextString(true));
        name.setWidth("50%");
        form.addComponent(name);

        DateField birthday = new DateField("Birthday");
        birthday.setValue(new Date(80, 0, 31));
        form.addComponent(birthday);

        TextField username = new TextField("Username");
        username.setValue(sg.nextString(false) + sg.nextString(false));
        username.setRequired(true);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.DateField$UnparsableDateString

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.