Skip to content

Commit

Permalink
Added UI items (JabRef#10418)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExrosZ-Alt committed Oct 17, 2024
1 parent 7d48050 commit 587d542
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupDialog.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ToggleGroup fx:id="hierarchicalContext"/>
<ToggleGroup fx:id="type"/>
<ToggleGroup fx:id="autoGroupOptions"/>
<ToggleGroup fx:id="popularityOptions"/>
</fx:define>
<VBox spacing="10.0" minWidth="200">
<padding>
Expand Down Expand Up @@ -99,6 +100,12 @@
<Tooltip text="%Group containing entries cited in a given TeX file"/>
</tooltip>
</RadioButton>
<RadioButton fx:id="popularityButton" toggleGroup="$type" wrapText="true"
text="%Popularity">
<tooltip>
<Tooltip text="%Group containing entries cited in a given TeX file"/>
</tooltip>
</RadioButton>
</VBox>
<Separator orientation="VERTICAL"/>
<StackPane HBox.hgrow="ALWAYS">
Expand Down Expand Up @@ -171,6 +178,12 @@
<Button onAction="#texGroupBrowse" text="%Browse" prefHeight="30.0"/>
</HBox>
</VBox>
<VBox visible="${popularityButton.selected}" spacing="10.0">
<Label text="%Time Period"/>
<ComboBox fx:id="timePeriodCombo"/>
<Label text="%Maximum Number of Entries"/>
<ComboBox fx:id="maxEntriesCombo"/>
</VBox>
</StackPane>
</HBox>
</VBox>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupDialogView.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class GroupDialogView extends BaseDialog<AbstractGroup> {
@FXML private RadioButton searchRadioButton;
@FXML private RadioButton autoRadioButton;
@FXML private RadioButton texRadioButton;
@FXML private RadioButton popularityButton;

// Option Groups
@FXML private TextField keywordGroupSearchTerm;
Expand All @@ -98,6 +99,10 @@ public class GroupDialogView extends BaseDialog<AbstractGroup> {

@FXML private TextField texGroupFilePath;

@FXML private ComboBox<String> timePeriodCombo;
@FXML private ComboBox<Integer> maxEntriesCombo;


private final EnumMap<GroupHierarchyType, String> hierarchyText = new EnumMap<>(GroupHierarchyType.class);
private final EnumMap<GroupHierarchyType, String> hierarchyToolTip = new EnumMap<>(GroupHierarchyType.class);

Expand Down Expand Up @@ -198,6 +203,12 @@ public void initialize() {
searchRadioButton.selectedProperty().bindBidirectional(viewModel.typeSearchProperty());
autoRadioButton.selectedProperty().bindBidirectional(viewModel.typeAutoProperty());
texRadioButton.selectedProperty().bindBidirectional(viewModel.typeTexProperty());
popularityButton.selectedProperty().bindBidirectional(viewModel.typePopularityProperty());

timePeriodCombo.setItems(FXCollections.observableArrayList("Last week", "Last month", "Last year", "All time"));
maxEntriesCombo.setItems(FXCollections.observableArrayList(10, 20, 50, 100, 999));
timePeriodCombo.visibleProperty().bind(popularityButton.selectedProperty());
maxEntriesCombo.visibleProperty().bind(popularityButton.selectedProperty());

keywordGroupSearchTerm.textProperty().bindBidirectional(viewModel.keywordGroupSearchTermProperty());
keywordGroupSearchField.textProperty().bindBidirectional(viewModel.keywordGroupSearchFieldProperty());
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class GroupDialogViewModel {
private final BooleanProperty typeSearchProperty = new SimpleBooleanProperty();
private final BooleanProperty typeAutoProperty = new SimpleBooleanProperty();
private final BooleanProperty typeTexProperty = new SimpleBooleanProperty();
private final BooleanProperty typePopularityProperty = new SimpleBooleanProperty();

// Option Groups
private final StringProperty keywordGroupSearchTermProperty = new SimpleStringProperty("");
Expand Down Expand Up @@ -581,6 +582,10 @@ public BooleanProperty typeTexProperty() {
return typeTexProperty;
}

public BooleanProperty typePopularityProperty(){
return typePopularityProperty;
}

public StringProperty keywordGroupSearchTermProperty() {
return keywordGroupSearchTermProperty;
}
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@
<Label styleClass="sectionHeader" text="%Time stamp"/>
<CheckBox fx:id="addCreationDate" text="%Add timestamp to new entries (field &quot;creationdate&quot;)"/>
<CheckBox fx:id="addModificationDate" text="%Add timestamp to modified entries (field &quot;modificationdate&quot;)"/>



<CheckBox fx:id="enableViewTracking" text="%Enable user behaviour analysis'"/>
<CheckBox fx:id="trackViews" text="%Track entry views"
disable="${!enableViewTracking.selected}">
<padding>
<Insets left="20.0"/>
</padding>
</CheckBox>

</fx:root>

0 comments on commit 587d542

Please sign in to comment.