Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into writebackupToTemp
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix icon issue (#6858)
  No sync of specialfields to keywords as default (#6846)
  Don't show entry editor on startup (#6861)
  Sort-in root classes into packages (#6853)
  Add "Fetchers" to DevDocs
  • Loading branch information
Siedlerchr committed Sep 4, 2020
2 parents 58b0091 + 1283f9f commit 1043d9e
Show file tree
Hide file tree
Showing 172 changed files with 373 additions and 413 deletions.
Empty file added .Rhistory
Empty file.
2 changes: 1 addition & 1 deletion .idea/runConfigurations/JabRef_Main.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We restructured the 'File' tab and extracted some parts into the 'Linked files' tab [#6779](https://github.com/JabRef/jabref/pull/6779)
- JabRef now offers journal lists from <https://abbrv.jabref.org>. JabRef the lists which use a dot inside the abbreviations. [#5749](https://github.com/JabRef/jabref/pull/5749)
- We removed two useless preferences in the groups preferences dialog. [#6836](https://github.com/JabRef/jabref/pull/6836)
- Synchronization of SpecialFields to keywords is now disabled by default. [#6621](https://github.com/JabRef/jabref/issues/6621)
- JabRef no longer opens the entry editor with the first entry on startup [6855](https://github.com/JabRef/jabref/issues/6855)

### Fixed

- We fixed an issue changing the icon link_variation_off that is not meaningful. [#6834][https://github.com/JabRef/jabref/issues/6834]
- We fixed an issue where the `.sav` file was not deleted upon exiting JabRef. [#6109](https://github.com/JabRef/jabref/issues/6109)
- We fixed a linked identifier icon inconsistency. [#6705](https://github.com/JabRef/jabref/issues/6705)
- We fixed the wrong behavior that font size changes are not reflected in dialogs. [#6039](https://github.com/JabRef/jabref/issues/6039)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ java {
}

application {
mainClassName = "$moduleName/org.jabref.JabRefLauncher"
mainClassName = "$moduleName/org.jabref.gui.JabRefLauncher"
}

// TODO: Ugly workaround to temporarily ignore build errors to dependencies of latex2unicode
Expand Down
2 changes: 1 addition & 1 deletion buildres/linux/JabRef.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Type=Application
DESKTOP_MIMES
Categories=DEPLOY_BUNDLE_CATEGORY
Keywords=bibtex;biblatex;latex;bibliography
StartupWMClass=org.jabref.JabRefMain
StartupWMClass=org.jabref.gui.JabRefMain
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [Code Quality](advanced-reading/code-quality.md)
* [Recommendations for UI design](advanced-reading/ui-recommendations.md)
* [Custom SVG icons](advanced-reading/custom-svg-icons.md)
* [Working on fetchers](advanced-reading/fetchers.md)
* [Creating a binary and debug it](advanced-reading/jpackage.md)
* [JabRef and Software Engineering](teaching.md)
* [Readings on Coding](readings-on-coding/README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-reading/jpackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Sometimes issues with modularity only arise in the installed version and do not
3. Modify the `build\image\JabRef\runtime\bin\Jabref.bat` file, replace the last line with

```text
pushd %DIR% & %JAVA_EXEC% -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -p "%~dp0/../app" -m org.jabref/org.jabref.JabRefLauncher %* & popd
pushd %DIR% & %JAVA_EXEC% -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -p "%~dp0/../app" -m org.jabref/org.jabref.gui.JabRefLauncher %* & popd
```

4. Open your IDE and add a "Remote Debugging Configuration" for `localhost:8000`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Make sure your Eclipse installation us up to date, Eclipse JEE 2020-03 or newer
3. Open or import the existing project in Eclipse as Java project.
* 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\)
4. Create a run/debug configuration for the main class `org.jabref.gui.JabRefLauncher` and/or for `org.jabref.gui.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%20%281%29.png)
Expand Down
2 changes: 1 addition & 1 deletion snap/local/JabRef-launcher
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/sh
DIR="$SNAP/lib/runtime/bin"
"$DIR/java" -p "$DIR/../app" -m org.jabref/org.jabref.JabRefLauncher "$@"
"$DIR/java" -p "$DIR/../app" -m org.jabref/org.jabref.gui.JabRefLauncher "$@"
2 changes: 1 addition & 1 deletion src/jmh/java/org/jabref/benchmarks/Benchmarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Random;
import java.util.stream.Collectors;

import org.jabref.Globals;
import org.jabref.gui.Globals;
import org.jabref.logic.exporter.BibtexDatabaseWriter;
import org.jabref.logic.exporter.SavePreferences;
import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/architecture/AllowedToUseAwt.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.jabref.architecture;

/**
* Annotation to indicate that this logic class can access AWT
*/
public @interface AllowedToUseAwt {

// The rationale
String value();
}
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import java.util.Set;
import java.util.prefs.BackingStoreException;

import org.jabref.Globals;
import org.jabref.JabRefException;
import org.jabref.gui.Globals;
import org.jabref.gui.externalfiles.AutoSetFileLinksUtil;
import org.jabref.gui.externalfiletype.ExternalFileTypes;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.logic.JabRefException;
import org.jabref.logic.citationkeypattern.CitationKeyGenerator;
import org.jabref.logic.exporter.AtomicFileWriter;
import org.jabref.logic.exporter.BibDatabaseWriter;
Expand Down Expand Up @@ -48,6 +48,7 @@
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.DummyFileUpdateMonitor;
import org.jabref.preferences.SearchPreferences;

import com.google.common.base.Throwables;
Expand Down Expand Up @@ -83,7 +84,7 @@ private static Optional<ParserResult> importToOpenBase(String argument) {
}

private static Optional<ParserResult> importBibtexToOpenBase(String argument) {
BibtexParser parser = new BibtexParser(Globals.prefs.getImportFormatPreferences(), Globals.getFileUpdateMonitor());
BibtexParser parser = new BibtexParser(Globals.prefs.getImportFormatPreferences(), new DummyFileUpdateMonitor());
try {
List<BibEntry> entries = parser.parseEntries(argument);
ParserResult result = new ParserResult(entries);
Expand Down Expand Up @@ -143,7 +144,7 @@ private static Optional<ParserResult> importFile(Path file, String importFormat)
// * means "guess the format":
System.out.println(Localization.lang("Importing in unknown format") + ": " + file);

ImportFormatReader.UnknownFormatImport importResult = Globals.IMPORT_FORMAT_READER.importUnknownFormat(file, Globals.getFileUpdateMonitor());
ImportFormatReader.UnknownFormatImport importResult = Globals.IMPORT_FORMAT_READER.importUnknownFormat(file, new DummyFileUpdateMonitor());

System.out.println(Localization.lang("Format used") + ": " + importResult.format);
return Optional.of(importResult.parserResult);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;

import org.jabref.Globals;
import org.jabref.gui.Globals;
import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fetcher.CrossRef;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import org.jabref.Globals;
import org.jabref.gui.Globals;
import org.jabref.logic.l10n.Localization;

import org.apache.commons.cli.CommandLine;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;

import org.jabref.Globals;
import org.jabref.gui.autocompleter.AutoCompletePreferences;
import org.jabref.gui.autocompleter.PersonNameSuggestionProvider;
import org.jabref.gui.autocompleter.SuggestionProviders;
Expand Down Expand Up @@ -120,8 +119,6 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas
this.getDatabase().registerListener(new UpdateTimestampListener(Globals.prefs));

this.entryEditor = new EntryEditor(this, externalFileTypes);
// Open entry editor for first entry on start up.
Platform.runLater(this::clearAndSelectFirst);
}

@Subscribe
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/BasePanelPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;

import org.jabref.Globals;
import org.jabref.gui.autocompleter.AutoCompletePreferences;
import org.jabref.gui.entryeditor.EntryEditorPreferences;
import org.jabref.gui.keyboard.KeyBindingRepository;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/ClipBoardManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import javafx.scene.input.DataFormat;
import javafx.scene.input.MouseButton;

import org.jabref.Globals;
import org.jabref.architecture.AllowedToUseAwt;
import org.jabref.logic.bibtex.BibEntryWriter;
import org.jabref.logic.bibtex.FieldWriter;
import org.jabref.logic.importer.FetcherException;
Expand All @@ -37,6 +37,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@AllowedToUseAwt("Requires ava.awt.datatransfer.Clipboard")
public class ClipBoardManager {

public static final DataFormat XML = new DataFormat("application/xml");
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jabref/gui/DefaultInjector.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import javax.swing.undo.UndoManager;

import org.jabref.Globals;
import org.jabref.JabRefGUI;
import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.journals.JournalAbbreviationRepository;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/EntryTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import javafx.scene.layout.FlowPane;
import javafx.stage.Screen;

import org.jabref.Globals;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.ControlHelper;
import org.jabref.gui.util.IconValidationDecorator;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/EntryTypeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import javafx.concurrent.Task;
import javafx.concurrent.Worker;

import org.jabref.Globals;
import org.jabref.gui.duplicationFinder.DuplicateResolverDialog;
import org.jabref.logic.citationkeypattern.CitationKeyGenerator;
import org.jabref.logic.database.DuplicateCheck;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/FXDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import javafx.stage.Modality;
import javafx.stage.Stage;

import org.jabref.Globals;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.gui.keyboard.KeyBindingRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref;
package org.jabref.gui;

import org.jabref.gui.util.DefaultTaskExecutor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.jabref;
package org.jabref.gui;

import java.awt.GraphicsEnvironment;
import java.util.Optional;
import java.util.UUID;

import javafx.stage.Screen;

import org.jabref.gui.ClipBoardManager;
import org.jabref.gui.StateManager;
import org.jabref.architecture.AllowedToUseAwt;
import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.util.DefaultFileUpdateMonitor;
Expand All @@ -33,6 +32,7 @@
* @deprecated try to use {@link StateManager} and {@link org.jabref.preferences.PreferencesService}
*/
@Deprecated
@AllowedToUseAwt("Requires AWT for headless check")
public class Globals {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref;
package org.jabref.gui;

import java.util.Collection;
import java.util.Collections;
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

import org.jabref.Globals;
import org.jabref.JabRefExecutorService;
import org.jabref.gui.actions.ActionFactory;
import org.jabref.gui.actions.ActionHelper;
import org.jabref.gui.actions.SimpleCommand;
Expand Down Expand Up @@ -219,9 +217,7 @@ private void initDragAndDrop() {
}
});

this.getScene().setOnDragExited(event -> {
tabbedPane.getTabs().remove(dndIndicator);
});
this.getScene().setOnDragExited(event -> tabbedPane.getTabs().remove(dndIndicator));

this.getScene().setOnDragDropped(event -> {
tabbedPane.getTabs().remove(dndIndicator);
Expand Down Expand Up @@ -793,7 +789,7 @@ private MenuBar createMenu() {
factory.createMenuItem(StandardActions.MASS_SET_FIELDS, new MassSetFieldsAction(stateManager, dialogService, undoManager))
);

if (Globals.prefs.getBoolean(JabRefPreferences.SPECIALFIELDSENABLED)) {
if (Globals.prefs.getSpecialFieldsPreferences().isSpecialFieldsEnabled()) {
edit.getItems().addAll(
new SeparatorMenuItem(),
// ToDo: SpecialField needs the active BasePanel to mark it as changed.
Expand Down Expand Up @@ -1034,7 +1030,7 @@ public void addParserResult(ParserResult parserResult, boolean focusPanel) {
} else {
// only add tab if DB is not already open
Optional<BasePanel> panel = getBasePanelList().stream()
.filter(p -> p.getBibDatabaseContext().getDatabasePath().equals(parserResult.getFile()))
.filter(p -> p.getBibDatabaseContext().getDatabasePath().equals(parserResult.getPath()))
.findFirst();

if (panel.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref;
package org.jabref.gui;

import java.io.File;
import java.sql.SQLException;
Expand All @@ -11,8 +11,6 @@
import javafx.stage.Screen;
import javafx.stage.Stage;

import org.jabref.gui.BasePanel;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.dialogs.BackupUIManager;
import org.jabref.gui.help.VersionWorker;
import org.jabref.gui.icon.IconTheme;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref;
package org.jabref.gui;

/**
* JabRef launcher: This just starts JabRefMain. It is there because to have the name consistent to other Java applications.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref;
package org.jabref.gui;

import java.net.Authenticator;

Expand All @@ -9,7 +9,6 @@

import org.jabref.cli.ArgumentProcessor;
import org.jabref.cli.JabRefCLI;
import org.jabref.gui.FXDialog;
import org.jabref.gui.remote.JabRefMessageHandler;
import org.jabref.logic.exporter.ExporterFactory;
import org.jabref.logic.journals.JournalAbbreviationLoader;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/SendAsEMailAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.ArrayList;
import java.util.List;

import org.jabref.Globals;
import org.jabref.architecture.AllowedToUseAwt;
import org.jabref.gui.actions.ActionHelper;
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.desktop.JabRefDesktop;
Expand All @@ -34,6 +34,7 @@
* are opened. This feature is disabled by default and can be switched on at
* preferences/external programs
*/
@AllowedToUseAwt("Requires AWT to send an email")
public class SendAsEMailAction extends SimpleCommand {

private static final Logger LOGGER = LoggerFactory.getLogger(SendAsEMailAction.class);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/SidePaneManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.Map;
import java.util.stream.Stream;

import org.jabref.Globals;
import org.jabref.gui.groups.GroupSidePane;
import org.jabref.gui.importer.fetcher.WebSearchPane;
import org.jabref.gui.openoffice.OpenOfficeSidePanel;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/actions/JabRefAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import javafx.beans.binding.Bindings;

import org.jabref.Globals;
import org.jabref.gui.Globals;
import org.jabref.gui.keyboard.KeyBindingRepository;

import de.saxsys.mvvmfx.utils.commands.Command;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

import org.jabref.Globals;
import org.jabref.gui.DialogService;
import org.jabref.gui.Globals;
import org.jabref.gui.StateManager;
import org.jabref.gui.externalfiles.ImportHandler;
import org.jabref.gui.externalfiletype.ExternalFileTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import javafx.scene.control.ButtonType;

import org.jabref.Globals;
import org.jabref.gui.BasePanel;
import org.jabref.gui.Globals;
import org.jabref.gui.util.BaseDialog;
import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern;
import org.jabref.logic.l10n.Localization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;

import org.jabref.Globals;
import org.jabref.gui.BasePanel;
import org.jabref.gui.Globals;
import org.jabref.gui.actions.ActionFactory;
import org.jabref.gui.actions.StandardActions;
import org.jabref.gui.help.HelpAction;
Expand Down
Loading

0 comments on commit 1043d9e

Please sign in to comment.