Package com.ponysdk.ui.server.form2.dataconverter

Examples of com.ponysdk.ui.server.form2.dataconverter.DataConverter


    public DateBoxFormField(final SimpleDateFormat dateFormat) {
        this(new PDateBox(dateFormat), new DateConverter(dateFormat));
    }

    public DateBoxFormField(final PDateBox dateBox) {
        this(dateBox, new DateConverter(dateBox.getDateFormat()));
    }
View Full Code Here


    public DoubleTextBoxFormField() {
        this(new PTextBox());
    }

    public DoubleTextBoxFormField(final PTextBox textBox) {
        super(textBox, new DoubleConverter());
    }
View Full Code Here

    public FloatTextBoxFormField() {
        this(new PTextBox());
    }

    public FloatTextBoxFormField(final PTextBox textBox) {
        super(textBox, new FloatConverter());
    }
View Full Code Here

    public IntegerTextBoxFormField() {
        this(new PTextBox());
    }

    public IntegerTextBoxFormField(final PTextBox textBox) {
        super(textBox, new IntegerConverter());
    }
View Full Code Here

    public LongTextBoxFormField() {
        this(new PTextBox());
    }

    public LongTextBoxFormField(final PTextBox textBox) {
        super(textBox, new LongConverter());
    }
View Full Code Here

        field2.setValidator(new DoubleFieldValidator());
        final FormField<String> field3 = new StringTextBoxFormField();
        field3.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new DoubleFieldValidator()));
        final FormField<String> field4 = new StringTextBoxFormField();
        field4.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new EmailFieldValidator()));
        final FormField<Boolean> field5 = new CheckBoxFormField();
        field5.setValidator(new UncheckedFieldValidator());

        final PListBox listBox = new PListBox(true);
        listBox.addItem("Item 1");
        listBox.addItem("Item 2");
        listBox.addItem("Item 3");
View Full Code Here

        listBox.addItem("Item 6");

        final FormField<String> field6 = new StringListBoxFormField(listBox);
        field6.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field7 = new DateBoxFormField();
        field7.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field8 = new DateBoxFormField();
        field7.setValidator(new NotEmptyFieldValidator());

        final FormField<String> field9 = new StringTextBoxFormField();
        field9.setValidator(new NotEmptyFieldValidator());
View Full Code Here

        listContainer.setWidget(dataGrid);
    }

    private void addForm() {
        final IntegerTextBoxFormField addRowFormField = new IntegerTextBoxFormField();
        final IntegerTextBoxFormField removeRowFormField = new IntegerTextBoxFormField();
        final LongTextBoxFormField removeRowByKeyFormField = new LongTextBoxFormField();
        final LongTextBoxFormField keyRowFormField = new LongTextBoxFormField();
        final IntegerTextBoxFormField toRowFormField = new IntegerTextBoxFormField();

        addRowFormField.getTextBox().setPlaceholder("Row index (add)");
        removeRowFormField.getTextBox().setPlaceholder("Row index (remove)");
        removeRowByKeyFormField.getTextBox().setPlaceholder("Row key (remove)");
        keyRowFormField.getTextBox().setPlaceholder("Row key (move)");
        toRowFormField.getTextBox().setPlaceholder("Row index (move)");

        final PButton addButton = new PButton("Add a row");
        addButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Integer index = addRowFormField.getValue();
                if (index != null) {
                    dataGrid.insertRow(index, 0, 4, new PLabel("Colspan 1 inserted"));
                }
            }
        });

        final PButton removeByKeyButton = new PButton("Remove a row (by key)");
        removeByKeyButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Long k = removeRowByKeyFormField.getValue();
                if (k != null) {
                    dataGrid.removeByKey(k);
                }
            }
        });

        final PButton removeButton = new PButton("Remove a row (by index)");
        removeButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Integer v = removeRowFormField.getValue();
                if (v != null) {
                    dataGrid.remove(v);
                }
            }
        });

        final PButton moveButton = new PButton("Move a row");
        moveButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Long k = keyRowFormField.getValue();
                final Integer v = toRowFormField.getValue();
                if (v != null && k != null) {
                    dataGrid.moveRow(k, v);
                }
            }
        });

        actions.setWidget(0, 0, addRowFormField.asWidget());
        actions.setWidget(0, 1, addButton);
        actions.setWidget(1, 0, removeRowByKeyFormField.asWidget());
        actions.setWidget(1, 1, removeByKeyButton);
        actions.setWidget(2, 0, removeRowFormField.asWidget());
        actions.setWidget(2, 1, removeButton);

        actions.setWidget(0, 2, keyRowFormField.asWidget());
        actions.setWidget(0, 3, toRowFormField.asWidget());
        actions.setWidget(0, 4, moveButton);
    }
View Full Code Here

    private void buildCreatePonyActivity() {

        createPony = new Form();
        nameFormField = new StringTextBoxFormField();
        ageFormField = new IntegerTextBoxFormField();
        raceFormField = new StringTextBoxFormField();

        nameFormField.setValidator(new NotEmptyFieldValidator());
        raceFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new NotEmptyFieldValidator());
View Full Code Here

    }

    private void addForm() {
        final IntegerTextBoxFormField addRowFormField = new IntegerTextBoxFormField();
        final IntegerTextBoxFormField removeRowFormField = new IntegerTextBoxFormField();
        final LongTextBoxFormField removeRowByKeyFormField = new LongTextBoxFormField();
        final LongTextBoxFormField keyRowFormField = new LongTextBoxFormField();
        final IntegerTextBoxFormField toRowFormField = new IntegerTextBoxFormField();

        addRowFormField.getTextBox().setPlaceholder("Row index (add)");
        removeRowFormField.getTextBox().setPlaceholder("Row index (remove)");
        removeRowByKeyFormField.getTextBox().setPlaceholder("Row key (remove)");
        keyRowFormField.getTextBox().setPlaceholder("Row key (move)");
        toRowFormField.getTextBox().setPlaceholder("Row index (move)");

        final PButton addButton = new PButton("Add a row");
        addButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Integer index = addRowFormField.getValue();
                if (index != null) {
                    dataGrid.insertRow(index, 0, 4, new PLabel("Colspan 1 inserted"));
                }
            }
        });

        final PButton removeByKeyButton = new PButton("Remove a row (by key)");
        removeByKeyButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Long k = removeRowByKeyFormField.getValue();
                if (k != null) {
                    dataGrid.removeByKey(k);
                }
            }
        });

        final PButton removeButton = new PButton("Remove a row (by index)");
        removeButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Integer v = removeRowFormField.getValue();
                if (v != null) {
                    dataGrid.remove(v);
                }
            }
        });

        final PButton moveButton = new PButton("Move a row");
        moveButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final Long k = keyRowFormField.getValue();
                final Integer v = toRowFormField.getValue();
                if (v != null && k != null) {
                    dataGrid.moveRow(k, v);
                }
            }
        });

        actions.setWidget(0, 0, addRowFormField.asWidget());
        actions.setWidget(0, 1, addButton);
        actions.setWidget(1, 0, removeRowByKeyFormField.asWidget());
        actions.setWidget(1, 1, removeByKeyButton);
        actions.setWidget(2, 0, removeRowFormField.asWidget());
        actions.setWidget(2, 1, removeButton);

        actions.setWidget(0, 2, keyRowFormField.asWidget());
        actions.setWidget(0, 3, toRowFormField.asWidget());
        actions.setWidget(0, 4, moveButton);
    }
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.form2.dataconverter.DataConverter

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.