use of com.haulmont.cuba.desktop.sys.layout.MigBoxLayoutAdapter in project cuba by cuba-platform.
the class DesktopDateField method initComponentParts.
protected void initComponentParts() {
BoxLayoutAdapter adapter = new MigBoxLayoutAdapter(impl);
adapter.setSpacing(false);
adapter.setFlowDirection(BoxLayoutAdapter.FlowDirection.X);
adapter.setExpandLayout(true);
impl.setLayout(adapter.getLayout());
datePicker = new FlushableDatePicker();
Dimension size = getDefaultDimension();
datePicker.setPreferredSize(size);
datePicker.setMinimumSize(size);
timeField = new DesktopTimeField();
timeField.addValueChangeListener(e -> {
if (!checkRange(constructDate())) {
return;
}
if (!updateTimeFieldResolution) {
updateInstance();
}
});
datePicker.addPropertyChangeListener(evt -> {
if ("date".equals(evt.getPropertyName())) {
if (!checkRange(constructDate())) {
return;
}
updateInstance();
updateMissingValueState();
}
});
}
Aggregations