@Override
    public boolean validateData() {
        code = textFieldCode.getText().trim();
        names = textFieldNames.getText().trim();
        birthday = dateChooserBirthday.getDate();
        gender = radioButtonMale.isSelected() ? Gender.MALE : Gender.FEMALE;
        address = textFieldAddress.getText().trim();
        phone = textFieldPhone.getText().trim();

        String key;
        if (code.length() == 0) {
            key = "app.warning.student.code.empty";
            log.warn(key);
            Toast.makeText(this, resourceBundleHelper.getString(key), Toast.Style.WARNING).display();
            selectTextField(textFieldCode);
            return false;
        }
        if (DialogAction.INSERT.equals(dialogAction)) {
            if (studentController.existsCode(code)) {
                key = "app.warning.student.code.already.exists";
                log.warn(key);
                Toast.makeText(this, resourceBundleHelper.getString(key), Toast.Style.WARNING).display();
                selectTextField(textFieldCode);
                return false;
            }
        }
        if (names.length() == 0) {
            key = "app.warning.student.name.empty";
            log.warn(key);
            Toast.makeText(this, resourceBundleHelper.getString(key), Toast.Style.WARNING).display();
            selectTextField(textFieldNames);
            return false;
        }
        if (birthday == null) {
            key = "app.warning.student.birthday.empty";
            log.warn(key);
            Toast.makeText(this, resourceBundleHelper.getString(key), Toast.Style.WARNING).display();
            dateChooserBirthday.requestFocusInWindow();
            return false;
        }
        if (address.length() == 0) {
            key = "app.warning.student.address.empty";
            log.warn(key);
            Toast.makeText(this, resourceBundleHelper.getString(key), Toast.Style.WARNING).display();
            selectTextField(textFieldAddress);
            return false;
        }

        return true;
    }