Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixInvalidFolder
Browse files Browse the repository at this point in the history
* upstream/master: (38 commits)
  Add link to "feature branch workflow"
  Support Annotations Created by Foxit (#2878)
  Fixes jacoco by excluding the fetcher tests from analysis (#2877)
  Fix entry editor (#2875)
  update bcprov-jdk15on from 1.56 -> 1.57
  update assertj-swing-junit from 3.5.0 -> 3.6.0
  update mockito-core from 2.7.22 -> 2.8.9
  update jfx from 0.11.0 -> 0.11.1
  update google guava from 21.0 -> 22.0
  Fix Divide by zero exception if rows is zero in Entry Editor Tab (#2873)
  Implement #2785: resort groups using drag & drop (#2864)
  Add Library of Congress as ID-fetcher (#2865)
  Fix export and import of MS office day/year/month acessed fields (#2862)
  Adsurl to url (#2861)
  Update LICENSE.md
  Update
  Update LICENSE.md
  Update license file so that github recognize it properly
  Improve Issue Template Using a Collapsible Log Area
  Fix #2852: Improve performance of group filtering.
  ...
  • Loading branch information
Siedlerchr committed Jun 3, 2017
2 parents 0abafaf + 9e054fc commit 50cab66
Show file tree
Hide file tree
Showing 100 changed files with 1,822 additions and 2,350 deletions.
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Steps to reproduce:

<!-- If applicable, excerpt of the bibliography file, screenshot, and excerpt of log (available in the error console) -->

```
Put the excerpt of the log file here
```
<details>
<summary>Log File</summary>

```
Paste an excerpt of your log file here
```
</details>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,4 @@ gradle-app.setting

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
scenicView.properties
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,27 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- Continued to redesign the user interface: this time the editor got a fresh coat of paint:
- We moved the `adsurl` field to `url` field when fetching with the ADS fetcher.
- We continued to improve the new groups interface:
- You can now again select multiple groups (and a few related settings were added to the preferences) [#2786](https://github.com/JabRef/jabref/issues/2786).
- We further improved performance of group operations, especially of the new filter feature [#2852](https://github.com/JabRef/jabref/issues/2852).
- It is now possible to resort groups using drag & drop [#2785](https://github.com/JabRef/jabref/issues/2785).
- The entry editor got a fresh coat of paint:
- Homogenize the size of text fields.
- The buttons were changed to icons.
- Completely new interface to add or modify linked files.
- Removed the hidden feature that a double click in the editor inserted the current date.
- All authors and editors are separated using semicolons when exporting to csv. [#2762](https://github.com/JabRef/jabref/issues/2762)
- Improved wording of "Show recommendationns: into "Show 'Related Articles' tab" in the preferences
- Improved wording of "Show recommendations: into "Show 'Related Articles' tab" in the preferences
- We added integration of the Library of Congress catalog as a fetcher based on the [LCCN identifier](https://en.wikipedia.org/wiki/Library_of_Congress_Control_Number). [Feature request 636 in the forum](http://discourse.jabref.org/t/loc-marc-mods-connection/636)

### Fixed
- We fixed the IEEE Xplore web search functionality [#2789](https://github.com/JabRef/jabref/issues/2789)
- We fixed an error in the CrossRef fetcher that occurred if one of the fetched entries had no title
- We fixed an issue that prevented new entries to be automatically assigned to the currently selected group [#2783](https://github.com/JabRef/jabref/issues/2783).
- We fixed a bug that only allowed parsing positive timezones from a FileAnnotation [#2839](https://github.com/JabRef/jabref/issues/2839)
- We fixed a bug that did not allow the correct re-export of the MS-Office XML field `msbib-accessed` with a different date format [#2859](https://github.com/JabRef/jabref/issues/2859).
- We fixed some bugs that prevented the display of FileAnnotations that were created using the Foxit Reader. [#2839, comment](https://github.com/JabRef/jabref/issues/2839#issuecomment-302058227).
### Removed


Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Understanding the basics
We welcome contributions to JabRef and encourage to create a fork, clone, **create a new branch** (such as `fix-for-issue-121`), **work on the new branch — not master**, and create a pull request.
Be sure to create a **separate branch** for each improvement you implement.
Take a look at GitHub's excellent [help documentation] for a detailed explanation.
Take a look at GitHub's excellent [help documentation] for a detailed explanation and the explanation of [Feature Branch Workflow](https://de.atlassian.com/git/tutorials/comparing-workflows#feature-branch-workflow) for the idea behind this kind of development.

We also have [code howtos](https://github.com/JabRef/jabref/wiki/Code-Howtos) and [guidelines for setting up a local workspace](https://github.com/JabRef/jabref/wiki/Guidelines-for-setting-up-a-local-workspace).

Expand Down
37 changes: 16 additions & 21 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
The MIT License (MIT)
=====================
MIT License

Copyright © 2003-2016 [JabRef Authors](https://github.com/JabRef/jabref/blob/master/AUTHORS)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 13 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ install4j {


repositories {
mavenLocal()
jcenter()
maven {
url 'https://oss.sonatype.org/content/groups/public'
Expand All @@ -81,7 +82,7 @@ dependencies {
compile 'org.apache.pdfbox:jempbox:1.8.13'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
compile 'org.bouncycastle:bcprov-jdk15on:1.56'
compile 'org.bouncycastle:bcprov-jdk15on:1.57'

compile 'commons-cli:commons-cli:1.4'

Expand All @@ -106,13 +107,14 @@ dependencies {
compile 'net.java.dev.glazedlists:glazedlists_java15:1.9.1'
compile fileTree(dir: 'lib', includes: ['*.jar'])

compile 'com.google.guava:guava:21.0'
compile 'com.google.guava:guava:22.0'

// JavaFX stuff
compile 'com.airhacks:afterburner.fx:1.7.0'
compile 'de.codecentric.centerdevice:javafxsvg:1.2.1'
compile 'org.controlsfx:controlsfx:8.40.12'
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'net.corda:jfx:0.11.1'
compile 'org.fxmisc.flowless:flowless:0.5.2'
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'

Expand Down Expand Up @@ -142,9 +144,9 @@ dependencies {
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '1.0.+'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.7.22'
testCompile 'org.mockito:mockito-core:2.8.9'
testCompile 'com.github.tomakehurst:wiremock:2.6.0'
testCompile 'org.assertj:assertj-swing-junit:3.5.0'
testCompile 'org.assertj:assertj-swing-junit:3.6.0'
testCompile 'org.reflections:reflections:0.9.11'
}

Expand Down Expand Up @@ -288,7 +290,7 @@ tasks.withType(Test) {
}

task jacocoMerge(type: JacocoMerge) {
executionData test, fetcherTest, databaseTest
executionData test, databaseTest
}

jacocoTestReport {
Expand All @@ -308,26 +310,26 @@ shadowJar {

// this is an adapter required for generating a fat jar with correct log4j2 output

com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer target = new com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer();
com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer target = new com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer()

@Override
boolean canTransformResource(FileTreeElement element) {
return target.canTransformResource(element.getPath());
return target.canTransformResource(element.getPath())
}

@Override
void transform(String path, InputStream is, List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocators) {
target.processResource(path, is, relocators);
target.processResource(path, is, relocators)
}

@Override
boolean hasTransformedResource() {
return target.hasTransformedResource();
return target.hasTransformedResource()
}

@Override
void modifyOutputStream(org.apache.tools.zip.ZipOutputStream jos) {
target.modifyOutputStream(jos);
target.modifyOutputStream(jos)
}
})
}
Expand Down Expand Up @@ -356,7 +358,7 @@ if (hasProperty('dev')) {
// In the context of github, the branch name could be something like "pull/277"
// "/" is an illegal character. To be safe, all illegal filename characters are replaced by "_"
// http://stackoverflow.com/a/15075907/873282 describes the used pattern.
branchName = branchName.trim().replaceAll("[^a-zA-Z0-9.-]", "_");
branchName = branchName.trim().replaceAll("[^a-zA-Z0-9.-]", "_")

// hack string
// first the date (%cd), then the branch name, and finally the commit id (%h)
Expand Down
15 changes: 14 additions & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,26 @@
</module>

<module name="EmptyLineSeparator">
<property name="tokens" value="IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF"/>
<property name="tokens"
value="IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF"/>
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
</module>

<module name="DeclarationOrder"/>

<!-- RCULRY causes issues if classes are nested within arrays, therefore not activated -->
<module name="WhitespaceAround">
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV,
DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL,
PLUS, PLUS_ASSIGN, QUESTION,
SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
</module>
</module>

<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppressions.xml"/>
</module>
Expand Down
11 changes: 8 additions & 3 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,22 @@ URL: http://fxexperience.com/controlsfx/
License: BSD-3-Clause

Id: org.fx.misc.easybin:easybind
Projekt: EasyBind
Project: EasyBind
URL: https://github.com/TomasMikula/EasyBind
License: BSD-2-Clause

Id: net.corda:jfx
Project: Corda
URL: https://github.com/corda/corda/tree/master/client/jfx
License: Apache-2.0

Id: org.fxmisc.flowless:flowless
Projekt: Flowless
Project: Flowless
URL: https://github.com/TomasMikula/Flowless
License: BSD-2-Clause

Id: de.jensd:fontawesomefx-materialdesignfont
Projekt: FontAwesomeFX
Project: FontAwesomeFX
URL: https://bitbucket.org/Jerady/fontawesomefx
License: Apache-2.0

Expand Down
68 changes: 3 additions & 65 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TimerTask;
import java.util.stream.Collectors;

import javax.swing.AbstractAction;
Expand All @@ -37,7 +36,6 @@
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.tree.TreePath;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;

Expand Down Expand Up @@ -69,8 +67,6 @@
import org.jabref.gui.filelist.FileListEntry;
import org.jabref.gui.filelist.FileListTableModel;
import org.jabref.gui.groups.GroupAddRemoveDialog;
import org.jabref.gui.groups.GroupSelector;
import org.jabref.gui.groups.GroupTreeNodeViewModel;
import org.jabref.gui.importer.actions.AppendDatabaseAction;
import org.jabref.gui.journals.AbbreviateAction;
import org.jabref.gui.journals.UnabbreviateAction;
Expand Down Expand Up @@ -1313,9 +1309,6 @@ public void actionPerformed(ActionEvent e) {
@Override
public void keyPressed(KeyEvent e) {
final int keyCode = e.getKeyCode();
final TreePath path = frame.getGroupSelector().getSelectionPath();
final GroupTreeNodeViewModel node = path == null ? null : (GroupTreeNodeViewModel) path
.getLastPathComponent();

if (e.isControlDown()) {
switch (keyCode) {
Expand Down Expand Up @@ -1479,7 +1472,6 @@ public void showEntry(final BibEntry be) {
showEntryEditor(entryEditor);

newEntryShowing(be);
setEntryEditorEnabled(true); // Make sure it is enabled.
}

/**
Expand Down Expand Up @@ -1905,10 +1897,6 @@ public BibDatabaseContext getBibDatabaseContext() {
return this.bibDatabaseContext;
}

public GroupSelector getGroupSelector() {
return frame.getGroupSelector();
}

public boolean isUpdatedExternally() {
return updatedExternally;
}
Expand Down Expand Up @@ -2121,68 +2109,18 @@ public void searchAndOpen() {
}

private class GroupTreeListener {

private final Runnable task = new Runnable() {

@Override
public void run() {
// Update group display (for example to reflect that the number of contained entries has changed)
frame.getGroupSelector().revalidateGroups();
}
};

/**
* Only access when you have the lock of the task instance
*
* Guarded by "task"
*/
private TimerTask timerTask = new TimerTask() {

@Override
public void run() {
task.run();
}
};

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
// if the added entry is an undo don't add it to the current group
if (addedEntryEvent.getEntryEventSource() == EntryEventSource.UNDO) {
scheduleUpdate();
return;
}

// Automatically add new entry to the selected group (or set of groups)
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_ASSIGN_GROUP)
&& frame.getGroupSelector().getToggleAction().isSelected()) {
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_ASSIGN_GROUP)) {
final List<BibEntry> entries = Collections.singletonList(addedEntryEvent.getBibEntry());
final TreePath[] selection = frame.getGroupSelector().getGroupsTree().getSelectionPaths();
if (selection != null) {
// it is possible that the user selected nothing. Therefore, checked for "!= null"
for (final TreePath tree : selection) {
((GroupTreeNodeViewModel) tree.getLastPathComponent()).addEntriesToGroup(entries);
}
}
SwingUtilities.invokeLater(() -> BasePanel.this.getGroupSelector().valueChanged(null));
}

scheduleUpdate();
}

private void scheduleUpdate() {
// This is a quickfix/dirty hack.
// a better solution would be using RxJava or something reactive instead
// nevertheless it works correctly
synchronized (task) {
timerTask.cancel();
timerTask = new TimerTask() {

@Override
public void run() {
task.run();
}
};
JabRefExecutorService.INSTANCE.submit(timerTask, 200);
Globals.stateManager.getSelectedGroup(bibDatabaseContext).forEach(
selectedGroup -> selectedGroup.addEntriesToGroup(entries));
}
}
}
Expand Down
Loading

0 comments on commit 50cab66

Please sign in to comment.