Examples of StringToIntegerConverter


Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    @Test
    public void localeChangesOnAttach() {
        TextField tf = new TextField();

        tf.setConverter(new StringToIntegerConverter() {
            @Override
            protected NumberFormat getFormat(Locale locale) {
                if (locale == null) {
                    NumberFormat format = super.getFormat(locale);
                    format.setGroupingUsed(false);
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

            34, Sex.FEMALE, new Address("Paula street 1", 12345, "P-town",
                    Country.FINLAND));

    public void testValidateConversionErrorParameters() {
        TextField tf = new TextField();
        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new MethodProperty<String>(paulaBean, "age"));
        tf.setConversionError("(Type: {0}) Converter exception message: {1}");
        tf.setValue("abc");
        try {
            tf.validate();
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    }

    public void testConvertToModelConversionErrorParameters() {
        TextField tf = new TextField();
        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new MethodProperty<String>(paulaBean, "age"));
        tf.setConversionError("(Type: {0}) Converter exception message: {1}");
        tf.setValue("abc");
        try {
            tf.getConvertedValue();
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    }

    public void testNullConversionMessages() {
        TextField tf = new TextField();
        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new MethodProperty<String>(paulaBean, "age"));
        tf.setConversionError(null);
        tf.setValue("abc");
        try {
            tf.validate();
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    }

    public void testDefaultConversionErrorMessage() {
        TextField tf = new TextField();
        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new MethodProperty<String>(paulaBean, "age"));
        tf.setValue("abc");

        try {
            tf.validate();
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

public class IntegerTextFieldStandalone extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final TextField textField = new TextField("Text field");
        textField.setConverter(new StringToIntegerConverter());

        Button submitButton = new Button("Submit value", new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                String uiValue = textField.getValue();
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    }

    public void testIntegerStringConversion() {
        TextField tf = new TextField();

        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean, "age"));
        assertEquals(34, tf.getPropertyDataSource().getValue());
        assertEquals("34", tf.getValue());
        tf.setValue("12");
        assertEquals(12, tf.getPropertyDataSource().getValue());
View Full Code Here

Examples of com.vaadin.data.util.converter.StringToIntegerConverter

    }

    @Test
    public void testNullConverter() {
        TextField tf = new TextField("foo");
        tf.setConverter(new StringToIntegerConverter());
        tf.setPropertyDataSource(new ObjectProperty<Integer>(12));
        tf.setConverter((Converter) null);
        try {
            Object v = tf.getConvertedValue();
            System.out.println(v);
View Full Code Here

Examples of org.apache.metamodel.convert.StringToIntegerConverter

        while (ds.next()) {
            assertEquals(true, ds.getRow().getValue(0));
        }
        ds.close();

        dc = Converters.addTypeConverter(dc, col, new StringToIntegerConverter());

        ds = dc.executeQuery(q);
        while (ds.next()) {
            assertEquals(1, ds.getRow().getValue(0));
        }
View Full Code Here

Examples of org.apache.metamodel.convert.StringToIntegerConverter

        while (ds.next()) {
            assertEquals(true, ds.getRow().getValue(0));
        }
        ds.close();

        dc = Converters.addTypeConverter(dc, col, new StringToIntegerConverter());

        ds = dc.executeQuery(q);
        while (ds.next()) {
            assertEquals(1, ds.getRow().getValue(0));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.