private void loadPredefinedBandboxFilter() { User user = model.getUser(); List<FilterPair> sessionFilterPairs = FilterUtils .readProjectsParameters(); if (sessionFilterPairs != null) { bdFilters.addSelectedElements(sessionFilterPairs); } else if ((user != null) && (user.getProjectsFilterLabel() != null)) { bdFilters.clear(); bdFilters.addSelectedElement(new FilterPair( TaskGroupFilterEnum.Label, user.getProjectsFilterLabel() .getFinderPattern(), user .getProjectsFilterLabel())); } // Calculate filter based on user preferences if (user != null) { if ((filterStartDate.getValue() == null) && !FilterUtils.hasProjectsStartDateChanged() && (user.getProjectsFilterPeriodSince() != null)) { filterStartDate.setValue(new LocalDate() .minusMonths(user.getProjectsFilterPeriodSince()) .toDateTimeAtStartOfDay().toDate()); } if (filterFinishDate.getValue() == null && !FilterUtils.hasProjectsEndDateChanged() && (user.getProjectsFilterPeriodTo() != null)) { filterFinishDate.setValue(new LocalDate() .plusMonths(user.getProjectsFilterPeriodTo()) .toDateMidnight().toDate()); } } }
public void loadSessionFiltersIntoBandbox() { bdFilters.addSelectedElements(FilterUtils.readProjectsParameters()); }