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

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

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

import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.KeyModifier;
import com.vaadin.flow.component.customfield.CustomField;
import org.bklab.flow.FlowFactory;
import org.bklab.flow.base.AbstractFieldFactory;
import org.bklab.flow.base.HasSizeFactory;
import org.bklab.flow.base.HasValidationFactory;

public class CustomFieldFactory extends FlowFactory, CustomFieldFactory> implements
        AbstractFieldFactory, CustomFieldFactory>,
        HasSizeFactory, CustomFieldFactory>,
        HasValidationFactory, CustomFieldFactory> {

    public CustomFieldFactory(CustomField component) {
        super(component);
    }

    public CustomFieldFactory label(String label) {
        get().setLabel(label);
        return this;
    }

    public CustomFieldFactory invalid(boolean invalid) {
        get().setInvalid(invalid);
        return this;
    }

    public CustomFieldFactory errorMessage(String errorMessage) {
        get().setErrorMessage(errorMessage);
        return this;
    }

    public CustomFieldFactory focusShortcut(Key key, KeyModifier... keyModifiers) {
        get().addFocusShortcut(key, keyModifiers);
        return this;
    }

    public CustomFieldFactory tabIndex(int tabIndex) {
        get().setTabIndex(tabIndex);
        return this;
    }

    public CustomFieldFactory blur() {
        get().blur();
        return this;
    }

    public CustomFieldFactory focus() {
        get().focus();
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy