Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixExporterSelect…
Browse files Browse the repository at this point in the history
…ionCaseInsensitive

* upstream/master: (25 commits)
  ActionHelper to test for present file (#6151)
  Reduce memory footprint (#6298)
  Add missing abbreviated journal names (#6292)
  fix l10n again
  fix checkstyle
  fix l10n
  Try to minimize CodeCov "wrong metrics"
  Showing correct icon on main table linked files column (#6264)
  Fix labels for outdated dependency issue
  Change one more line
  Squashed 'src/main/resources/csl-styles/' changes from c31d9ca..c1793d2
  Resolve unit test from failing
  Add one more change
  Fix errors
  RIS import takes the wrong date and duplicates abstract (#6272)
  Update EntryTypeView.java
  Change to the old school format
  Fix XmpExporterTest (#6289)
  Add checkstyle screenshot (and lint guidelines-...md)
  Squashed 'src/main/resources/csl-styles/' changes from db54e56..c31d9ca
  ...
  • Loading branch information
Siedlerchr committed Apr 17, 2020
2 parents 7dd7266 + 07cb5b8 commit 2ef5f42
Show file tree
Hide file tree
Showing 50 changed files with 6,351 additions and 488 deletions.
2 changes: 1 addition & 1 deletion .github/outdatedDependencies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Outdated dependencies
labels: code-quality, dependencies
labels: t: dependencies
---
[There are outdated dependencies!](https://github.com/JabRef/jabref/actions?query=is%3Afailure+workflow%3A%22Check+dependencies%22)
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash);
env:
CI: "false" # we pretend to run locally - even if tests fail on the CI, they count towards test coverage
CI: "true"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DBMS: "postgresql"
# This is https://github.com/marketplace/actions/gradle-wrapper-validation
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the INSPIRE fetcher was no longer working [#6229](https://github.com/JabRef/jabref/issues/6229)
- We fixed an issue where custom exports with an uppercase file extension could not be selected for "Copy...-> Export to Clipboard" [#6285](https://github.com/JabRef/jabref/issues/6285)

- We fixed the display of icon both in the main table and linked file editor. [#6169](https://github.com/JabRef/jabref/issues/6169)

### Removed

Expand Down Expand Up @@ -87,6 +88,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622)
- We fixed an issue where a warning was displayed when the title content is made up of two sentences. [#5832](https://github.com/JabRef/jabref/issues/5832)
- We fixed an issue where an exception was thrown when adding a save action without a selected formatter in the library properties [#6069](https://github.com/JabRef/jabref/issues/6069)
- We fixed an issue when an "Abstract field" was duplicating text, when importing from RIS file (Neurons) [#6065](https://github.com/JabRef/jabref/issues/6065)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- BeforeExecutionFileFilters is required for sources that are based on java14 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="AuthorAndsReplacer.java|Ordinal.java" />
<property name="fileNamePattern" value="AuthorAndsReplacer.java|Ordinal.java|EntryTypeView.java" />
</module>

<module name="SuppressionFilter">
Expand Down
68 changes: 35 additions & 33 deletions docs/guidelines-for-setting-up-a-local-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ If you do not yet have a GitHub account, please [create one](https://github.com/

Proposals for account names:

- Login similar to your university account. Example: `koppor`
- Use your last name prefixed by the first letter of your first name. Example: `okopp`
- Use `firstname.lastname`. Example: `oliver.kopp`
* Login similar to your university account. Example: `koppor`
* Use your last name prefixed by the first letter of your first name. Example: `okopp`
* Use `firstname.lastname`. Example: `oliver.kopp`

You can hide your email adress by following the recommendations at <https://saraford.net/2017/02/19/how-to-hide-your-email-address-in-your-git-commits-but-still-get-contributions-to-show-up-on-your-github-profile-050/>.

Expand All @@ -41,9 +41,9 @@ That account then be used for develoment mailing lists, mail exchange with other

Examples:

- Same login as in GitHub (see above). Example: `koppor@gmail.com`
- "`it`" in the name. Example: `kopp.it@gmail.com`
- Use the university login. Example: `st342435@stud.uni-stuttgart.de`
* Same login as in GitHub (see above). Example: `koppor@gmail.com`
* "`it`" in the name. Example: `kopp.it@gmail.com`
* Use the university login. Example: `st342435@stud.uni-stuttgart.de`

### git

Expand Down Expand Up @@ -172,15 +172,18 @@ Contributions to JabRef's source code need to have a code formatting that is con
2. Close the settings afterwards and restart IntelliJ
* Go to **File \| Settings \| Editor \| Code Style**
* Click on the settings wheel \(next to the scheme chooser\), then click "Import Scheme"
* Select the IntelliJ configuration file `config/IntelliJ Code Style.xml`.
* Select the IntelliJ configuration file `config/IntelliJ Code Style.xml`
* Go to **File \| Settings \| Checkstyle \| Configuration File**
1. Import the CheckStyle configuration file by clicking the \[+\] button
2. For the description provide e.g. "JabRef"
2. For the description provide "JabRef"
3. Click "Browse" and choose `config/checkstyle/checkstyle.xml`
4. Check "Store relative to project location"
5. Click "Next" and "Finish"
6. Activate the CheckStyle configuration file by ticking it in the list
7. Save settings by clicking "OK"
7. Ensure that CheckStyle version 8.31 (or higher) is selected
8. Save settings by clicking "OK"

![checkstyle settings](images/intellij-checkstyle-settings.png)

#### Troubleshooting when using both IDEA and Eclipse

Expand All @@ -200,7 +203,7 @@ For Eclipse 2020-03 you need to install [jdk14 support](https://marketplace.ecli
1. Run `./gradlew run` to generate all resources and to check if JabRef runs.
* The JabRef GUI should finally appear.
* This step is only required once.
2. Run `./gradlew eclipse`
2. Run `./gradlew eclipse`
* **This must always be executed, when there are new upstream changes.**
3. Copy the file `Log4jPlugins.java` from `build/generated/sources/annotationProcessor/java/main/org/jabref/gui/logging/plugins` to `src/main/java/org/jabref/gui/logging/plugins/`
* Usually, the folder `plugins` must be created for that.
Expand All @@ -210,29 +213,28 @@ For Eclipse 2020-03 you need to install [jdk14 support](https://marketplace.ecli
5. Create a run/debug configuration for the main class `org.jabref.JabRefLauncher` and/or for `org.jabref.JabRefMain` \(both can be used equivalently\)
* In the tab "Arguments" of the run/debug configuration, enter the following runtime VM arguments:

* Set "VM Arguments" to:

```text
--patch-module test=fastparse_2.12-1.0.0.jar
--patch-module test2=fastparse-utils_2.12-1.0.0.jar
--patch-module test3=sourcecode_2.12-0.1.4.jar
--add-exports javafx.controls/com.sun.javafx.scene.control=org.jabref
--add-exports org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref
--add-exports javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.event=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.collections=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.runtime=org.controlsfx.controls
--add-exports javafx.web/com.sun.webkit=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix
--add-exports com.oracle.truffle.regex/com.oracle.truffle.regex=org.graalvm.truffle
--patch-module org.jabref=build\resources\main
```
```text
--patch-module test=fastparse_2.12-1.0.0.jar
--patch-module test2=fastparse-utils_2.12-1.0.0.jar
--patch-module test3=sourcecode_2.12-0.1.4.jar
--add-exports javafx.controls/com.sun.javafx.scene.control=org.jabref
--add-exports org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref
--add-exports javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.event=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.collections=org.controlsfx.controls
--add-exports javafx.base/com.sun.javafx.runtime=org.controlsfx.controls
--add-exports javafx.web/com.sun.webkit=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix
--add-exports com.oracle.truffle.regex/com.oracle.truffle.regex=org.graalvm.truffle
--patch-module org.jabref=build\resources\main
```
6. Optional: Install the [e\(fx\)clipse plugin](http://www.eclipse.org/efxclipse/index.html) from the Eclipse marketplace: 1. Help -&gt; Eclipse Marketplace... -&gt; Search tab 2. Enter "e\(fx\)clipse" in the search dialogue 3. Click "Go" 4. Click "Install" button next to the plugin 5. Click "Finish"
7. Now you can build and run/debug the application by either using "JabRefLauncher" or "JabRefMain". This is the recommended way, since the application starts quite fast.
Expand Down
Binary file added docs/images/intellij-checkstyle-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions src/main/java/org/jabref/gui/EntryTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.control.TitledPane;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.FlowPane;
import javafx.stage.Screen;

import org.jabref.Globals;
import org.jabref.gui.util.BaseDialog;
Expand All @@ -26,6 +28,8 @@
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.model.strings.StringUtil;
import org.jabref.preferences.JabRefPreferences;

import com.airhacks.afterburner.views.ViewLoader;
Expand Down Expand Up @@ -92,6 +96,17 @@ private void addEntriesToPane(FlowPane pane, Collection<? extends BibEntryType>
entryButton.setUserData(entryType);
entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(Optional.of(entryType)));
pane.getChildren().add(entryButton);

EntryType selectedType = entryType.getType();
String description = getDescription(selectedType);
if (StringUtil.isNotBlank(description)) {
Screen currentScreen = Screen.getPrimary();
double maxWidth = currentScreen.getBounds().getWidth();
Tooltip tooltip = new Tooltip(description);
tooltip.setMaxWidth((maxWidth * 2) / 3);
tooltip.setWrapText(true);
entryButton.setTooltip(tooltip);
}
}
}

Expand Down Expand Up @@ -168,4 +183,119 @@ private void setEntryTypeForReturnAndClose(Optional<BibEntryType> entryType) {
viewModel.stopFetching();
this.close();
}

//The description is coming from biblatex manual chapter 2
//Biblatex documentation is favored over the bibtex,
//since bibtex is a subset of biblatex and biblatex is better documented.
public static String getDescription(EntryType selectedType) {
//CHECKSTYLE:OFF
if (selectedType instanceof StandardEntryType) {
switch ((StandardEntryType) selectedType) {
case Article -> {
return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title.");
}
case Book -> {
return Localization.lang("A single-volume book with one or more authors where the authors share credit for the work as a whole.");
}
case Booklet -> {
return Localization.lang("A book-like work without a formal publisher or sponsoring institution.");
}
case Collection -> {
return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor.");
}
case Conference -> {
return Localization.lang("A legacy alias for \"InProceedings\".");
}
case InBook -> {
return Localization.lang("A part of a book which forms a self-contained unit with its own title.");
}
case InCollection -> {
return Localization.lang("A contribution to a collection which forms a self-contained unit with a distinct author and title.");
}
case InProceedings -> {
return Localization.lang("An article in a conference proceedings.");
}
case Manual -> {
return Localization.lang("Technical or other documentation, not necessarily in printed form.");
}
case MastersThesis -> {
return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term Master's thesis.");
}
case Misc -> {
return Localization.lang("A fallback type for entries which do not fit into any other category.");
}
case PhdThesis -> {
return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term PhD thesis.");
}
case Proceedings -> {
return Localization.lang("A single-volume conference proceedings. This type is very similar to \"Collection\".");
}
case TechReport -> {
return Localization.lang("Similar to \"Report\" except that the type field is optional and defaults to the localised term technical report.");
}
case Unpublished -> {
return Localization.lang("A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk.");
}
case BookInBook -> {
return Localization.lang("This type is similar to \"InBook\" but intended for works originally published as a stand-alone book.");
}
case InReference -> {
return Localization.lang("An article in a work of reference. This is a more specific variant of the generic \"InCollection\" entry type.");
}
case MvBook -> {
return Localization.lang("A multi-volume \"Book\".");
}
case MvCollection -> {
return Localization.lang("A multi-volume \"Collection\".");
}
case MvProceedings -> {
return Localization.lang("A multi-volume \"Proceedings\" entry.");
}
case MvReference -> {
return Localization.lang("A multi-volume \"Reference\" entry. The standard styles will treat this entry type as an alias for \"MvCollection\".");
}
case Online -> {
return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources.");
}
case Reference -> {
return Localization.lang("A single-volume work of reference such as an encyclopedia or a dictionary.");
}
case Report -> {
return Localization.lang("A technical report, research report, or white paper published by a university or some other institution.");
}
case Set -> {
return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography.");
}
case SuppBook -> {
return Localization.lang("Supplemental material in a \"Book\". This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only.");
}
case SuppCollection -> {
return Localization.lang("Supplemental material in a \"Collection\".");
}
case SuppPeriodical -> {
return Localization.lang("Supplemental material in a \"Periodical\". This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title.");
}
case Thesis -> {
return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree.");
}
case WWW -> {
return Localization.lang("An alias for \"Online\", provided for jurabib compatibility.");
}
case Software -> {
return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for \"Misc\".");
}
case Dataset -> {
return Localization.lang("A data set or a similar collection of (mostly) raw data.");
}
default -> {
return "";
}
}
} else {
return "";
}
//CHECKSTYLE:ON

}

}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ private MenuBar createMenu() {

new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.SHOW_PDF_VIEWER, new ShowDocumentViewerAction()),
factory.createMenuItem(StandardActions.SHOW_PDF_VIEWER, new ShowDocumentViewerAction(stateManager, prefs)),
factory.createMenuItem(StandardActions.EDIT_ENTRY, new OpenEntryEditorAction(this, stateManager)),
factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager))
);
Expand Down
Loading

0 comments on commit 2ef5f42

Please sign in to comment.