Search in sources :

Example 1 with PredefinedDateInterval

use of com.haulmont.cuba.gui.components.filter.dateinterval.predefined.PredefinedDateInterval in project cuba by cuba-platform.

the class DateIntervalEditor method fillPredefinedIntervalsLookup.

protected void fillPredefinedIntervalsLookup() {
    Map<String, PredefinedDateInterval> optionsMap = new LinkedHashMap<>();
    for (PredefinedDateInterval interval : getPredefinedDateIntervals()) {
        optionsMap.put(interval.getLocalizedCaption(), interval);
    }
    predefinedIntervalsLookup.setOptionsMap(optionsMap);
}
Also used : PredefinedDateInterval(com.haulmont.cuba.gui.components.filter.dateinterval.predefined.PredefinedDateInterval)

Example 2 with PredefinedDateInterval

use of com.haulmont.cuba.gui.components.filter.dateinterval.predefined.PredefinedDateInterval in project cuba by cuba-platform.

the class DateIntervalEditor method getPredefinedDateIntervals.

protected Collection<PredefinedDateInterval> getPredefinedDateIntervals() {
    List<PredefinedDateInterval> intervals = new ArrayList<>(AppBeans.getAll(PredefinedDateInterval.class).values());
    intervals.sort(new AnnotationAwareOrderComparator());
    return intervals;
}
Also used : PredefinedDateInterval(com.haulmont.cuba.gui.components.filter.dateinterval.predefined.PredefinedDateInterval) AnnotationAwareOrderComparator(org.springframework.core.annotation.AnnotationAwareOrderComparator)

Aggregations

PredefinedDateInterval (com.haulmont.cuba.gui.components.filter.dateinterval.predefined.PredefinedDateInterval)2 AnnotationAwareOrderComparator (org.springframework.core.annotation.AnnotationAwareOrderComparator)1