-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Slightly improved visual consistency of the CitationkeyTab #13939
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
Changes from 2 commits
e36aec0
f955c7b
5182334
54b7c18
c522c88
d1ca52e
65e7566
b838e28
83e4790
d742b54
3702c81
59e0a16
3066071
53dda09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| package org.jabref.gui.util.component; | ||
|
|
||
| import javafx.beans.property.SimpleStringProperty; | ||
| import javafx.beans.property.StringProperty; | ||
| import javafx.scene.control.Button; | ||
|
|
||
| import org.jabref.gui.DialogService; | ||
|
|
@@ -14,6 +16,8 @@ | |
| import org.jspecify.annotations.NonNull; | ||
|
|
||
| public class HelpButton extends Button { | ||
| private StringProperty helpUrl; | ||
|
|
||
| public HelpButton() { | ||
| setGraphic(IconTheme.JabRefIcons.HELP.getGraphicNode()); | ||
| getStyleClass().add("icon-button"); | ||
|
|
@@ -38,4 +42,24 @@ public void setHelpPage(@NonNull String helpDocumentationUrl) { | |
| public void setHelpFile(@NonNull HelpFile helpFile, @NonNull DialogService dialogService, @NonNull ExternalApplicationsPreferences externalApplicationsPreferences) { | ||
| setOnAction(_ -> new HelpAction(helpFile, dialogService, externalApplicationsPreferences).execute()); | ||
| } | ||
|
|
||
| public final StringProperty helpUrlProperty() { | ||
|
||
| if (helpUrl == null) { | ||
| helpUrl = new SimpleStringProperty(this, "helpUrl"); | ||
| helpUrl.addListener((observable, oldValue, newValue) -> { | ||
| if (newValue != null && !newValue.isEmpty()) { | ||
| setHelpPage(newValue); | ||
| } | ||
| }); | ||
| } | ||
| return helpUrl; | ||
| } | ||
|
|
||
| public final String getHelpUrl() { | ||
| return helpUrlProperty().get(); | ||
| } | ||
|
|
||
| public final void setHelpUrl(String url) { | ||
| helpUrlProperty().set(url); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,13 @@ | |
| <?import javafx.scene.layout.HBox?> | ||
| <?import javafx.scene.layout.VBox?> | ||
| <?import org.jabref.gui.commonfxcontrols.CitationKeyPatternsPanel?> | ||
| <?import org.jabref.gui.util.component.HelpButton?> | ||
| <fx:root spacing="10.0" type="VBox" | ||
| xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" | ||
| fx:controller="org.jabref.gui.libraryproperties.keypattern.KeyPatternPropertiesView"> | ||
| <HBox alignment="BOTTOM_LEFT" spacing="8.0"> | ||
| <Label styleClass="sectionHeader" text="%Key patterns"/> | ||
| <Button fx:id="keyPatternHelp" styleClass="icon-button,narrow" /> | ||
| <HelpButton helpUrl="https://docs.jabref.org/setup/citationkeypatterns"/> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the improvement. Reads nice! |
||
| </HBox> | ||
| <Label text="%( Note: Press return to commit changes in the table! )"/> | ||
| <AnchorPane VBox.vgrow="ALWAYS"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,151 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <?import javafx.geometry.Insets?> | ||
| <?import javafx.scene.control.Button?> | ||
| <?import javafx.scene.control.CheckBox?> | ||
| <?import javafx.scene.control.Label?> | ||
| <?import javafx.scene.control.RadioButton?> | ||
| <?import javafx.scene.control.TextField?> | ||
| <?import javafx.scene.control.ToggleGroup?> | ||
| <?import javafx.scene.layout.AnchorPane?> | ||
| <?import javafx.scene.layout.ColumnConstraints?> | ||
| <?import javafx.scene.layout.GridPane?> | ||
| <?import javafx.scene.layout.HBox?> | ||
| <?import javafx.scene.layout.VBox?> | ||
| <?import org.jabref.gui.commonfxcontrols.CitationKeyPatternsPanel?> | ||
| <fx:root spacing="10.0" type="VBox" | ||
| xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" | ||
| fx:controller="org.jabref.gui.preferences.citationkeypattern.CitationKeyPatternTab"> | ||
| <?import org.jabref.gui.util.component.HelpButton?> | ||
| <fx:root | ||
| spacing="10.0" | ||
| type="VBox" | ||
| xmlns="http://javafx.com/javafx" | ||
| xmlns:fx="http://javafx.com/fxml" | ||
| fx:controller="org.jabref.gui.preferences.citationkeypattern.CitationKeyPatternTab"> | ||
| <fx:define> | ||
| <ToggleGroup fx:id="uniqueKeyLetters"/> | ||
| <ToggleGroup | ||
| fx:id="uniqueKeyLetters"/> | ||
| </fx:define> | ||
| <Label styleClass="titleHeader" text="%Citation key patterns"/> | ||
| <Label styleClass="titleHeader" | ||
| text="%Citation key patterns"/> | ||
|
|
||
| <Label styleClass="sectionHeader" text="%General"/> | ||
| <CheckBox fx:id="overwriteAllow" text="%Overwrite existing keys"/> | ||
| <CheckBox fx:id="overwriteWarning" text="%Warn before overwriting existing keys" disable="${!overwriteAllow.selected}"> | ||
| <padding> | ||
| <Insets left="20.0"/> | ||
| </padding> | ||
| </CheckBox> | ||
| <CheckBox fx:id="generateOnSave" text="%Generate keys before saving (for entries without a key)"/> | ||
| <CheckBox fx:id="generateNewKeyOnImport" text="%Generate a new key for imported entries (overwriting their default)"/> | ||
| <GridPane | ||
| styleClass="innerGridPane"> | ||
| <columnConstraints> | ||
| <ColumnConstraints | ||
| hgrow="SOMETIMES" | ||
| percentWidth="30.0"/> | ||
| <ColumnConstraints | ||
| hgrow="SOMETIMES"/> | ||
| <ColumnConstraints | ||
| hgrow="NEVER"/> | ||
| </columnConstraints> | ||
|
|
||
| <Label text="%Letters after duplicate generated keys"/> | ||
| <VBox spacing="10.0"> | ||
| <RadioButton fx:id="letterStartA" text="%Start on second duplicate key with letter A (a, b, ...)" toggleGroup="$uniqueKeyLetters"/> | ||
| <RadioButton fx:id="letterStartB" text="%Start on second duplicate key with letter B (b, c, ...)" toggleGroup="$uniqueKeyLetters"/> | ||
| <RadioButton fx:id="letterAlwaysAdd" text="%Always add letter (a, b, ...) to generated keys" toggleGroup="$uniqueKeyLetters"/> | ||
| <padding> | ||
| <Insets left="20.0"/> | ||
| </padding> | ||
| </VBox> | ||
| <Label styleClass="sectionHeader" | ||
| text="%General" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="0"/> | ||
|
|
||
| <Label text="%Replace (regular expression)"/> | ||
| <HBox spacing="4.0" alignment="CENTER"> | ||
| <TextField fx:id="keyPatternRegex" HBox.hgrow="ALWAYS"/> | ||
| <Label text="%by"/> | ||
| <TextField fx:id="keyPatternReplacement" HBox.hgrow="ALWAYS"/> | ||
| <padding> | ||
| <Insets left="20.0"/> | ||
| </padding> | ||
| </HBox> | ||
| <CheckBox | ||
| fx:id="overwriteAllow" | ||
| text="%Overwrite existing keys" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="1"/> | ||
| <HBox styleClass="prefIndent" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="2"> | ||
| <CheckBox | ||
| fx:id="overwriteWarning" | ||
| text="%Warn before overwriting existing keys" | ||
| disable="${!overwriteAllow.selected}"/> | ||
| </HBox> | ||
| <CheckBox | ||
| fx:id="generateOnSave" | ||
| text="%Generate keys before saving (for entries without a key)" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="3"/> | ||
| <CheckBox | ||
| fx:id="generateNewKeyOnImport" | ||
| text="%Generate a new key for imported entries (overwriting their default)" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="4"/> | ||
|
|
||
| <HBox alignment="CENTER_LEFT" spacing="10.0"> | ||
| <Label text="%Remove the following characters:"/> | ||
| <TextField fx:id="unwantedCharacters" HBox.hgrow="ALWAYS"/> | ||
| </HBox> | ||
| <Label text="%Letters after duplicate generated keys" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="5"/> | ||
| <VBox spacing="10.0" | ||
| styleClass="prefIndent" | ||
| GridPane.columnIndex="0" | ||
| GridPane.columnSpan="3" | ||
| GridPane.rowIndex="6"> | ||
| <RadioButton | ||
| fx:id="letterStartA" | ||
| text="%Start on second duplicate key with letter A (a, b, ...)" | ||
| toggleGroup="$uniqueKeyLetters"/> | ||
| <RadioButton | ||
| fx:id="letterStartB" | ||
| text="%Start on second duplicate key with letter B (b, c, ...)" | ||
| toggleGroup="$uniqueKeyLetters"/> | ||
| <RadioButton | ||
| fx:id="letterAlwaysAdd" | ||
| text="%Always add letter (a, b, ...) to generated keys" | ||
| toggleGroup="$uniqueKeyLetters"/> | ||
| </VBox> | ||
|
|
||
| <Label text="%Replace (regular expression)" | ||
| GridPane.columnIndex="0" | ||
| GridPane.rowIndex="7"/> | ||
| <HBox spacing="4.0" | ||
| alignment="CENTER_LEFT" | ||
| GridPane.columnIndex="1" | ||
| GridPane.rowIndex="7"> | ||
| <TextField | ||
| fx:id="keyPatternRegex" | ||
| HBox.hgrow="ALWAYS"/> | ||
| <Label text="%by"/> | ||
| <TextField | ||
| fx:id="keyPatternReplacement" | ||
| HBox.hgrow="ALWAYS"/> | ||
| </HBox> | ||
| <HelpButton | ||
| helpUrl="https://docs.jabref.org/setup/citationkeypatterns#replace-via-regular-expression" | ||
|
||
| GridPane.columnIndex="2" | ||
| GridPane.rowIndex="7"/> | ||
|
|
||
| <HBox> | ||
| <Label styleClass="sectionHeader" text="%Key patterns"/> | ||
| <HBox HBox.hgrow="ALWAYS"/> | ||
| <Button fx:id="keyPatternHelp" prefWidth="20.0"/> | ||
| <Label text="%Remove the following characters:" | ||
| GridPane.columnIndex="0" | ||
| GridPane.rowIndex="8"/> | ||
| <TextField | ||
| fx:id="unwantedCharacters" | ||
| GridPane.columnIndex="1" | ||
| GridPane.rowIndex="8"/> | ||
| </GridPane> | ||
|
|
||
|
|
||
| <HBox spacing="8.0"> | ||
| <Label styleClass="sectionHeader" | ||
| text="%Key patterns"/> | ||
| <VBox alignment="BOTTOM_CENTER" > | ||
| <HelpButton | ||
| helpUrl="https://docs.jabref.org/setup/citationkeypatterns" | ||
|
||
| styleClass="headerHelpButton" | ||
| /> | ||
| </VBox> | ||
| </HBox> | ||
|
|
||
| <Label text="%( Note: Press return to commit changes in the table! )"/> | ||
| <AnchorPane> | ||
| <CitationKeyPatternsPanel fx:id="bibtexKeyPatternTable" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" prefHeight="180.0"/> | ||
| <Button text="%Reset All" onAction="#resetAllKeyPatterns" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/> | ||
| <CitationKeyPatternsPanel | ||
| fx:id="bibtexKeyPatternTable" | ||
| AnchorPane.leftAnchor="0.0" | ||
| AnchorPane.rightAnchor="0.0" | ||
| prefHeight="180.0"/> | ||
| <Button text="%Reset All" | ||
| onAction="#resetAllKeyPatterns" | ||
| AnchorPane.rightAnchor="0.0" | ||
| AnchorPane.topAnchor="0.0"/> | ||
| </AnchorPane> | ||
| </fx:root> | ||
Uh oh!
There was an error while loading. Please reload this page.