Skip to content

Commit

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

* upstream/master:
  fix copy base bug in Strings Dialog validation
  Bump mockito-core from 2.24.0 to 2.24.5 (#4663)
  Fix for #4628 - cant save new content selectors (#4658)
  Fix issues with double spaces. (#4662)
  • Loading branch information
Siedlerchr committed Feb 19, 2019
2 parents 49e3600 + 1b6c7b5 commit 872d436
Show file tree
Hide file tree
Showing 11 changed files with 471 additions and 535 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ dependencies {

testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.2'
testCompile 'org.mockito:mockito-core:2.24.0'
testCompile 'org.mockito:mockito-core:2.24.5'
testCompile 'com.github.tomakehurst:wiremock:2.21.0'
testCompile 'org.assertj:assertj-swing-junit:3.9.2'
testCompile 'org.reflections:reflections:0.9.11'
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.jabref.gui.bibtexkeypattern.SearchFixDuplicateLabels;
import org.jabref.gui.collab.DatabaseChangeMonitor;
import org.jabref.gui.collab.FileUpdatePanel;
import org.jabref.gui.contentselector.ContentSelectorDialog;
import org.jabref.gui.desktop.JabRefDesktop;
import org.jabref.gui.edit.ReplaceStringAction;
import org.jabref.gui.entryeditor.EntryEditor;
Expand Down Expand Up @@ -399,11 +398,6 @@ private void setupActions() {
actions.put(Actions.NEXT_PREVIEW_STYLE, this::nextPreviewStyle);
actions.put(Actions.PREVIOUS_PREVIEW_STYLE, this::previousPreviewStyle);

actions.put(Actions.MANAGE_SELECTORS, () -> {
ContentSelectorDialog csd = new ContentSelectorDialog(frame, BasePanel.this, false, null);
csd.setVisible(true);
});

actions.put(Actions.SEND_AS_EMAIL, new SendAsEMailAction(frame));

actions.put(Actions.WRITE_XMP, new WriteXMPAction(this)::execute);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.jabref.gui.actions.ErrorConsoleAction;
import org.jabref.gui.actions.LibraryPropertiesAction;
import org.jabref.gui.actions.LookupIdentifierAction;
import org.jabref.gui.actions.ManageContentSelectorAction;
import org.jabref.gui.actions.ManageCustomExportsAction;
import org.jabref.gui.actions.ManageCustomImportsAction;
import org.jabref.gui.actions.ManageJournalsAction;
Expand Down Expand Up @@ -941,7 +942,7 @@ private MenuBar createMenu() {

new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.MANAGE_CONTENT_SELECTORS, new OldDatabaseCommandWrapper(Actions.MANAGE_SELECTORS, this, Globals.stateManager)),
factory.createMenuItem(StandardActions.MANAGE_CONTENT_SELECTORS, new ManageContentSelectorAction(this)),
factory.createMenuItem(StandardActions.CUSTOMIZE_ENTRY_TYPES, new CustomizeEntryAction(this)),
factory.createMenuItem(StandardActions.MANAGE_CITE_KEY_PATTERNS, new BibtexKeyPatternAction(this)));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.jabref.gui.actions;

import org.jabref.gui.BasePanel;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.contentselector.ContentSelectorDialogView;
import org.jabref.logic.l10n.Localization;

public class ManageContentSelectorAction extends SimpleCommand {

private final JabRefFrame jabRefFrame;

public ManageContentSelectorAction(JabRefFrame jabRefFrame) {
this.jabRefFrame = jabRefFrame;
}

@Override
public void execute() {
BasePanel basePanel = jabRefFrame.getCurrentBasePanel();
if (noActiveConnectionExists(basePanel)) {
jabRefFrame.getDialogService().showErrorDialogAndWait(Localization.lang("Active database connection do not exists!"));
return;
}
new ContentSelectorDialogView(basePanel).showAndWait();
}

private boolean noActiveConnectionExists(BasePanel basePanel) {
return basePanel == null || basePanel.getBibDatabaseContext() == null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonType?>
<?import javafx.scene.control.DialogPane?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<DialogPane minHeight="450.0" minWidth="375.0" prefHeight="450.0" prefWidth="407.0" xmlns="http://javafx.com/javafx/8.0.172-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.contentselector.ContentSelectorDialogView">
<content>
<VBox>
<children>
<Label prefHeight="27.0" prefWidth="108.0" text="Field names" />
<HBox prefHeight="140.0" prefWidth="385.0">
<children>
<ListView fx:id="fieldNamesListView" prefHeight="140.0" prefWidth="297.0"/>
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="addFieldNameButton" alignment="CENTER" mnemonicParsing="false" prefHeight="26.0" prefWidth="72.0" text="%Add" onAction="#addNewFieldName">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</Button>
<Button fx:id="removeFieldNameButton" mnemonicParsing="false" text="%Remove" onAction="#removeFieldName">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</children>
</HBox>
<Separator prefWidth="200.0">
<VBox.margin>
<Insets top="20.0" />
</VBox.margin>
</Separator>
<Label prefHeight="27.0" prefWidth="108.0" text="Keywords" />
<HBox prefHeight="140.0" prefWidth="385.0">
<children>
<ListView fx:id="keywordsListView" prefHeight="140.0" prefWidth="297.0" />
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="addKeywordButton" alignment="CENTER" mnemonicParsing="false" prefHeight="26.0" prefWidth="72.0" text="%Add" onAction="#addNewKeyword">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</Button>
<Button fx:id="removeKeywordButton" mnemonicParsing="false" text="%Remove" onAction="#removeKeyword">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</children>
</HBox>
</children>
</VBox>
</content>
<ButtonType fx:id="saveButton" buttonData="OK_DONE" text="%Save" />
<ButtonType fx:constant="CANCEL" />
</DialogPane>
Loading

0 comments on commit 872d436

Please sign in to comment.