コード例 #1
0
 private List<PickerAssignee> convertToPickerAssignees(TurboIssue issue, List<TurboUser> users) {
   return users
       .stream()
       .map(
           user -> {
             PickerAssignee convertedAssignee = new PickerAssignee(user);
             if (isExistingAssignee(issue, convertedAssignee)) {
               convertedAssignee.setExisting(true);
             }
             return convertedAssignee;
           })
       .sorted()
       .collect(Collectors.toList());
 }
コード例 #2
0
 private void setConfirmResultConverter() {
   setResultConverter(
       (dialogButton) -> {
         List<PickerAssignee> finalUsers = state.getCurrentUsersList();
         Optional<PickerAssignee> selectedAssignee =
             PickerAssignee.getSelectedAssignee(finalUsers);
         return new AssigneePickerDialogResponse(
             dialogButton, selectedAssignee.map(PickerAssignee::getLoginName));
       });
 }
コード例 #3
0
 private boolean isExistingAssignee(TurboIssue issue, PickerAssignee assignee) {
   if (!issue.getAssignee().isPresent()) return false;
   return issue.getAssignee().get().equals(assignee.getLoginName());
 }
コード例 #4
0
 private void fillTextFieldWithExistingAssignee() {
   PickerAssignee.getExistingAssignee(originalUsers)
       .map(PickerAssignee::getLoginName)
       .ifPresent(this::fillTextFieldWithUsername);
 }
コード例 #5
0
 private void updateExistingAssignee(List<PickerAssignee> users, FlowPane assignedUserPane) {
   Optional<PickerAssignee> existingAssignee = PickerAssignee.getExistingAssignee(users);
   Node existingAssigneeNode = createExistingAssigneeNode(existingAssignee);
   assignedUserPane.getChildren().add(existingAssigneeNode);
 }