private void setDueDateToFilterObjectAndFireEvent() {
    if (!validateDueDate()) {
      return;
    }

    Dtos.DateMatcherDataDto dueDateMatches = DtoFactory.dateMatcherDataDto();
    dueDateMatches.setCondition(dueDateCondition.getSelectedIndex());

    dueDateMatches.setDateFrom(dueDateFromBox.getText());
    dueDateMatches.setDateTo(dueDateToBox.getText());
    filterObject.getFilterDataDto().setDueDate(dueDateMatches);
    filterObject.fireFilterChangedEvent();
  }
  private boolean createFilterObject() {
    boolean loaded = true;

    filterObject = new BoardsFilter(this);
    Dtos.FilterDataDto filterDataDto = filterObject.loadFilterData();

    if (filterDataDto == null) {
      filterDataDto = DtoFactory.filterDataDto();

      filterDataDto.setFullTextFilter(DtoFactory.fullTextMatcherDataDto());
      List<Dtos.FilteredEntity> entities = new ArrayList<Dtos.FilteredEntity>();
      filterDataDto.getFullTextFilter().setCaseSensitive(false);
      filterDataDto.getFullTextFilter().setInverse(false);
      filterDataDto.getFullTextFilter().setRegex(false);
      filterDataDto.getFullTextFilter().setString("");

      filterDataDto.getFullTextFilter().setFilteredEntities(entities);

      filterDataDto.setClassesOfServices(new ArrayList<Dtos.ClassOfServiceWithSelectedDto>());
      filterDataDto.setUsers(new ArrayList<Dtos.UserWithSelectedDto>());
      filterDataDto.setBoards(new ArrayList<Dtos.BoardWithSelectedDto>());
      filterDataDto.setBoardWithProjectsDto(new ArrayList<Dtos.BoardWithProjectsWithSelectedDto>());
      filterDataDto.setTaskTags(new ArrayList<Dtos.TaskTagWithSelected>());

      Dtos.DateMatcherDataDto dueDateFilter = DtoFactory.dateMatcherDataDto();
      dueDateFilter.setCondition(0);
      dueDateFilter.setDateFrom("");
      dueDateFilter.setDateTo("");
      filterDataDto.setDueDate(dueDateFilter);

      boolean active = filterDataDto.isActive() != null ? filterDataDto.isActive() : true;
      filterDataDto.setActive(active);

      loaded = false;
    }

    filterObject.setFilterDataDto(filterDataDto);

    return loaded;
  }
  private void initDueDate(BoardsFilter filterObject) {
    dueDateCondition.clear();

    dueDateCondition.addItem("-------");
    dueDateCondition.addItem("due date not set");
    dueDateCondition.addItem("less than");
    dueDateCondition.addItem("equals");
    dueDateCondition.addItem("more than");
    dueDateCondition.addItem("between");

    Dtos.DateMatcherDataDto dueDateMatcher = filterObject.getFilterDataDto().getDueDate();

    dueDateCondition.setSelectedIndex(dueDateMatcher.getCondition());
    setDueDateTextBoxVisibility(dueDateMatcher.getCondition());
    dueDateFromBox.setText(dueDateMatcher.getDateFrom());
    dueDateToBox.setText(dueDateMatcher.getDateTo());

    dueDateFromPicker =
        new DatePickerDialog(dueDateFromBox) {
          @Override
          public void hide() {
            super.hide();
            setDueDateToFilterObjectAndFireEvent();
          }
        };
    dueDateToPicker =
        new DatePickerDialog(dueDateToBox) {
          @Override
          public void hide() {
            super.hide();
            setDueDateToFilterObjectAndFireEvent();
          }
        };

    dueDateFromBox.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            dueDateFromPicker.show();
          }
        });

    dueDateToBox.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            dueDateToPicker.show();
          }
        });

    dueDateCondition.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            setDueDateTextBoxVisibility(dueDateCondition.getSelectedIndex());

            setDueDateToFilterObjectAndFireEvent();
          }
        });

    dueDateFromBox.addKeyUpHandler(
        new KeyUpHandler() {
          @Override
          public void onKeyUp(KeyUpEvent event) {
            setDueDateToFilterObjectAndFireEvent();
          }
        });

    dueDateToBox.addKeyUpHandler(
        new KeyUpHandler() {
          @Override
          public void onKeyUp(KeyUpEvent event) {
            setDueDateToFilterObjectAndFireEvent();
          }
        });
  }