All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bklab.flow.factory.IntegerFieldFactory Maven / Gradle / Ivy

There is a newer version: 22.0.1
Show newest version
package org.bklab.flow.factory;

import com.vaadin.flow.component.AbstractField;
import com.vaadin.flow.component.HasValue;
import com.vaadin.flow.component.textfield.IntegerField;
import org.bklab.flow.FlowFactory;
import org.bklab.flow.base.AbstractNumberFieldFactory;

public class IntegerFieldFactory extends FlowFactory implements
        AbstractNumberFieldFactory {

    public IntegerFieldFactory() {
        this(new IntegerField());
    }

    public IntegerFieldFactory(String label) {
        this(new IntegerField(label));
    }

    public IntegerFieldFactory(String label, String placeholder) {
        this(new IntegerField(label, placeholder));
    }

    public IntegerFieldFactory(HasValue.ValueChangeListener> listener) {
        this(new IntegerField(listener));
    }

    public IntegerFieldFactory(String label, HasValue.ValueChangeListener> listener) {
        this(new IntegerField(listener));
    }

    public IntegerFieldFactory(String label, Integer initialValue, HasValue.ValueChangeListener
            > listener) {
        this(new IntegerField());
    }

    public IntegerFieldFactory(IntegerField component) {
        super(component);
    }

    public IntegerFieldFactory max(int max) {
        get().setMax(max);
        return this;
    }

    public IntegerFieldFactory min(int min) {
        get().setMin(min);
        return this;
    }

    public IntegerFieldFactory step(int step) {
        get().setStep(step);
        return this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy