Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixdragandrop
Browse files Browse the repository at this point in the history
* upstream/master: (33 commits)
  Fix display of checkboxes
  Fix
  Remove Spin comments
  Fix#3861_build_addneeded/deleteobsoleteproperties2
  Fix#3861_build_addneeded/deleteobsoleteproperties
  Fix#3861_build
  Fix attach file does not relativize file path (#4252)
  Fix for issue koppor 254 (Auto cleanup url) (#4255)
  Fix#ReplaceString_ChangeConflict
  Fix#3861ReplaceString_solveConflict
  Fix#3861RS_conflicttest
  Fix#3861RS_conflicttest
  Remove changelog entries
  Fix#3861ReplaceString_checkStyle
  Fix#3861ReplaceString_Improvements
  Fix#3861ReplaceString_ContributeLog
  fix log4j slf4j dependency
  Update dependencies (#4251)
  Fix author list parser (#4169) (#4248)
  ReplaceStringMVVMPattern
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/BasePanel.java
  • Loading branch information
Siedlerchr committed Aug 13, 2018
2 parents 9f804d8 + 0469154 commit 737b1c3
Show file tree
Hide file tree
Showing 59 changed files with 1,282 additions and 398 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We changed the default keyboard shortcuts for moving between entries when the entry editor is active to ̀<kbd>alt</kbd> + <kbd>up/down</kbd>.
- Opening a new file now prompts the directory of the currently selected file, instead of the directory of the last opened file.
- Window state is saved on close and restored on start.
- Files without a defined external file type are now directly opened with the default aplication of the operating system
- Files without a defined external file type are now directly opened with the default application of the operating system
- We streamlined the process to rename and move files by removing the confirmation dialogs.
- We removed the redundant new lines of markings and wrapped the summary in the File annotation tab. [#3823](https://github.com/JabRef/jabref/issues/3823)
- We add auto url formatting when user paste link to URL field in Entry editor [#254](https://github.com/koppor/jabref/issues/254)




Expand Down Expand Up @@ -60,8 +63,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the "Convert to BibTeX-Cleanup" moved the content of the `file` field to the `pdf` field [#4120](https://github.com/JabRef/jabref/issues/4120)
- We fixed an issue where the preview pane in entry preview in preferences wasn't showing the citation style selected [#3849](https://github.com/JabRef/jabref/issues/3849)
- We fixed an issue where the default entry preview style still contained the field `review`. The field `review` in the style is now replaced with comment to be consistent with the entry editor [#4098](https://github.com/JabRef/jabref/issues/4098)
- We fixed an issue where filles added via the "Attach file" contextmenu of an entry were not made relative. [#4201](https://github.com/JabRef/jabref/issues/4201)

- We fixed an issue where users were vulnerable to XXE attacks during parsing [#4229](https://github.com/JabRef/jabref/issues/4229)
- We fixed an issue where files added via the "Attach file" contextmenu of an entry were not made relative. [#4201](https://github.com/JabRef/jabref/issues/4201) and [#4241](https://github.com/JabRef/jabref/issues/4241)
- We fixed an issue where author list parser can't generate bibtex for Chinese author. [#4169](https://github.com/JabRef/jabref/issues/4169)



Expand Down Expand Up @@ -109,6 +113,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#






## Older versions
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1"
id "com.simonharrer.modernizer" version '1.6.0-1'
id 'me.champeau.gradle.jmh' version '0.4.7'
id 'net.ltgt.errorprone' version '0.0.15'
id 'net.ltgt.errorprone' version '0.0.16'
id 'com.github.ben-manes.versions' version '0.20.0'
}

Expand Down Expand Up @@ -117,7 +117,7 @@ dependencies {

compile 'net.java.dev.glazedlists:glazedlists_java15:1.9.1'

compile 'com.google.guava:guava:25.1-jre'
compile 'com.google.guava:guava:26.0-jre'

// JavaFX stuff
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
Expand All @@ -137,10 +137,10 @@ dependencies {

// >1.8.0-beta is required for java 9 compatibility
compile 'org.slf4j:slf4j-api:1.8.0-beta2'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.0'
compile 'org.apache.logging.log4j:log4j-jcl:2.11.0'
compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile 'org.apache.logging.log4j:log4j-slf4j18-impl:2.11.1'
compile 'org.apache.logging.log4j:log4j-jcl:2.11.1'
compile 'org.apache.logging.log4j:log4j-api:2.11.1'
compile 'org.apache.logging.log4j:log4j-core:2.11.1'

// need to use snapshots as the stable version is from 2013 and doesn't support v1.0.1 CitationStyles
compile 'org.citationstyles:styles:1.0.1-SNAPSHOT'
Expand All @@ -149,8 +149,8 @@ dependencies {

compile 'com.github.tomtung:latex2unicode_2.12:0.2.2'

compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.1.1'
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.1.1'
compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.1.2'
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.1.2'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0'
Expand All @@ -160,7 +160,7 @@ dependencies {
testCompile 'org.junit-pioneer:junit-pioneer:0.1.2'
testRuntime 'org.apache.logging.log4j:log4j-core:2.11.0'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.0'
testCompile 'org.mockito:mockito-core:2.20.0'
testCompile 'org.mockito:mockito-core:2.21.0'
testCompile 'com.github.tomakehurst:wiremock:2.18.0'
testCompile 'org.assertj:assertj-swing-junit:3.8.0'
testCompile 'org.reflections:reflections:0.9.11'
Expand Down
6 changes: 0 additions & 6 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,4 @@ Project: XMLUnit
URL: http://www.xmlunit.org/
License: Apache-2.0

Id: spin
Path: lib/spin.jar
Project: Spin
URL: http://spin.sourceforge.net/
License: LGPL-2.1+

The last entry has to end with an empty line. Otherwise the entry is not present in About.html.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void openWindow(Stage mainStage) {
}

Scene scene = new Scene(JabRefGUI.mainFrame, 800, 800);
Globals.getThemeLoader().installBaseCss(scene);
Globals.getThemeLoader().installBaseCss(scene, Globals.prefs);
mainStage.setTitle(JabRefFrame.FRAME_TITLE);
mainStage.getIcons().addAll(IconTheme.getLogoSetFX());
mainStage.setScene(scene);
Expand Down
120 changes: 90 additions & 30 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-jr-theme: #50618F;
-jr-accent: #a3b7e6;
-jr-selected: -jr-accent;
-jr-checked: -jr-theme;
-jr-hover: #0002;

/* The base gray. Most gray-tones in the application are derived from this color. */
Expand Down Expand Up @@ -282,57 +283,116 @@
-fx-font-family: monospace;
}

.flatButtonNoSpaceBottom,
.flatButtonNoSpaceTop,
.flatButton {
-fx-shadow-highlight-color: black;
-fx-outer-border: red;
-fx-inner-border: purple;
-fx-faint-focus-color: transparent;
.button,
.toggle-button,
.radio-button > .radio,
.check-box > .box,
.menu-button,
.choice-box,
.color-picker.split-button > .color-picker-label,
.combo-box-base,
.combo-box-base:editable > .arrow-button {
-fx-background-color: transparent;
-fx-background-insets: 0;
-fx-background-radius: 0;
-fx-text-fill: -fx-text-base-color;
}

.button {
-fx-background-color: transparent;
-fx-border-color: rgba(0, 0, 0, 0.23);
-fx-border-width: 1px;
-fx-border-radius: 4px;
-fx-padding: 0.5em 1em 0.5em 1em;
}

.button:hover {
-fx-background-color: rgba(0, 0, 0, 0.12);
}

.button:focused,
.button:pressed {
-fx-background-color: rgba(0, 0, 0, 0.3);
}

.button:default {
-fx-background-color: -fx-default-button;
}

.button:default:hover {
-fx-background-color: derive(-fx-default-button, -10%);
}

.button:default:focused,
.button:default:pressed {
-fx-background-color: derive(-fx-default-button, -20%);
}

.text-button {
-fx-border-width: 0px;
}

.contained-button {
-fx-background-color: -jr-accent;
-fx-border-color: -jr-accent;
}

.icon-buttonNoSpaceBottom,
.icon-buttonNoSpaceTop,
.icon-button {
-fx-border-width: 0px;
-fx-background-color: -jr-icon-background;
-fx-text-background-color: blue;
-fx-padding: 0.5em;
}

.flatButtonNoSpaceBottom:hover,
.flatButtonNoSpaceTop:hover,
.flatButton:hover {
.icon-buttonNoSpaceBottom:hover,
.icon-buttonNoSpaceTop:hover,
.icon-button:hover {
-fx-background-color: -jr-icon-background-active;
}

.flatButtonNoSpaceBottom:armed,
.flatButtonNoSpaceTop:armed,
.flatButton:armed {
.icon-buttonNoSpaceBottom:armed,
.icon-buttonNoSpaceTop:armed,
.icon-button:armed {
-fx-background-color: -jr-icon-background-armed;
}

.flatButton:selected {
.icon-button:selected {
-fx-background-color: -jr-icon-background-active;
-fx-text-fill: white;
-fx-fill: white;
}

.flatButtonNoSpaceBottom {
.icon-buttonNoSpaceBottom {
-fx-padding: 0.5em 0.5em -0.1em 0.5em;
}

.flatButtonNoSpaceTop {
.icon-buttonNoSpaceTop {
-fx-padding: -0.1em 0.5em 0.5em 0.5em;
}

.button,
.toggle-button,
.radio-button > .radio,
.check-box > .box,
.menu-button,
.choice-box,
.color-picker.split-button > .color-picker-label,
.combo-box-base,
.combo-box-base:editable > .arrow-button {
-fx-background-color: transparent;
-fx-background-insets: 0;
-fx-background-radius: 0;
-fx-text-fill: -fx-text-base-color;
.check-box {
-fx-label-padding: 0.0em 0.0em 0.0em 0.75em;
-fx-text-fill: -fx-text-background-color;
}

.check-box > .box {
-fx-border-color: rgba(0, 0, 0, 0.54);
-fx-border-width: 2px;
-fx-border-radius: 1px;
-fx-padding: 0.166667em 0.166667em 0.25em 0.25em;
}

.check-box:selected > .box {
-fx-background-insets: 2px;
-fx-border-color: -jr-checked;
-fx-background-color: -jr-checked;
}

.check-box > .box > .mark {
-fx-background-color: white;
-fx-padding: 0.166667em 0.166667em 0.166667em 0.166667 m;
-fx-shape: "M6.61 11.89L3.5 8.78 2.44 9.84 6.61 14l8.95-8.95L14.5 4z";
}

.menu-bar {
Expand Down
27 changes: 1 addition & 26 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,32 +393,7 @@ private void setupActions() {

actions.put(Actions.MERGE_WITH_FETCHED_ENTRY, new MergeWithFetchedEntryAction(this, frame.getDialogService()));

actions.put(Actions.REPLACE_ALL, () -> {
final ReplaceStringDialog rsd = new ReplaceStringDialog(frame);
rsd.setVisible(true);
if (!rsd.okPressed()) {
return;
}
int counter = 0;
final NamedCompound ce = new NamedCompound(Localization.lang("Replace string"));
if (rsd.selOnly()) {
for (BibEntry be : mainTable.getSelectedEntries()) {
counter += rsd.replace(be, ce);
}
} else {
for (BibEntry entry : bibDatabaseContext.getDatabase().getEntries()) {
counter += rsd.replace(entry, ce);
}
}

output(Localization.lang("Replaced") + ' ' + counter + ' '
+ (counter == 1 ? Localization.lang("occurrence") : Localization.lang("occurrences")) + '.');
if (counter > 0) {
ce.end();
getUndoManager().addEdit(ce);
markBaseChanged();
}
});
actions.put(Actions.REPLACE_ALL, ()-> (new ReplaceStringAction(this)).execute());

actions.put(new SpecialFieldValueViewModel(SpecialField.RELEVANCE.getValues().get(0)).getCommand(),
new SpecialFieldViewModel(SpecialField.RELEVANCE, undoManager).getSpecialFieldAction(SpecialField.RELEVANCE.getValues().get(0), frame));
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/GUIGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.awt.Font;

import org.jabref.Globals;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.keyboard.EmacsKeyBindings;
import org.jabref.gui.util.CustomLocalDragboard;
import org.jabref.logic.l10n.Localization;
Expand Down Expand Up @@ -59,6 +60,7 @@ public static void init() {
// Set up entry editor colors, first time:
GUIGlobals.updateEntryEditorColors();

IconTheme.loadFonts();
GUIGlobals.currentFont = new Font(Globals.prefs.get(JabRefPreferences.FONT_FAMILY),
Globals.prefs.getInt(JabRefPreferences.FONT_STYLE), Globals.prefs.getInt(JabRefPreferences.FONT_SIZE));
}
Expand Down
58 changes: 58 additions & 0 deletions src/main/java/org/jabref/gui/ReplaceString.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<DialogPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8"
fx:controller="org.jabref.gui.ReplaceStringView">
<content>
<BorderPane>
<center>
<BorderPane BorderPane.alignment="CENTER">
<center>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<Label text="%Find and Replace"/>
<Label text="%Find:" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
<TextField fx:id="findField" GridPane.columnIndex="1" GridPane.rowIndex="1"
GridPane.columnSpan="4"/>
<Label text="%Replace With:" wrapText="true" GridPane.columnIndex="0" GridPane.rowIndex="2"/>
<TextField fx:id="replaceField" GridPane.columnIndex="1" GridPane.rowIndex="2"
GridPane.columnSpan="4"/>
<CheckBox fx:id="selectFieldOnly" GridPane.columnIndex="0" GridPane.rowIndex="4" GridPane.columnSpan="2"
text="%Limit to Selected Entries"/>
<RadioButton fx:id="allReplace" GridPane.columnIndex="0" GridPane.rowIndex="5" GridPane.columnSpan="2"
selected="true" text="%All Field Replace">
<toggleGroup>
<ToggleGroup fx:id="radioGroup"/>
</toggleGroup>
</RadioButton>
<RadioButton GridPane.columnIndex="0" GridPane.rowIndex="6" GridPane.columnSpan="2"
text="%Limit to Fields" toggleGroup="$radioGroup"/>
<TextField fx:id="limitFieldInput" GridPane.columnIndex="2" GridPane.rowIndex="6"
GridPane.columnSpan="3"/>
</GridPane>
</center>
</BorderPane>
</center>
</BorderPane>
</content>
<ButtonType fx:id="replaceButton" text="%Replace" buttonData="OK_DONE"/>
<ButtonType fx:constant="CANCEL"/>
</DialogPane>
18 changes: 18 additions & 0 deletions src/main/java/org/jabref/gui/ReplaceStringAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.jabref.gui;

import org.jabref.gui.actions.SimpleCommand;

public class ReplaceStringAction extends SimpleCommand
{
private BasePanel basePanel;

public ReplaceStringAction(BasePanel basePanel) {
this.basePanel = basePanel;
}

@Override
public void execute() {
ReplaceStringView dialog = new ReplaceStringView(basePanel);
dialog.showAndWait();
}
}
Loading

0 comments on commit 737b1c3

Please sign in to comment.