-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4617 from JabRef/librarypropertiestofx
Convert LibraryProperties to JavaFX
- Loading branch information
Showing
22 changed files
with
732 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.CheckBox?> | ||
<?import javafx.scene.control.ComboBox?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.RadioButton?> | ||
<?import javafx.scene.control.ToggleGroup?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.RowConstraints?> | ||
|
||
<fx:root prefHeight="200.0" prefWidth="600.0" type="javafx.scene.layout.GridPane" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.SaveOrderConfigDisplayView"> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" minWidth="-Infinity" prefWidth="100.0" /> | ||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | ||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | ||
</columnConstraints> | ||
<rowConstraints> | ||
<RowConstraints prefHeight="30.0" /> | ||
<RowConstraints prefHeight="30.0" /> | ||
<RowConstraints prefHeight="30.0" /> | ||
<RowConstraints prefHeight="30.0" /> | ||
<RowConstraints prefHeight="30.0" /> | ||
<RowConstraints prefHeight="30.0" /> | ||
</rowConstraints> | ||
<fx:define> | ||
<ToggleGroup fx:id="saveOrderToggleGroup" /> | ||
</fx:define> | ||
<children> | ||
<ComboBox fx:id="savePriSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | ||
<ComboBox fx:id="saveSecSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="4" /> | ||
<ComboBox fx:id="saveTerSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="5" /> | ||
<RadioButton fx:id="exportInSpecifiedOrder" mnemonicParsing="false" prefHeight="5.0" prefWidth="206.0" text="%Export entries ordered as specified" toggleGroup="$saveOrderToggleGroup" GridPane.columnSpan="3" GridPane.rowIndex="2" /> | ||
<RadioButton fx:id="exportInTableOrder" mnemonicParsing="false" text="%Export in current table sort order" toggleGroup="$saveOrderToggleGroup" GridPane.columnSpan="3" GridPane.rowIndex="1" /> | ||
<RadioButton fx:id="exportInOriginalOrder" mnemonicParsing="false" text="%Export entries in their original order" toggleGroup="$saveOrderToggleGroup" GridPane.columnSpan="3" /> | ||
<CheckBox fx:id="savePriDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false" text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="3" /> | ||
<CheckBox fx:id="saveSecDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false" text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="4" /> | ||
<CheckBox fx:id="saveTerDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false" text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="5" /> | ||
<Label disabled="${!exportInSpecifiedOrder.selected}" text="%Primary sort criterion" GridPane.rowIndex="3" /> | ||
<Label disabled="${!exportInSpecifiedOrder.selected}" text="%Secondary sort criterion" GridPane.rowIndex="4" /> | ||
<Label disabled="${!exportInSpecifiedOrder.selected}" text="%Tertiary sort criterion" GridPane.rowIndex="5" /> | ||
</children> | ||
</fx:root> |
113 changes: 0 additions & 113 deletions
113
src/main/java/org/jabref/gui/SaveOrderConfigDisplay.java
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
src/main/java/org/jabref/gui/SaveOrderConfigDisplayView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package org.jabref.gui; | ||
|
||
import javax.inject.Inject; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.CheckBox; | ||
import javafx.scene.control.ComboBox; | ||
import javafx.scene.control.RadioButton; | ||
import javafx.scene.control.ToggleGroup; | ||
import javafx.scene.layout.GridPane; | ||
|
||
import org.jabref.logic.l10n.Localization; | ||
import org.jabref.model.metadata.SaveOrderConfig; | ||
import org.jabref.preferences.PreferencesService; | ||
|
||
import com.airhacks.afterburner.views.ViewLoader; | ||
|
||
public class SaveOrderConfigDisplayView extends GridPane { | ||
|
||
private final SaveOrderConfig config; | ||
|
||
@FXML private ToggleGroup saveOrderToggleGroup; | ||
@FXML private ComboBox<String> savePriSort; | ||
@FXML private ComboBox<String> saveSecSort; | ||
@FXML private ComboBox<String> saveTerSort; | ||
@FXML private RadioButton exportInSpecifiedOrder; | ||
@FXML private RadioButton exportInTableOrder; | ||
@FXML private RadioButton exportInOriginalOrder; | ||
@FXML private CheckBox savePriDesc; | ||
@FXML private CheckBox saveSecDesc; | ||
@FXML private CheckBox saveTerDesc; | ||
@Inject private PreferencesService preferencesService; | ||
|
||
private SaveOrderConfigDisplayViewModel viewModel; | ||
|
||
public SaveOrderConfigDisplayView(SaveOrderConfig config) { | ||
this.config = config; | ||
|
||
ViewLoader.view(this) | ||
.root(this) | ||
.load(); | ||
} | ||
|
||
@FXML | ||
private void initialize() { | ||
|
||
viewModel = new SaveOrderConfigDisplayViewModel(config, preferencesService); | ||
|
||
exportInSpecifiedOrder.selectedProperty().bindBidirectional(viewModel.saveInSpecifiedOrderProperty()); | ||
exportInTableOrder.selectedProperty().bindBidirectional(viewModel.saveInTableOrderProperty()); | ||
exportInOriginalOrder.selectedProperty().bindBidirectional(viewModel.saveInOriginalProperty()); | ||
|
||
savePriSort.itemsProperty().bindBidirectional(viewModel.priSortFieldsProperty()); | ||
saveSecSort.itemsProperty().bindBidirectional(viewModel.secSortFieldsProperty()); | ||
saveTerSort.itemsProperty().bindBidirectional(viewModel.terSortFieldsProperty()); | ||
|
||
savePriSort.valueProperty().bindBidirectional(viewModel.savePriSortSelectedValueProperty()); | ||
saveSecSort.valueProperty().bindBidirectional(viewModel.saveSecSortSelectedValueProperty()); | ||
saveTerSort.valueProperty().bindBidirectional(viewModel.saveTerSortSelectedValueProperty()); | ||
|
||
savePriDesc.selectedProperty().bindBidirectional(viewModel.savePriDescPropertySelected()); | ||
saveSecDesc.selectedProperty().bindBidirectional(viewModel.saveSecDescPropertySelected()); | ||
saveTerDesc.selectedProperty().bindBidirectional(viewModel.saveTerDescPropertySelected()); | ||
|
||
} | ||
|
||
public void changeExportDescriptionToSave() { | ||
exportInOriginalOrder.setText(Localization.lang("Save entries in their original order")); | ||
exportInSpecifiedOrder.setText(Localization.lang("Save entries ordered as specified")); | ||
exportInTableOrder.setText(Localization.lang("Save in current table sort order")); | ||
} | ||
|
||
public void storeConfig() { | ||
viewModel.storeConfigInPrefs(); | ||
} | ||
|
||
public SaveOrderConfig getSaveOrderConfig() { | ||
return viewModel.getSaveOrderConfig(); | ||
} | ||
|
||
} |
Oops, something went wrong.