Skip to content

Commit

Permalink
Deleted redundant comments and line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrisdimos00 committed Jan 12, 2022
1 parent 5c18a50 commit f4d2aac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,14 @@ public String toString() {
public void addNewField() {
Field field = newFieldToAdd.getValue();
FieldViewModel model = new FieldViewModel(field, true, FieldPriority.IMPORTANT);

// create list with all the entry's fields
ObservableList<FieldViewModel> entryFields = this.selectedEntryType.getValue().fields();

// compare every entry field name with the user field name in order to find out if any of them has the same one.
boolean fieldExists = entryFields.stream().anyMatch(fieldViewModel -> fieldViewModel.fieldName().getValue().equals(field.getDisplayName()));

// if the user field name isn't found inside the list, pass it to the entry as a new one. If that is not the case, show warning.
if (!fieldExists) {
this.selectedEntryType.getValue().addField(model);
} else {
dialogService.showWarningDialogAndWait(Localization.lang("Duplicate fields"), Localization.lang("Warning: You added field \"%0\" twice. Only one will be kept.", field.getDisplayName()));
}

newFieldToAddProperty().setValue(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public class CustomizeEntryTypeDialogView extends BaseDialog<Void> {
private final BibDatabaseMode mode;
private final BibEntryTypesManager entryTypesManager;

@FXML
private TableView<EntryTypeViewModel> entryTypes;
@FXML private TableView<EntryTypeViewModel> entryTypes;
@FXML private TableColumn<EntryTypeViewModel, String> entryTypColumn;
@FXML private TableColumn<EntryTypeViewModel, String> entryTypeActionsColumn;
@FXML private TextField addNewEntryType;
Expand Down

0 comments on commit f4d2aac

Please sign in to comment.