Skip to content

Commit

Permalink
Redesign "Manage field names & content" dialog (#8892)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoussemNasri authored Jun 22, 2022
1 parent 41edd28 commit 9701e35
Show file tree
Hide file tree
Showing 27 changed files with 1,080 additions and 305 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- The Medline/Pubmed search now also supports the [default fields and operators for searching](https://docs.jabref.org/collect/import-using-online-bibliographic-database#search-syntax). [forum#3554](https://discourse.jabref.org/t/native-pubmed-search/3354)
- We improved group expansion arrow that prevent it from activating group when expanding or collapsing. [#7982](https://github.com/JabRef/jabref/issues/7982), [#3176](https://github.com/JabRef/jabref/issues/3176)
- When configured SSL certificates changed, JabRef warns the user to restart to apply the configuration.
- We improved the appearances and logic of the "Manage field names & content" dialog, and renamed it to "Automatic field editor". [#6536](https://github.com/JabRef/jabref/issues/6536)
- We fixed an issue that caused JabRef to sometimes open multiple instances when "Remote Operation" is enabled. [#8653](https://github.com/JabRef/jabref/issues/8653)

### Fixed
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
import org.jabref.gui.edit.CopyMoreAction;
import org.jabref.gui.edit.EditAction;
import org.jabref.gui.edit.ManageKeywordsAction;
import org.jabref.gui.edit.MassSetFieldsAction;
import org.jabref.gui.edit.OpenBrowserAction;
import org.jabref.gui.edit.ReplaceStringAction;
import org.jabref.gui.edit.automaticfiededitor.AutomaticFieldEditorAction;
import org.jabref.gui.entryeditor.OpenEntryEditorAction;
import org.jabref.gui.entryeditor.PreviewSwitchAction;
import org.jabref.gui.exporter.ExportCommand;
Expand Down Expand Up @@ -750,8 +750,7 @@ private MenuBar createMenu() {
new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.MANAGE_KEYWORDS, new ManageKeywordsAction(stateManager)),
factory.createMenuItem(StandardActions.MASS_SET_FIELDS, new MassSetFieldsAction(stateManager, dialogService, undoManager)));

factory.createMenuItem(StandardActions.AUTOMATIC_FIELD_EDITOR, new AutomaticFieldEditorAction(stateManager, dialogService)));
SeparatorMenuItem specialFieldsSeparator = new SeparatorMenuItem();
specialFieldsSeparator.visibleProperty().bind(prefs.getSpecialFieldsPreferences().specialFieldsEnabledProperty());

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public enum StandardActions implements Action {
REPLACE_ALL(Localization.lang("Find and replace"), KeyBinding.REPLACE_STRING),
MANAGE_KEYWORDS(Localization.lang("Manage keywords")),
MASS_SET_FIELDS(Localization.lang("Manage field names & content")),

AUTOMATIC_FIELD_EDITOR(Localization.lang("Automatic field editor")),
TOGGLE_GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, KeyBinding.TOGGLE_GROUPS_INTERFACE),
TOOGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION),
TOGGLE_WEB_SEARCH(Localization.lang("Web search"), Localization.lang("Toggle web search interface"), IconTheme.JabRefIcons.WWW, KeyBinding.WEB_SEARCH),
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/org/jabref/gui/edit/MassSetFieldsAction.java

This file was deleted.

245 changes: 0 additions & 245 deletions src/main/java/org/jabref/gui/edit/MassSetFieldsDialog.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.jabref.gui.edit.automaticfiededitor;

import javafx.scene.layout.AnchorPane;

public abstract class AbstractAutomaticFieldEditorTabView extends AnchorPane implements AutomaticFieldEditorTab {

@Override
public AnchorPane getContent() {
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.jabref.gui.edit.automaticfiededitor;

import org.jabref.gui.DialogService;
import org.jabref.gui.StateManager;
import org.jabref.gui.actions.SimpleCommand;

import static org.jabref.gui.actions.ActionHelper.needsDatabase;
import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected;

public class AutomaticFieldEditorAction extends SimpleCommand {
private final StateManager stateManager;
private final DialogService dialogService;

public AutomaticFieldEditorAction(StateManager stateManager, DialogService dialogService) {
this.stateManager = stateManager;
this.dialogService = dialogService;

this.executable.bind(needsDatabase(stateManager).and(needsEntriesSelected(stateManager)));
}

@Override
public void execute() {
dialogService.showCustomDialogAndWait(new AutomaticFieldEditorDialog(stateManager.getSelectedEntries(),
stateManager.getActiveDatabase().orElseThrow()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.ButtonType?>
<?import javafx.scene.control.DialogPane?>
<?import javafx.scene.control.TabPane?>
<DialogPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
fx:controller="org.jabref.gui.edit.automaticfiededitor.AutomaticFieldEditorDialog"
prefHeight="400.0" prefWidth="600.0">
<content>
<TabPane fx:id="tabPane" tabClosingPolicy="UNAVAILABLE"/>
</content>
<ButtonType fx:id="saveButton" text="Keep Modifications" buttonData="OK_DONE"/>
<ButtonType fx:id="cancelButton"
text="Revert" buttonData="CANCEL_CLOSE"/>
</DialogPane>
Loading

0 comments on commit 9701e35

Please sign in to comment.