io.mateu.mdd.vaadin.components.fieldBuilders.JPABooleanFieldBuilder Maven / Gradle / Ivy
The newest version!
package io.mateu.mdd.vaadin.components.fieldBuilders;
import com.google.common.collect.Lists;
import com.vaadin.data.HasValue;
import com.vaadin.data.Validator;
import com.vaadin.data.provider.ListDataProvider;
import com.vaadin.ui.*;
import io.mateu.mdd.core.app.AbstractAction;
import io.mateu.mdd.core.interfaces.AbstractStylist;
import io.mateu.mdd.shared.CSS;
import io.mateu.mdd.shared.annotations.RequestFocus;
import io.mateu.mdd.shared.reflection.FieldInterfaced;
import io.mateu.mdd.vaadin.data.MDDBinder;
import io.mateu.reflection.ReflectionHelper;
import java.util.List;
import java.util.Map;
public class JPABooleanFieldBuilder extends AbstractFieldBuilder {
public boolean isSupported(FieldInterfaced field) {
return Boolean.class.equals(field.getType()) || boolean.class.equals(field.getType());
}
@Override
public Component build(VerticalLayout fieldGroup, HorizontalLayout fieldGroupHeader, FieldInterfaced field, Object object, Layout container, MDDBinder binder, Map> validators, AbstractStylist stylist, Map allFieldContainers, boolean forSearchFilter, Map> attachedActions) {
Component r = null;
if (forSearchFilter && object != null && object.getClass().getName().endsWith("000Filters")) {
ComboBox