Search in sources :

Example 1 with MigBoxLayoutAdapter

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();
        }
    });
}
Also used : BoxLayoutAdapter(com.haulmont.cuba.desktop.sys.layout.BoxLayoutAdapter) MigBoxLayoutAdapter(com.haulmont.cuba.desktop.sys.layout.MigBoxLayoutAdapter) MigBoxLayoutAdapter(com.haulmont.cuba.desktop.sys.layout.MigBoxLayoutAdapter)

Aggregations

BoxLayoutAdapter (com.haulmont.cuba.desktop.sys.layout.BoxLayoutAdapter)1 MigBoxLayoutAdapter (com.haulmont.cuba.desktop.sys.layout.MigBoxLayoutAdapter)1