use of io.jmix.ui.component.ColorPicker in project jmix-sneferu by mariodavid.
the class PetTypeBrowse method colorPicker.
private Component colorPicker(String color) {
ColorPicker component = uiComponents.create(ColorPicker.class);
component.setValue(color);
component.setEditable(false);
return component;
}
use of io.jmix.ui.component.ColorPicker in project jmix-docs by jmix-framework.
the class ColorComponentGenerationStrategy method createComponent.
@Nullable
@Override
public Component createComponent(ComponentGenerationContext context) {
String property = context.getProperty();
MetaPropertyPath mpp = context.getMetaClass().getPropertyPath(property);
if (mpp != null) {
Range mppRange = mpp.getRange();
if (mppRange.isDatatype() && (Datatype) mppRange.asDatatype() instanceof ColorDatatype) {
ColorPicker colorPicker = uiComponents.create(ColorPicker.class);
colorPicker.setDefaultCaptionEnabled(true);
ValueSource valueSource = context.getValueSource();
if (valueSource != null) {
colorPicker.setValueSource(valueSource);
}
return colorPicker;
}
}
return null;
}
use of io.jmix.ui.component.ColorPicker in project jmix-docs by Haulmont.
the class ColorComponentGenerationStrategy method createComponent.
@Nullable
@Override
public Component createComponent(ComponentGenerationContext context) {
String property = context.getProperty();
MetaPropertyPath mpp = context.getMetaClass().getPropertyPath(property);
if (mpp != null) {
Range mppRange = mpp.getRange();
if (mppRange.isDatatype() && (Datatype) mppRange.asDatatype() instanceof ColorDatatype) {
ColorPicker colorPicker = uiComponents.create(ColorPicker.class);
colorPicker.setDefaultCaptionEnabled(true);
ValueSource valueSource = context.getValueSource();
if (valueSource != null) {
colorPicker.setValueSource(valueSource);
}
return colorPicker;
}
}
return null;
}
Aggregations