org.bklab.flow.components.textfield.ComponentButtonField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-vaadin-flow Show documentation
Show all versions of fluent-vaadin-flow Show documentation
Broderick Labs for fluent vaadin flow. Inherits common Vaadin components.
package org.bklab.flow.components.textfield;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasValue;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.customfield.CustomField;
import org.bklab.flow.factory.CustomFieldFactory;
public class ComponentButtonField> extends CustomField {
private final C component;
private final Button button;
private ComponentButtonField(C component, Button button) {
this.component = component;
this.button = button;
add(component, button);
getElement().getStyle().set("alignItems", "baseline").set("display", "flex");
}
public C getComponent() {
return component;
}
public Button getButton() {
return button;
}
@Override
protected T generateModelValue() {
return component.getValue();
}
@Override
protected void setPresentationValue(T newPresentationValue) {
component.setValue(newPresentationValue);
}
public CustomFieldFactory asFactory() {
return new CustomFieldFactory<>(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy