Skip to content

Commit

Permalink
fix: fix content selector for custom fields (#7508)
Browse files Browse the repository at this point in the history
* fix: fix for issue 6819

* fix: ViewModelListCellFactory used

* fix: remove useless
  • Loading branch information
yinpeiqi authored Mar 10, 2021
1 parent 1c7c8e3 commit c7593c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where a non valid value as font size results in an uncaught exception. [#7415](https://github.com/JabRef/jabref/issues/7415)
- We fixed an issue where "Merge citations" in the Openoffice/Libreoffice integration panel did not have a corresponding opposite. [#7454](https://github.com/JabRef/jabref/issues/7454)
- We fixed an issue where drag and drop of bib files for opening resulted in uncaught exceptions [#7464](https://github.com/JabRef/jabref/issues/7464)
- We fixed an issue where Content selector does not seem to work for custom fields. [#6819](https://github.com/JabRef/jabref/issues/6819)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.jabref.gui.LibraryTab;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.ControlHelper;
import org.jabref.gui.util.ViewModelListCellFactory;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.field.Field;

Expand Down Expand Up @@ -68,6 +69,9 @@ public void initialize() {
private void initFieldNameComponents() {
initListView(fieldsListView, viewModel::getFieldNamesBackingList);
viewModel.selectedFieldProperty().bind(fieldsListView.getSelectionModel().selectedItemProperty());
new ViewModelListCellFactory<Field>()
.withText(Field::getDisplayName)
.install(fieldsListView);
removeFieldNameButton.disableProperty().bind(viewModel.isNoFieldNameSelected());
EasyBind.subscribe(viewModel.selectedFieldProperty(), viewModel::populateKeywords);
}
Expand Down

0 comments on commit c7593c9

Please sign in to comment.