Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bibdeskImport
Browse files Browse the repository at this point in the history
* upstream/main:
  Convert RemoveBracesFormatterTest to @ParameterizedTest (JabRef#11033)
  Update teaching.md
  Remove non-existing recipe (JabRef#11029)
  Update CSL styles (JabRef#11031)
  Clean up defintions of entry types (JabRef#11013)
  Fix log file path on Windows (JabRef#11028)
  Change to rolling logs (JabRef#11023)
  • Loading branch information
Siedlerchr committed Mar 15, 2024
2 parents cd77b05 + f5f92f9 commit bfc302f
Show file tree
Hide file tree
Showing 30 changed files with 434 additions and 343 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We changed the duplicate handling in the Import entries dialog. Potential duplicate entries are marked with an icon and importing will now trigger the merge dialog [#10914](https://github.com/JabRef/jabref/pull/10914)
- We made the command "Push to TexShop" more robust to allow cite commands with a character before the first slash. [forum#2699](https://discourse.jabref.org/t/push-to-texshop-mac/2699/17?u=siedlerchr)
- We only show the notification "Saving library..." if the library contains more than 2000 entries. [#9803](https://github.com/JabRef/jabref/issues/9803)
- JabRef now keeps previous log files upon start. [#11023](https://github.com/JabRef/jabref/pull/11023)
- We enhanced the dialog for adding new fields in the content selector with a selection box containing a list of standard fields. [#10912](https://github.com/JabRef/jabref/pull/10912)
- We store the citation relations in an LRU cache to avoid bloating the memory and out-of-memory exceptions. [#10958](https://github.com/JabRef/jabref/issues/10958)
- Keywords filed are now displayed as tags. [#10910](https://github.com/JabRef/jabref/pull/10910)
Expand Down
4 changes: 1 addition & 3 deletions docs/teaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ Course: BSc Computer Science Individual Project
* Summary: Students experience the procedure of finding and fixing small and medium issues in an open source project.
* Successfully run in 2022/2023

Do you have additions/suggestions for improvement?

#### Northern Arizona University (NAU), USA

Course [CS499 - Open Source Software Development](https://github.com/igorsteinmacher/CS499-OSS)
Expand Down Expand Up @@ -129,7 +127,7 @@ Course "Programming and Software Development" as part of the [BSc Software Engin
Course [DD2480 Software Engineering Fundamentals](https://www.kth.se/student/kurser/kurs/DD2480?l=en)

* Summary: Groups of students from three to five persons experienced the whole software engineering process within a week: From the requirements' specification to the final pull request.
* Successfully run in 2020
* Successfully run in 2020, 2024, and other years.

### Portuguese

Expand Down
2 changes: 0 additions & 2 deletions rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ recipeList:
- org.openrewrite.java.migrate.lang.StringFormatted
- org.openrewrite.java.migrate.util.SequencedCollection

- org.openrewrite.java.recipes.UseJavaParserBuilderInJavaTemplate

- org.openrewrite.java.RemoveObjectsIsNull
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences

Expand Down
19 changes: 9 additions & 10 deletions src/main/java/org/jabref/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
import java.util.List;
import java.util.Map;

import org.jabref.architecture.AllowedToUseStandardStreams;
import org.jabref.cli.ArgumentProcessor;
import org.jabref.cli.JabRefCLI;
import org.jabref.gui.Globals;
import org.jabref.gui.JabRefGUI;
import org.jabref.logic.UiCommand;
import org.jabref.logic.journals.JournalAbbreviationLoader;
import org.jabref.logic.journals.predatory.PredatoryJournalListLoader;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.net.ProxyAuthenticator;
import org.jabref.logic.net.ProxyPreferences;
import org.jabref.logic.net.ProxyRegisterer;
Expand Down Expand Up @@ -48,7 +46,6 @@
* - Handle the command line arguments
* - Start the JavaFX application (if not in cli mode)
*/
@AllowedToUseStandardStreams("Direct output to the user")
public class Launcher {
private static Logger LOGGER;
private static boolean isDebugEnabled;
Expand Down Expand Up @@ -140,11 +137,14 @@ private static void addLogToDisk() {
// The "Shared File Writer" is explained at
// https://tinylog.org/v2/configuration/#shared-file-writer
Map<String, String> configuration = Map.of(
"writerFile", "shared file",
"writerFile.level", isDebugEnabled ? "debug" : "info",
"level", isDebugEnabled ? "debug" : "info",
"writerFile.file", directory.resolve("log.txt").toString(),
"writerFile.charset", "UTF-8");
"writerFile", "rolling file",
"writerFile.level", isDebugEnabled ? "debug" : "info",
// We need to manually join the path, because ".resolve" does not work on Windows, because ":" is not allowed in file names on Windows
"writerFile.file", directory + File.separator + "log_{date:yyyy-MM-dd_HH-mm-ss}.txt",
"writerFile.charset", "UTF-8",
"writerFile.policies", "startup",
"writerFile.backups", "30");

configuration.forEach(Configuration::set);
initializeLogger();
Expand All @@ -169,9 +169,8 @@ private static boolean handleMultipleAppInstances(String[] args, RemotePreferenc
LOGGER.debug("Passing arguments passed on to running JabRef...");
if (remoteClient.sendCommandLineArguments(args)) {
// So we assume it's all taken care of, and quit.
LOGGER.debug("Arguments passed on to running JabRef instance.");
// Used for script-use output etc. to the user
System.out.println(Localization.lang("Arguments passed on to running JabRef instance. Shutting down."));
// Output to both to the log and the screen. Therefore, we do not have an additional System.out.println.
LOGGER.info("Arguments passed on to running JabRef instance. Shutting down.");
return false;
} else {
LOGGER.warn("Could not communicate with other running JabRef instance.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.preferences.PreferencesService;

public class OptionalFields2Tab extends OptionalFieldsTabBase {
public class DetailOptionalFieldsTab extends OptionalFieldsTabBase {

public static final String NAME = "Optional fields 2";

public OptionalFields2Tab(BibDatabaseContext databaseContext,
SuggestionProviders suggestionProviders,
UndoManager undoManager,
DialogService dialogService,
PreferencesService preferences,
StateManager stateManager,
ThemeManager themeManager,
IndexingTaskManager indexingTaskManager,
BibEntryTypesManager entryTypesManager,
TaskExecutor taskExecutor,
JournalAbbreviationRepository journalAbbreviationRepository) {
public DetailOptionalFieldsTab(BibDatabaseContext databaseContext,
SuggestionProviders suggestionProviders,
UndoManager undoManager,
DialogService dialogService,
PreferencesService preferences,
StateManager stateManager,
ThemeManager themeManager,
IndexingTaskManager indexingTaskManager,
BibEntryTypesManager entryTypesManager,
TaskExecutor taskExecutor,
JournalAbbreviationRepository journalAbbreviationRepository) {
super(
Localization.lang("Optional fields 2"),
false,
Expand Down
26 changes: 12 additions & 14 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,45 +249,45 @@ private void navigateToNextEntry() {
private List<EntryEditorTab> createTabs() {
entryEditorTabs.add(new PreviewTab(databaseContext, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), taskExecutor));

// Required, optional, deprecated, and "other" fields
// Required, optional (important+detail), deprecated, and "other" fields
entryEditorTabs.add(new RequiredFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new OptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new OptionalFields2Tab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new ImportantOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new DetailOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new DeprecatedFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));
entryEditorTabs.add(new OtherFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), bibEntryTypesManager, taskExecutor, journalAbbreviationRepository));

// Comment Tab: Tab for general and user-specific comments
entryEditorTabs.add(new CommentsTab(preferencesService, databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), taskExecutor, journalAbbreviationRepository));

// General fields from preferences
// First, remove all tabs that are already handled above or below; except for the source tab (which has different titles for BibTeX and BibLaTeX mode)
// The preferences allow to configure tabs to show (e.g.,"General", "Abstract")
// These should be shown. Already hard-coded ones should be removed.
Map<String, Set<Field>> entryEditorTabList = new HashMap<>(entryEditorPreferences.getEntryEditorTabs());
entryEditorTabList.remove(PreviewTab.NAME);
entryEditorTabList.remove(RequiredFieldsTab.NAME);
entryEditorTabList.remove(OptionalFieldsTab.NAME);
entryEditorTabList.remove(OptionalFields2Tab.NAME);
entryEditorTabList.remove(ImportantOptionalFieldsTab.NAME);
entryEditorTabList.remove(DetailOptionalFieldsTab.NAME);
entryEditorTabList.remove(DeprecatedFieldsTab.NAME);
entryEditorTabList.remove(OtherFieldsTab.NAME);
entryEditorTabList.remove(CommentsTab.NAME);
entryEditorTabList.remove(MathSciNetTab.NAME);
entryEditorTabList.remove(FileAnnotationTab.NAME);
entryEditorTabList.remove(SciteTab.NAME);
// CitationRelationsTab
entryEditorTabList.remove(RelatedArticlesTab.NAME);
// SourceTab -- not listed, because it has different names for BibTeX and biblatex mode
entryEditorTabList.remove(LatexCitationsTab.NAME);
entryEditorTabList.remove(FulltextSearchResultsTab.NAME);
entryEditorTabList.remove(SciteTab.NAME);
entryEditorTabList.remove("Comments");
// Then show the remaining configured

for (Map.Entry<String, Set<Field>> tab : entryEditorTabList.entrySet()) {
entryEditorTabs.add(new UserDefinedFieldsTab(tab.getKey(), tab.getValue(), databaseContext, libraryTab.getSuggestionProviders(), undoManager, dialogService, preferencesService, stateManager, themeManager, libraryTab.getIndexingTaskManager(), taskExecutor, journalAbbreviationRepository));
}

// "Special" tabs
entryEditorTabs.add(new MathSciNetTab());
entryEditorTabs.add(new FileAnnotationTab(libraryTab.getAnnotationCache()));
entryEditorTabs.add(new SciteTab(preferencesService, taskExecutor, dialogService));
entryEditorTabs.add(new CitationRelationsTab(entryEditorPreferences, dialogService, databaseContext,
undoManager, stateManager, fileMonitor, preferencesService, libraryTab, taskExecutor));
entryEditorTabs.add(new RelatedArticlesTab(entryEditorPreferences, preferencesService, dialogService, taskExecutor));

sourceTab = new SourceTab(
databaseContext,
undoManager,
Expand All @@ -299,9 +299,7 @@ private List<EntryEditorTab> createTabs() {
bibEntryTypesManager,
keyBindingRepository);
entryEditorTabs.add(sourceTab);

entryEditorTabs.add(new LatexCitationsTab(databaseContext, preferencesService, taskExecutor, dialogService));

entryEditorTabs.add(new FulltextSearchResultsTab(stateManager, preferencesService, dialogService, taskExecutor));

return entryEditorTabs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.preferences.PreferencesService;

public class OptionalFieldsTab extends OptionalFieldsTabBase {
public class ImportantOptionalFieldsTab extends OptionalFieldsTabBase {

public static final String NAME = "Optional fields";

public OptionalFieldsTab(BibDatabaseContext databaseContext,
SuggestionProviders suggestionProviders,
UndoManager undoManager,
DialogService dialogService,
PreferencesService preferences,
StateManager stateManager,
ThemeManager themeManager,
IndexingTaskManager indexingTaskManager,
BibEntryTypesManager entryTypesManager,
TaskExecutor taskExecutor,
JournalAbbreviationRepository journalAbbreviationRepository) {
public ImportantOptionalFieldsTab(BibDatabaseContext databaseContext,
SuggestionProviders suggestionProviders,
UndoManager undoManager,
DialogService dialogService,
PreferencesService preferences,
StateManager stateManager,
ThemeManager themeManager,
IndexingTaskManager indexingTaskManager,
BibEntryTypesManager entryTypesManager,
TaskExecutor taskExecutor,
JournalAbbreviationRepository journalAbbreviationRepository) {
super(
Localization.lang("Optional fields"),
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

public class OptionalFieldsTabBase extends FieldsEditorTab {
private final BibEntryTypesManager entryTypesManager;
private final boolean isPrimaryOptionalFields;
private final boolean isImportantOptionalFields;

public OptionalFieldsTabBase(String title,
boolean isPrimaryOptionalFields,
boolean isImportantOptionalFields,
BibDatabaseContext databaseContext,
SuggestionProviders suggestionProviders,
UndoManager undoManager,
Expand All @@ -54,7 +54,7 @@ public OptionalFieldsTabBase(String title,
journalAbbreviationRepository,
indexingTaskManager);
this.entryTypesManager = entryTypesManager;
this.isPrimaryOptionalFields = isPrimaryOptionalFields;
this.isImportantOptionalFields = isImportantOptionalFields;
setText(title);
setTooltip(new Tooltip(Localization.lang("Show optional fields")));
setGraphic(IconTheme.JabRefIcons.OPTIONAL.getGraphicNode());
Expand All @@ -65,10 +65,10 @@ protected SequencedSet<Field> determineFieldsToShow(BibEntry entry) {
BibDatabaseMode mode = databaseContext.getMode();
Optional<BibEntryType> entryType = entryTypesManager.enrich(entry.getType(), mode);
if (entryType.isPresent()) {
if (isPrimaryOptionalFields) {
return entryType.get().getPrimaryOptionalFields();
if (isImportantOptionalFields) {
return entryType.get().getImportantOptionalFields();
} else {
return entryType.get().getSecondaryOptionalNotDeprecatedFields(mode);
return entryType.get().getDetailOptionalNotDeprecatedFields(mode);
}
} else {
// Entry type unknown -> treat all fields as required (thus no optional fields)
Expand Down
Loading

0 comments on commit bfc302f

Please sign in to comment.