Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code improvements in library properties dialog #9265

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.jabref.gui.libraryproperties;

import javafx.beans.property.ReadOnlyListWrapper;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import java.util.List;

import org.jabref.gui.libraryproperties.constants.ConstantsPropertiesView;
import org.jabref.gui.libraryproperties.general.GeneralPropertiesView;
Expand All @@ -12,10 +10,10 @@

public class LibraryPropertiesViewModel {

private final ObservableList<PropertiesTab> propertiesTabs;
private final List<PropertiesTab> propertiesTabs;

public LibraryPropertiesViewModel(BibDatabaseContext databaseContext) {
propertiesTabs = FXCollections.observableArrayList(
propertiesTabs = List.of(
new GeneralPropertiesView(databaseContext),
new SavingPropertiesView(databaseContext),
new ConstantsPropertiesView(databaseContext),
Expand All @@ -35,7 +33,7 @@ public void storeAllSettings() {
}
}

public ObservableList<PropertiesTab> getPropertiesTabs() {
return new ReadOnlyListWrapper<>(propertiesTabs);
public List<PropertiesTab> getPropertiesTabs() {
return propertiesTabs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javafx.scene.control.TextField;

import org.jabref.gui.libraryproperties.AbstractPropertiesTabView;
import org.jabref.gui.libraryproperties.PropertiesTab;
import org.jabref.gui.util.ViewModelListCellFactory;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
Expand All @@ -20,7 +19,7 @@
import com.airhacks.afterburner.views.ViewLoader;
import jakarta.inject.Inject;

public class GeneralPropertiesView extends AbstractPropertiesTabView<GeneralPropertiesViewModel> implements PropertiesTab {
public class GeneralPropertiesView extends AbstractPropertiesTabView<GeneralPropertiesViewModel> {
@FXML private ComboBox<Charset> encoding;
@FXML private ComboBox<BibDatabaseMode> databaseMode;
@FXML private TextField generalFileDirectory;
Expand Down