Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into macsign
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Siedlerchr committed Aug 22, 2020
2 parents 2fffc7a + dc55a76 commit e672c24
Show file tree
Hide file tree
Showing 37 changed files with 316 additions and 32 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We added a new fetcher to enable users to search all available E-Libraries simultaneously. [koppor#369](https://github.com/koppor/jabref/issues/369)
- We added the field "entrytype" to the export sort criteria [#6531](https://github.com/JabRef/jabref/pull/6531)
- 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)
- We added native support for biblatex-software [#6574](https://github.com/JabRef/jabref/issues/6574)
- We added a missing restart warning for AutoComplete in the preferences dialog. [#6351](https://github.com/JabRef/jabref/issues/6351)
- 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)

Expand All @@ -53,6 +54,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We improved the "Possible duplicate entries" window to remember its size and position throughout a session. [#6582](https://github.com/JabRef/jabref/issues/6582)
- 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)
- 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)
- 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)

### Fixed

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docs/adr/0013-add-native-support-biblatex-software.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Add Native Support for BibLatex-Sotware
* Deciders: Oliver Kopp

Technical Story: [6574-Adding support for biblatex-software](https://github.com/JabRef/jabref/issues/6574)

## Context and Problem Statement

JabRef does not right now have support for Biblatex-Software out of the box, users have to add custome entry type.
With citing software becoming fairly common , native support is helpful.


## Decision Drivers

* None of the existing flows should be impacted

## Considered Options

* Add the new entry types to the existing biblatex types
* Add a divider with label Biblatex-Software under which the new entries are listed : Native support for Biblatex-Software
* Support via customized entry types : A user can load a customized bib file

## Decision Outcome

Chosen option: Add a new divider, because comes out best (see below).

### Positive Consequences

* Inbuilt coverage for a entry type that is getting more and more importance

### Negative Consequences

* Adds a little bit more clutter to the Add Entry pane

## Pros and Cons of the Options

### Adding the new entry types to the existing biblatex types

* Good, because there is no need for a new category in the add entry pane

### Add a divider with label Biblatex-Software with relevant types

* Good, since this gives the user a bit more clarity

### Support via customized entry types

* Good, because no code needs to be changed
* Bad, because documentation is needed
* Bad, because the users are not guided through the UI, but have to do other steps.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ Make sure your Eclipse installation us up to date, Eclipse JEE 2020-03 or newer
* Remark: Importing it as gradle project will not work correctly.
* Refresh the project in Eclipse
4. Create a run/debug configuration for the main class `org.jabref.JabRefLauncher` and/or for `org.jabref.JabRefMain` \(both can be used equivalently\)
* Remark: The run/debug configuration needs to be added by right clicking the class \(e.g. JabRefLauncher or JabRefMain\) otherwise it will not work.
![Creating the run/debug configuration by right clicking on the class](../.gitbook/assets/eclipse-create-run-config.png)
* In the tab "Arguments" of the run/debug configuration, enter the following runtime VM arguments:

```text
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/gui/EntryType.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<FlowPane fx:id="biblatexPane" prefHeight="200.0" prefWidth="200.0"/>
</content>
</TitledPane>
<TitledPane fx:id="biblatexSoftwareTitlePane" animated="false" collapsible="false" text="Biblatex-Software">
<content>
<FlowPane fx:id="biblatexSoftwarePane" prefHeight="200.0" prefWidth="200.0"/>
</content>
</TitledPane>
<TitledPane fx:id="bibTexTitlePane" animated="false" collapsible="false" text="BibTeX">
<content>
<FlowPane fx:id="bibTexPane" prefHeight="200.0" prefWidth="200.0"/>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/jabref/gui/EntryTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import javafx.application.Platform;
import javafx.event.Event;
import javafx.fxml.FXML;

import javax.inject.Inject;

import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.ComboBox;
Expand All @@ -27,6 +29,7 @@
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntryType;
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions;
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions;
Expand All @@ -52,10 +55,12 @@ public class EntryTypeView extends BaseDialog<EntryType> {
@FXML private FlowPane bibTexPane;
@FXML private FlowPane ieeetranPane;
@FXML private FlowPane customPane;
@FXML private FlowPane biblatexSoftwarePane;
@FXML private TitledPane biblatexTitlePane;
@FXML private TitledPane bibTexTitlePane;
@FXML private TitledPane ieeeTranTitlePane;
@FXML private TitledPane customTitlePane;
@FXML private TitledPane biblatexSoftwareTitlePane;

@Inject StateManager stateManager;

Expand Down Expand Up @@ -140,9 +145,11 @@ public void initialize() {
ieeeTranTitlePane.managedProperty().bind(ieeeTranTitlePane.visibleProperty());
biblatexTitlePane.managedProperty().bind(biblatexTitlePane.visibleProperty());
customTitlePane.managedProperty().bind(customTitlePane.visibleProperty());
biblatexSoftwareTitlePane.managedProperty().bind(biblatexSoftwareTitlePane.visibleProperty());

if (basePanel.getBibDatabaseContext().isBiblatexMode()) {
addEntriesToPane(biblatexPane, BiblatexEntryTypeDefinitions.ALL);
addEntriesToPane(biblatexSoftwarePane, BiblatexSoftwareEntryTypeDefinitions.ALL);

bibTexTitlePane.setVisible(false);
ieeeTranTitlePane.setVisible(false);
Expand All @@ -155,6 +162,7 @@ public void initialize() {
}
} else {
biblatexTitlePane.setVisible(false);
biblatexSoftwareTitlePane.setVisible(false);
addEntriesToPane(bibTexPane, BibtexEntryTypeDefinitions.ALL);
addEntriesToPane(ieeetranPane, IEEETranEntryTypeDefinitions.ALL);

Expand Down
16 changes: 3 additions & 13 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
import org.jabref.logic.undo.UndoRedoEvent;
import org.jabref.logic.util.io.FileUtil;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.database.shared.DatabaseLocation;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.SpecialField;
Expand Down Expand Up @@ -507,20 +506,14 @@ private Node createToolbar() {
final Region leftSpacer = new Region();
final Region rightSpacer = new Region();

final Button newLibrary;
if (Globals.prefs.getDefaultBibDatabaseMode() == BibDatabaseMode.BIBLATEX) {
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX));
} else {
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX));
}

final PushToApplicationAction pushToApplicationAction = getPushToApplicationsManager().getPushToApplicationAction();
final Button pushToApplicationButton = factory.createIconButton(pushToApplicationAction.getActionInformation(), pushToApplicationAction);
pushToApplicationsManager.registerReconfigurable(pushToApplicationButton);

ToolBar toolBar = new ToolBar(

new HBox(newLibrary,
new HBox(
factory.createIconButton(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
factory.createIconButton(StandardActions.OPEN_LIBRARY, new OpenDatabaseAction(this)),
factory.createIconButton(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager))),

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

file.getItems().addAll(
factory.createSubMenu(StandardActions.NEW_LIBRARY,
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX)),
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX))),

factory.createMenuItem(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
factory.createMenuItem(StandardActions.OPEN_LIBRARY, getOpenDatabaseAction()),
fileHistory,
factory.createMenuItem(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager)),
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.jabref.gui.icon.JabRefIcon;
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseMode;

public enum StandardActions implements Action {

Expand Down Expand Up @@ -59,8 +58,6 @@ public enum StandardActions implements Action {
RELEVANCE(Localization.lang("Relevance"), IconTheme.JabRefIcons.RELEVANCE),
RELEVANT(Localization.lang("Toggle relevance"), IconTheme.JabRefIcons.RELEVANCE),
NEW_LIBRARY(Localization.lang("New library"), IconTheme.JabRefIcons.NEW),
NEW_LIBRARY_BIBTEX(Localization.lang("New %0 library", BibDatabaseMode.BIBTEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
NEW_LIBRARY_BIBLATEX(Localization.lang("New %0 library", BibDatabaseMode.BIBLATEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
OPEN_LIBRARY(Localization.lang("Open library"), IconTheme.JabRefIcons.OPEN, KeyBinding.OPEN_DATABASE),
IMPORT(Localization.lang("Import"), IconTheme.JabRefIcons.IMPORT),
EXPORT(Localization.lang("Export"), IconTheme.JabRefIcons.EXPORT, KeyBinding.EXPORT),
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/org/jabref/gui/importer/NewDatabaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.preferences.PreferencesService;

/**
* Create a new, empty, database.
*/
public class NewDatabaseAction extends SimpleCommand {

private final JabRefFrame jabRefFrame;
private final BibDatabaseMode mode;
private final PreferencesService preferencesService;

public NewDatabaseAction(JabRefFrame jabRefFrame, BibDatabaseMode mode) {
/**
* Constructs a command to create a new library of the default type
*
* @param jabRefFrame the application frame of JabRef
* @param preferencesService the preferencesService of JabRef
*/
public NewDatabaseAction(JabRefFrame jabRefFrame, PreferencesService preferencesService) {
this.jabRefFrame = jabRefFrame;
this.mode = mode;
this.preferencesService = preferencesService;
}

@Override
public void execute() {
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext();
bibDatabaseContext.setMode(mode);
bibDatabaseContext.setMode(preferencesService.getGeneralPreferences().getDefaultBibDatabaseMode());
jabRefFrame.addTab(bibDatabaseContext, true);
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/preferences/GeneralTab.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ComboBox fx:id="language" prefWidth="200.0" GridPane.columnIndex="1"/>
<Label text="%Default encoding" GridPane.rowIndex="1"/>
<ComboBox fx:id="defaultEncoding" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Label text="%Default bibliography mode" GridPane.rowIndex="2"/>
<Label text="%Default library mode" GridPane.rowIndex="2"/>
<ComboBox fx:id="biblatexMode" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
</GridPane>
<CheckBox fx:id="inspectionWarningDuplicate"
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/model/database/BibDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ public class BibDatabase {
private String epilog = "";
private String sharedDatabaseID;

public BibDatabase() {
this.registerListener(new KeyChangeListener(this));
}

public BibDatabase(List<BibEntry> entries) {
this();
insertEntries(entries);
}

public BibDatabase() {
this.registerListener(new KeyChangeListener(this));
}

/**
* @param toResolve maybenull The text to resolve.
* @param database maybenull The database to use for resolving the text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.jabref.model.entry.field.BibField;
import org.jabref.model.entry.field.FieldFactory;
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions;
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.EntryTypeFactory;
Expand All @@ -20,7 +21,7 @@
public class BibEntryTypesManager {
public static final String ENTRYTYPE_FLAG = "jabref-entrytype: ";
private final InternalEntryTypes BIBTEX = new InternalEntryTypes(Stream.concat(BibtexEntryTypeDefinitions.ALL.stream(), IEEETranEntryTypeDefinitions.ALL.stream()).collect(Collectors.toList()));
private final InternalEntryTypes BIBLATEX = new InternalEntryTypes(BiblatexEntryTypeDefinitions.ALL);
private final InternalEntryTypes BIBLATEX = new InternalEntryTypes(Stream.concat(BiblatexEntryTypeDefinitions.ALL.stream(), BiblatexSoftwareEntryTypeDefinitions.ALL.stream()).collect(Collectors.toList()));

public BibEntryTypesManager() {
}
Expand Down Expand Up @@ -97,6 +98,7 @@ public List<BibEntryType> getAllCustomTypes(BibDatabaseMode mode) {
} else {
return customizedTypes.stream()
.filter(entryType -> BiblatexEntryTypeDefinitions.ALL.stream().noneMatch(biblatexType -> biblatexType.getType().equals(entryType.getType())))
.filter(entryType -> BiblatexSoftwareEntryTypeDefinitions.ALL.stream().noneMatch(biblatexSoftware -> biblatexSoftware.getType().equals(entryType.getType())))
.collect(Collectors.toList());
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/jabref/model/entry/field/StandardField.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ public enum StandardField implements Field {
FOREWORD("foreword", FieldProperty.PERSON_NAMES),
FOLDER("folder"),
GENDER("gender", FieldProperty.GENDER),
HALID("hal_id"),
HALVERSION("hal_version"),
HOLDER("holder", FieldProperty.PERSON_NAMES),
HOWPUBLISHED("howpublished"),
IDS("ids", FieldProperty.MULTIPLE_ENTRY_LINK),
INSTITUTION("institution"),
INTRODUCTION("introduction", FieldProperty.PERSON_NAMES),
INTRODUCEDIN("introducedin"),
ISBN("isbn", "ISBN", FieldProperty.ISBN),
ISRN("isrn", "ISRN"),
ISSN("issn", "ISSN"),
Expand All @@ -74,6 +77,7 @@ public enum StandardField implements Field {
LANGUAGE("language", FieldProperty.LANGUAGE),
LABEL("label"),
LIBRARY("library"),
LICENSE("license"),
LOCATION("location"),
MAINSUBTITLE("mainsubtitle", FieldProperty.BOOK_NAME),
MAINTITLE("maintitle", FieldProperty.BOOK_NAME),
Expand All @@ -98,7 +102,10 @@ public enum StandardField implements Field {
PUBSTATE("pubstate", FieldProperty.PUBLICATION_STATE),
PRIMARYCLASS("primaryclass"),
RELATED("related", FieldProperty.MULTIPLE_ENTRY_LINK),
RELATEDTYPE("relatedtype"),
RELATEDSTRING("relatedstring"),
REPORTNO("reportno"),
REPOSITORY("repository"),
REVIEW("review"),
REVISION("revision"),
SCHOOL("school"),
Expand All @@ -109,6 +116,7 @@ public enum StandardField implements Field {
SORTKEY("sortkey"),
SORTNAME("sortname", FieldProperty.PERSON_NAMES),
SUBTITLE("subtitle"),
SWHID("swhid"),
TITLE("title"),
TITLEADDON("titleaddon"),
TRANSLATOR("translator", FieldProperty.PERSON_NAMES),
Expand Down
Loading

0 comments on commit e672c24

Please sign in to comment.