Skip to content

Commit e672c24

Browse files
committed
Merge remote-tracking branch 'upstream/master' into macsign
* upstream/master: Streamline new library command (#6773) [6574] Added support for biblatex-software (#6747) Updated the eclipse doc with a note and image on how to add the run/debug configuration. (#6776) New Crowdin updates (#6774)
2 parents 2fffc7a + dc55a76 commit e672c24

37 files changed

+316
-32
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
3333
- We added a new fetcher to enable users to search all available E-Libraries simultaneously. [koppor#369](https://github.com/koppor/jabref/issues/369)
3434
- We added the field "entrytype" to the export sort criteria [#6531](https://github.com/JabRef/jabref/pull/6531)
3535
- We added the possibility to change the display order of the fields in the entry editor. The order can now be configured using drag and drop in the "Customize entry types" dialog [#6152](https://github.com/JabRef/jabref/pull/6152)
36+
- We added native support for biblatex-software [#6574](https://github.com/JabRef/jabref/issues/6574)
3637
- We added a missing restart warning for AutoComplete in the preferences dialog. [#6351](https://github.com/JabRef/jabref/issues/6351)
3738
- We added a note to the citation key pattern preferences dialog as a temporary workaround for a JavaFX bug, about committing changes in a table cell, if the focus is lost. [#5825](https://github.com/JabRef/jabref/issues/5825)
3839

@@ -53,6 +54,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
5354
- We improved the "Possible duplicate entries" window to remember its size and position throughout a session. [#6582](https://github.com/JabRef/jabref/issues/6582)
5455
- We divided the toolbar into small parts, so if the application window is to small, only a part of the toolbar is moved into the chevron popup. [#6682](https://github.com/JabRef/jabref/pull/6682)
5556
- We changed the layout for of the buttons in the Open Office side panel to ensure that the button text is always visible, specially when resizing. [#6639](https://github.com/JabRef/jabref/issues/6639)
57+
- We merged the two new library commands in the file menu to one which always creates a new library in the default library mode. [#6359](https://github.com/JabRef/jabref/pull/6539#issuecomment-641056536)
5658

5759
### Fixed
5860

100 KB
Loading
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Add Native Support for BibLatex-Sotware
2+
* Deciders: Oliver Kopp
3+
4+
Technical Story: [6574-Adding support for biblatex-software](https://github.com/JabRef/jabref/issues/6574)
5+
6+
## Context and Problem Statement
7+
8+
JabRef does not right now have support for Biblatex-Software out of the box, users have to add custome entry type.
9+
With citing software becoming fairly common , native support is helpful.
10+
11+
12+
## Decision Drivers
13+
14+
* None of the existing flows should be impacted
15+
16+
## Considered Options
17+
18+
* Add the new entry types to the existing biblatex types
19+
* Add a divider with label Biblatex-Software under which the new entries are listed : Native support for Biblatex-Software
20+
* Support via customized entry types : A user can load a customized bib file
21+
22+
## Decision Outcome
23+
24+
Chosen option: Add a new divider, because comes out best (see below).
25+
26+
### Positive Consequences
27+
28+
* Inbuilt coverage for a entry type that is getting more and more importance
29+
30+
### Negative Consequences
31+
32+
* Adds a little bit more clutter to the Add Entry pane
33+
34+
## Pros and Cons of the Options
35+
36+
### Adding the new entry types to the existing biblatex types
37+
38+
* Good, because there is no need for a new category in the add entry pane
39+
40+
### Add a divider with label Biblatex-Software with relevant types
41+
42+
* Good, since this gives the user a bit more clarity
43+
44+
### Support via customized entry types
45+
46+
* Good, because no code needs to be changed
47+
* Bad, because documentation is needed
48+
* Bad, because the users are not guided through the UI, but have to do other steps.

docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ Make sure your Eclipse installation us up to date, Eclipse JEE 2020-03 or newer
188188
* Remark: Importing it as gradle project will not work correctly.
189189
* Refresh the project in Eclipse
190190
4. Create a run/debug configuration for the main class `org.jabref.JabRefLauncher` and/or for `org.jabref.JabRefMain` \(both can be used equivalently\)
191+
* Remark: The run/debug configuration needs to be added by right clicking the class \(e.g. JabRefLauncher or JabRefMain\) otherwise it will not work.
192+
![Creating the run/debug configuration by right clicking on the class](../.gitbook/assets/eclipse-create-run-config.png)
191193
* In the tab "Arguments" of the run/debug configuration, enter the following runtime VM arguments:
192194

193195
```text

src/main/java/org/jabref/gui/EntryType.fxml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
<FlowPane fx:id="biblatexPane" prefHeight="200.0" prefWidth="200.0"/>
2727
</content>
2828
</TitledPane>
29+
<TitledPane fx:id="biblatexSoftwareTitlePane" animated="false" collapsible="false" text="Biblatex-Software">
30+
<content>
31+
<FlowPane fx:id="biblatexSoftwarePane" prefHeight="200.0" prefWidth="200.0"/>
32+
</content>
33+
</TitledPane>
2934
<TitledPane fx:id="bibTexTitlePane" animated="false" collapsible="false" text="BibTeX">
3035
<content>
3136
<FlowPane fx:id="bibTexPane" prefHeight="200.0" prefWidth="200.0"/>

src/main/java/org/jabref/gui/EntryTypeView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import javafx.application.Platform;
88
import javafx.event.Event;
99
import javafx.fxml.FXML;
10+
1011
import javax.inject.Inject;
12+
1113
import javafx.scene.control.Button;
1214
import javafx.scene.control.ButtonType;
1315
import javafx.scene.control.ComboBox;
@@ -27,6 +29,7 @@
2729
import org.jabref.model.database.BibDatabaseMode;
2830
import org.jabref.model.entry.BibEntryType;
2931
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
32+
import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions;
3033
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
3134
import org.jabref.model.entry.types.EntryType;
3235
import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions;
@@ -52,10 +55,12 @@ public class EntryTypeView extends BaseDialog<EntryType> {
5255
@FXML private FlowPane bibTexPane;
5356
@FXML private FlowPane ieeetranPane;
5457
@FXML private FlowPane customPane;
58+
@FXML private FlowPane biblatexSoftwarePane;
5559
@FXML private TitledPane biblatexTitlePane;
5660
@FXML private TitledPane bibTexTitlePane;
5761
@FXML private TitledPane ieeeTranTitlePane;
5862
@FXML private TitledPane customTitlePane;
63+
@FXML private TitledPane biblatexSoftwareTitlePane;
5964

6065
@Inject StateManager stateManager;
6166

@@ -140,9 +145,11 @@ public void initialize() {
140145
ieeeTranTitlePane.managedProperty().bind(ieeeTranTitlePane.visibleProperty());
141146
biblatexTitlePane.managedProperty().bind(biblatexTitlePane.visibleProperty());
142147
customTitlePane.managedProperty().bind(customTitlePane.visibleProperty());
148+
biblatexSoftwareTitlePane.managedProperty().bind(biblatexSoftwareTitlePane.visibleProperty());
143149

144150
if (basePanel.getBibDatabaseContext().isBiblatexMode()) {
145151
addEntriesToPane(biblatexPane, BiblatexEntryTypeDefinitions.ALL);
152+
addEntriesToPane(biblatexSoftwarePane, BiblatexSoftwareEntryTypeDefinitions.ALL);
146153

147154
bibTexTitlePane.setVisible(false);
148155
ieeeTranTitlePane.setVisible(false);
@@ -155,6 +162,7 @@ public void initialize() {
155162
}
156163
} else {
157164
biblatexTitlePane.setVisible(false);
165+
biblatexSoftwareTitlePane.setVisible(false);
158166
addEntriesToPane(bibTexPane, BibtexEntryTypeDefinitions.ALL);
159167
addEntriesToPane(ieeetranPane, IEEETranEntryTypeDefinitions.ALL);
160168

src/main/java/org/jabref/gui/JabRefFrame.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
import org.jabref.logic.undo.UndoRedoEvent;
135135
import org.jabref.logic.util.io.FileUtil;
136136
import org.jabref.model.database.BibDatabaseContext;
137-
import org.jabref.model.database.BibDatabaseMode;
138137
import org.jabref.model.database.shared.DatabaseLocation;
139138
import org.jabref.model.entry.BibEntry;
140139
import org.jabref.model.entry.field.SpecialField;
@@ -507,20 +506,14 @@ private Node createToolbar() {
507506
final Region leftSpacer = new Region();
508507
final Region rightSpacer = new Region();
509508

510-
final Button newLibrary;
511-
if (Globals.prefs.getDefaultBibDatabaseMode() == BibDatabaseMode.BIBLATEX) {
512-
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX));
513-
} else {
514-
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX));
515-
}
516-
517509
final PushToApplicationAction pushToApplicationAction = getPushToApplicationsManager().getPushToApplicationAction();
518510
final Button pushToApplicationButton = factory.createIconButton(pushToApplicationAction.getActionInformation(), pushToApplicationAction);
519511
pushToApplicationsManager.registerReconfigurable(pushToApplicationButton);
520512

521513
ToolBar toolBar = new ToolBar(
522514

523-
new HBox(newLibrary,
515+
new HBox(
516+
factory.createIconButton(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
524517
factory.createIconButton(StandardActions.OPEN_LIBRARY, new OpenDatabaseAction(this)),
525518
factory.createIconButton(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager))),
526519

@@ -733,10 +726,7 @@ private MenuBar createMenu() {
733726
Menu help = new Menu(Localization.lang("Help"));
734727

735728
file.getItems().addAll(
736-
factory.createSubMenu(StandardActions.NEW_LIBRARY,
737-
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX)),
738-
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX))),
739-
729+
factory.createMenuItem(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
740730
factory.createMenuItem(StandardActions.OPEN_LIBRARY, getOpenDatabaseAction()),
741731
fileHistory,
742732
factory.createMenuItem(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager)),

src/main/java/org/jabref/gui/actions/StandardActions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.jabref.gui.icon.JabRefIcon;
77
import org.jabref.gui.keyboard.KeyBinding;
88
import org.jabref.logic.l10n.Localization;
9-
import org.jabref.model.database.BibDatabaseMode;
109

1110
public enum StandardActions implements Action {
1211

@@ -59,8 +58,6 @@ public enum StandardActions implements Action {
5958
RELEVANCE(Localization.lang("Relevance"), IconTheme.JabRefIcons.RELEVANCE),
6059
RELEVANT(Localization.lang("Toggle relevance"), IconTheme.JabRefIcons.RELEVANCE),
6160
NEW_LIBRARY(Localization.lang("New library"), IconTheme.JabRefIcons.NEW),
62-
NEW_LIBRARY_BIBTEX(Localization.lang("New %0 library", BibDatabaseMode.BIBTEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
63-
NEW_LIBRARY_BIBLATEX(Localization.lang("New %0 library", BibDatabaseMode.BIBLATEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
6461
OPEN_LIBRARY(Localization.lang("Open library"), IconTheme.JabRefIcons.OPEN, KeyBinding.OPEN_DATABASE),
6562
IMPORT(Localization.lang("Import"), IconTheme.JabRefIcons.IMPORT),
6663
EXPORT(Localization.lang("Export"), IconTheme.JabRefIcons.EXPORT, KeyBinding.EXPORT),

src/main/java/org/jabref/gui/importer/NewDatabaseAction.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,31 @@
33
import org.jabref.gui.JabRefFrame;
44
import org.jabref.gui.actions.SimpleCommand;
55
import org.jabref.model.database.BibDatabaseContext;
6-
import org.jabref.model.database.BibDatabaseMode;
6+
import org.jabref.preferences.PreferencesService;
77

88
/**
99
* Create a new, empty, database.
1010
*/
1111
public class NewDatabaseAction extends SimpleCommand {
1212

1313
private final JabRefFrame jabRefFrame;
14-
private final BibDatabaseMode mode;
14+
private final PreferencesService preferencesService;
1515

16-
public NewDatabaseAction(JabRefFrame jabRefFrame, BibDatabaseMode mode) {
16+
/**
17+
* Constructs a command to create a new library of the default type
18+
*
19+
* @param jabRefFrame the application frame of JabRef
20+
* @param preferencesService the preferencesService of JabRef
21+
*/
22+
public NewDatabaseAction(JabRefFrame jabRefFrame, PreferencesService preferencesService) {
1723
this.jabRefFrame = jabRefFrame;
18-
this.mode = mode;
24+
this.preferencesService = preferencesService;
1925
}
2026

2127
@Override
2228
public void execute() {
2329
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext();
24-
bibDatabaseContext.setMode(mode);
30+
bibDatabaseContext.setMode(preferencesService.getGeneralPreferences().getDefaultBibDatabaseMode());
2531
jabRefFrame.addTab(bibDatabaseContext, true);
2632
}
2733
}

src/main/java/org/jabref/gui/preferences/GeneralTab.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<ComboBox fx:id="language" prefWidth="200.0" GridPane.columnIndex="1"/>
3030
<Label text="%Default encoding" GridPane.rowIndex="1"/>
3131
<ComboBox fx:id="defaultEncoding" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
32-
<Label text="%Default bibliography mode" GridPane.rowIndex="2"/>
32+
<Label text="%Default library mode" GridPane.rowIndex="2"/>
3333
<ComboBox fx:id="biblatexMode" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
3434
</GridPane>
3535
<CheckBox fx:id="inspectionWarningDuplicate"

0 commit comments

Comments
 (0)