Skip to content

Commit d73a49f

Browse files
authored
Convert fixed-value ComboBoxes to SearchableComboBox (#14083) (#14165)
* Convert fixed-value ComboBoxes to SearchableComboBox (#14083) * Move SearchableComboBox changelog entry to Unreleased section * Fix CHANGELOG.md formatting - remove extra blank lines * Set editable=false for pushToApplicationCombo as suggested * Document change to ComboBoxes for usability Updated CHANGELOG to include changes regarding ComboBoxes. * Update CHANGELOG.md * Remove duplicate addNewField block after merge and clean FXML structure
1 parent eca968e commit d73a49f

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
2222
- We separated the "Clean up entries" dialog into three tabs for clarity [#13819](https://github.com/JabRef/jabref/issues/13819)
2323
- `JabKit`: `--porcelain` does not output any logs to the console anymore. [#14244](https://github.com/JabRef/jabref/pull/14244)
2424
- <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> now opens the terminal in the active library directory. [#14130](https://github.com/JabRef/jabref/issues/14130)
25+
- We changed fixed-value ComboBoxes to SearchableComboBox for better usability. [#14083](https://github.com/JabRef/jabref/issues/14083)
2526

2627
### Fixed
2728

jabgui/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import javafx.beans.value.ObservableBooleanValue;
66
import javafx.css.PseudoClass;
77
import javafx.scene.control.Button;
8-
import javafx.scene.control.ComboBox;
98
import javafx.scene.control.TextField;
109
import javafx.scene.control.Tooltip;
1110
import javafx.scene.input.KeyCode;
@@ -27,6 +26,7 @@
2726
import org.jabref.logic.l10n.Localization;
2827

2928
import com.tobiasdiez.easybind.EasyBind;
29+
import org.controlsfx.control.SearchableComboBox;
3030

3131
public class WebSearchPaneView extends VBox {
3232

@@ -84,8 +84,8 @@ private void addQueryValidationHints(TextField query) {
8484
/**
8585
* Create combo box for selecting fetcher
8686
*/
87-
private ComboBox<SearchBasedFetcher> createFetcherComboBox() {
88-
ComboBox<SearchBasedFetcher> fetchers = new ComboBox<>();
87+
private SearchableComboBox<SearchBasedFetcher> createFetcherComboBox() {
88+
SearchableComboBox<SearchBasedFetcher> fetchers = new SearchableComboBox<>();
8989
new ViewModelListCellFactory<SearchBasedFetcher>()
9090
.withText(SearchBasedFetcher::getName)
9191
.install(fetchers);

jabgui/src/main/java/org/jabref/gui/preferences/external/ExternalTab.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import javafx.fxml.FXML;
55
import javafx.scene.control.Button;
66
import javafx.scene.control.CheckBox;
7-
import javafx.scene.control.ComboBox;
87
import javafx.scene.control.TextField;
98

109
import org.jabref.gui.actions.ActionFactory;
@@ -20,12 +19,13 @@
2019

2120
import com.airhacks.afterburner.views.ViewLoader;
2221
import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer;
22+
import org.controlsfx.control.SearchableComboBox;
2323

2424
public class ExternalTab extends AbstractPreferenceTabView<ExternalTabViewModel> implements PreferencesTab {
2525

2626
@FXML private TextField eMailReferenceSubject;
2727
@FXML private CheckBox autoOpenAttachedFolders;
28-
@FXML private ComboBox<GuiPushToApplication> pushToApplicationCombo;
28+
@FXML private SearchableComboBox<GuiPushToApplication> pushToApplicationCombo;
2929
@FXML private TextField citeCommand;
3030
@FXML private Button autolinkExternalHelp;
3131

jabgui/src/main/java/org/jabref/gui/preferences/general/GeneralTab.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
import com.tobiasdiez.easybind.EasyBind;
3333
import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer;
3434
import jakarta.inject.Inject;
35+
import org.controlsfx.control.SearchableComboBox;
3536

3637
public class GeneralTab extends AbstractPreferenceTabView<GeneralTabViewModel> implements PreferencesTab {
3738

38-
@FXML private ComboBox<Language> language;
39+
@FXML private SearchableComboBox<Language> language;
3940
@FXML private ComboBox<ThemeTypes> theme;
4041
@FXML private CheckBox themeSyncOs;
4142
@FXML private TextField customThemePath;

jabgui/src/main/resources/org/jabref/gui/preferences/external/ExternalTab.fxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<?import javafx.scene.control.Button?>
44
<?import javafx.scene.control.CheckBox?>
5-
<?import javafx.scene.control.ComboBox?>
65
<?import javafx.scene.control.Label?>
76
<?import javafx.scene.control.TextField?>
87
<?import javafx.scene.control.Tooltip?>
@@ -12,6 +11,7 @@
1211
<?import javafx.scene.layout.RowConstraints?>
1312
<?import javafx.scene.layout.VBox?>
1413
<?import org.jabref.gui.icon.JabRefIconView?>
14+
<?import org.controlsfx.control.SearchableComboBox?>
1515
<fx:root spacing="10.0" type="VBox"
1616
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
1717
fx:controller="org.jabref.gui.preferences.external.ExternalTab">
@@ -41,8 +41,8 @@
4141
<RowConstraints minHeight="10.0" vgrow="SOMETIMES"/>
4242
</rowConstraints>
4343
<Label text="%Application to push entries to"/>
44-
<ComboBox fx:id="pushToApplicationCombo"
45-
prefWidth="200.0" GridPane.columnIndex="1"/>
44+
<SearchableComboBox fx:id="pushToApplicationCombo"
45+
prefWidth="200.0" GridPane.columnIndex="1" editable="false"/>
4646
<Button styleClass="icon-button,narrow" onAction="#pushToApplicationSettings"
4747
prefHeight="20.0" prefWidth="20.0" GridPane.columnIndex="2">
4848
<graphic>

jabgui/src/main/resources/org/jabref/gui/preferences/general/GeneralTab.fxml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<?import javafx.scene.layout.HBox?>
1515
<?import javafx.scene.layout.VBox?>
1616
<?import org.jabref.gui.icon.JabRefIconView?>
17+
<?import org.controlsfx.control.SearchableComboBox?>
1718
<fx:root spacing="10.0" type="VBox"
1819
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
1920
fx:controller="org.jabref.gui.preferences.general.GeneralTab">
@@ -28,7 +29,7 @@
2829
GridPane.rowIndex="0" GridPane.columnIndex="0" GridPane.columnSpan="3"/>
2930
<Label text="%Language"
3031
GridPane.rowIndex="1" GridPane.columnIndex="0"/>
31-
<ComboBox fx:id="language" prefWidth="200.0"
32+
<SearchableComboBox fx:id="language" prefWidth="200.0" editable="false"
3233
GridPane.rowIndex="1" GridPane.columnIndex="1"/>
3334

3435
<Label text="%Visual theme"

0 commit comments

Comments
 (0)