Skip to content

Commit

Permalink
Merge branch 'master' into xmlunit
Browse files Browse the repository at this point in the history
* master:
  Remove obsolete wrapper task
  Added error dialog when setting invalid main file directory (#1921)
  Add filteringCharset = 'UTF-8' (#1945)
  Include https://github.com/grimes2
  Searchbar across all bib files instead each having its own (#1549)
  Some OO/LO cleanups (#1927)
  Update link
  Removed external dependency in logic (#1934)
  • Loading branch information
Siedlerchr committed Sep 11, 2016
2 parents 7b7d6f4 + 7bae954 commit 9be2619
Show file tree
Hide file tree
Showing 109 changed files with 1,141 additions and 806 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Jörg Lenhard
Jörg Wegner
Jörg Zieren
Jørgen Kvalsvik
Jürgen Lange
Kai Mindermann
Koji Yokota
Kolja Brix
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- Implemented [#825](https://github.com/JabRef/jabref/issues/825): Search Bar across all bib files instead each having its own
- Implemented [#573](https://github.com/JabRef/jabref/issues/573): Add key shortcut for global search (`ctrl+shift+f`, if the searchfield is empty it will be focused instead)
- The search result Window will now show which entry belongs to which bib file
- The search result Window will now remember its location
- The search result Window won't stay on top anymore if the main Window is focused and will be present in the taskbar
- The user can jump from the searchbar to the maintable with `ctrl+enter`
- Implemented [#573 (comment)](https://github.com/JabRef/jabref/issues/573#issuecomment-232284156): Added shortcut: closing the search result window with `ctrl+w`
- Added integrity check for fields with BibTeX keys, e.g., `crossref` and `related`, to check that the key exists
- [#1496](https://github.com/JabRef/jabref/issues/1496) Keep track of which entry a downloaded file belongs to
- Made it possible to download multiple entries in one action
Expand All @@ -26,16 +33,25 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#

### Fixed
- Fixed selecting an entry out of multiple duplicates
- Fixed [#617](https://github.com/JabRef/jabref/issues/617): `Enter` in global search opens the selected entry & `Enter` in search dialog window opens the selected entry
- Entries in the SearchResultPanel will be shown correctly (Latex to Unicode)
- Suggestions in the autocomplete will be shown correctly (Latex to Unicode)
- Fixed: When searching the first match will be selected if the current selection is no match
- Selecting an entry in the search result Window will now select the correct entry in the bib file
- Entries in the SearchResultDialog are now converted to Unicode
- Suggestions in the autocomplete (search) are now in Unicode
- Fixed NullPointerException when opening search result window for an untitled database
- Fixed entry table traversal with Tab (no column traversal thus no double jump)
- Fixed [#1757](https://github.com/JabRef/jabref/issues/1757): Crash after saving illegal argument in entry editor
- Fixed [#1663](https://github.com/JabRef/jabref/issues/1663): Better multi-monitor support
- Fixed [#1882](https://github.com/JabRef/jabref/issues/1882): Crash after saving illegal bibtexkey in entry editor
- Fixed field `location` containing only city is not exported correctly to MS-Office 2007 xml format
- Fixed field `key` field is not exported to MS-Office 2008 xml format
- Fixed download files failed silently when an invalid directory is selected

### Removed
- The non-supported feature of being able to define file directories for any extension is removed. Still, it should work for older databases using the legacy `ps` and `pdf` fields, although we strongly encourage using the `file` field.
- Automatic migration for the `evastar_pdf` field is removed.



Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ You can add the prefix `[WIP]` to indicate that the pull request is not yet comp

[commit guidelines section of Pro Git]: http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines
[good commit message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[help documentation]: https://help.github.com/articles/using-pull-requests/
[help documentation]: https://help.github.com/articles/about-pull-requests/
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import org.gradle.internal.os.OperatingSystem

// to update the gradle wrapper, execute ./gradlew wrapper --gradle-version 3.0

buildscript {
repositories {
maven {
Expand Down Expand Up @@ -46,11 +48,6 @@ install4j {
installDir = file(project.ext.install4jDir)
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}


repositories {
jcenter()
}
Expand Down Expand Up @@ -154,6 +151,8 @@ processResources {
"year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)),
"authors": new File('AUTHORS').readLines().findAll { !it.startsWith("#") }.join(", "),
"developers": new File('DEVELOPERS').readLines().findAll { !it.startsWith("#") }.join(", "))

filteringCharset = 'UTF-8'
}

filesMatching("resource/**/meta.xml") {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/net/sf/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefException;
import net.sf.jabref.MetaData;
import net.sf.jabref.external.AutoSetLinks;
import net.sf.jabref.gui.externalfiles.AutoSetLinks;
import net.sf.jabref.gui.importer.fetcher.EntryFetcher;
import net.sf.jabref.gui.importer.fetcher.EntryFetchers;
import net.sf.jabref.logic.CustomEntryTypesManager;
Expand Down Expand Up @@ -47,6 +47,7 @@
import net.sf.jabref.model.database.BibDatabaseMode;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.preferences.JabRefPreferences;
import net.sf.jabref.preferences.SearchPreferences;
import net.sf.jabref.shared.prefs.SharedDatabasePreferences;

import org.apache.commons.logging.Log;
Expand Down Expand Up @@ -166,9 +167,10 @@ private boolean exportMatches(List<ParserResult> loaded) {
BibDatabaseContext databaseContext = pr.getDatabaseContext();
BibDatabase dataBase = pr.getDatabase();

SearchPreferences searchPreferences = new SearchPreferences(Globals.prefs);
SearchQuery query = new SearchQuery(searchTerm,
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_CASE_SENSITIVE),
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_REG_EXP));
searchPreferences.isCaseSensitive(),
searchPreferences.isRegularExpression());
List<BibEntry> matches = new DatabaseSearcher(query, dataBase).getMatches();

//export matches
Expand Down
60 changes: 40 additions & 20 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
import net.sf.jabref.collab.FileUpdateListener;
import net.sf.jabref.collab.FileUpdatePanel;
import net.sf.jabref.event.source.EntryEventSource;
import net.sf.jabref.external.AttachFileAction;
import net.sf.jabref.external.ExternalFileMenuItem;
import net.sf.jabref.external.ExternalFileType;
import net.sf.jabref.external.ExternalFileTypes;
import net.sf.jabref.external.FindFullTextAction;
import net.sf.jabref.external.SynchronizeFileField;
import net.sf.jabref.external.WriteXMPAction;
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.actions.BaseAction;
import net.sf.jabref.gui.actions.CleanupAction;
Expand All @@ -62,7 +55,16 @@
import net.sf.jabref.gui.entryeditor.EntryEditor;
import net.sf.jabref.gui.exporter.ExportToClipboardAction;
import net.sf.jabref.gui.exporter.SaveDatabaseAction;
import net.sf.jabref.gui.externalfiles.FindFullTextAction;
import net.sf.jabref.gui.externalfiles.SynchronizeFileField;
import net.sf.jabref.gui.externalfiles.WriteXMPAction;
import net.sf.jabref.gui.externalfiletype.ExternalFileMenuItem;
import net.sf.jabref.gui.externalfiletype.ExternalFileType;
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
import net.sf.jabref.gui.fieldeditors.FieldEditor;
import net.sf.jabref.gui.filelist.AttachFileAction;
import net.sf.jabref.gui.filelist.FileListEntry;
import net.sf.jabref.gui.filelist.FileListTableModel;
import net.sf.jabref.gui.groups.GroupAddRemoveDialog;
import net.sf.jabref.gui.groups.GroupSelector;
import net.sf.jabref.gui.groups.GroupTreeNodeViewModel;
Expand All @@ -76,7 +78,6 @@
import net.sf.jabref.gui.mergeentries.FetchAndMergeEntry;
import net.sf.jabref.gui.mergeentries.MergeEntriesDialog;
import net.sf.jabref.gui.plaintextimport.TextInputDialog;
import net.sf.jabref.gui.search.SearchBar;
import net.sf.jabref.gui.undo.CountingUndoManager;
import net.sf.jabref.gui.undo.NamedCompound;
import net.sf.jabref.gui.undo.UndoableChangeType;
Expand Down Expand Up @@ -105,6 +106,7 @@
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.layout.Layout;
import net.sf.jabref.logic.layout.LayoutHelper;
import net.sf.jabref.logic.search.SearchQuery;
import net.sf.jabref.logic.util.FileExtensions;
import net.sf.jabref.logic.util.UpdateField;
import net.sf.jabref.logic.util.io.FileBasedLock;
Expand Down Expand Up @@ -203,9 +205,10 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe

private final SidePaneManager sidePaneManager;

private final SearchBar searchBar;
private ContentAutoCompleters autoCompleters;

private SearchQuery currentSearchQuery;


public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
Objects.requireNonNull(frame);
Expand All @@ -217,17 +220,16 @@ public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
this.frame = frame;
this.tableModel = new MainTableDataModel(getBibDatabaseContext());

searchBar = new SearchBar(this);

setupMainPanel();

setupActions();

Optional<File> file = bibDatabaseContext.getDatabaseFile();
this.getDatabase().registerListener(new SearchListener());

// ensure that at each addition of a new entry, the entry is added to the groups interface
this.bibDatabaseContext.getDatabase().registerListener(new GroupTreeListener());

Optional<File> file = bibDatabaseContext.getDatabaseFile();
if (file.isPresent()) {
// Register so we get notifications about outside changes to the file.
try {
Expand Down Expand Up @@ -517,7 +519,8 @@ public void update() {

actions.put(Actions.MERGE_ENTRIES, (BaseAction) () -> new MergeEntriesDialog(BasePanel.this));

actions.put(Actions.SEARCH, (BaseAction) searchBar::focus);
actions.put(Actions.SEARCH, (BaseAction) frame.getGlobalSearchBar()::focus);
actions.put(Actions.GLOBAL_SEARCH, (BaseAction) frame.getGlobalSearchBar()::performGlobalSearch);

// The action for copying the selected entry's key.
actions.put(Actions.COPY_KEY, (BaseAction) () -> copyKey());
Expand Down Expand Up @@ -1164,11 +1167,6 @@ public BibEntry newEntry(EntryType type) {
return null;
}

public SearchBar getSearchBar() {
return searchBar;
}


private class GroupTreeListener {

private final Runnable task = new Runnable() {
Expand Down Expand Up @@ -1271,6 +1269,21 @@ public void listen(EntryChangedEvent entryChangedEvent) {
}
}

/**
* Ensures that the results of the current search are updated when a new entry is inserted into the database
*/
private class SearchListener {
@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
frame.getGlobalSearchBar().performSearch();
}

@Subscribe
public void listen(EntryChangedEvent entryChangedEvent) {
frame.getGlobalSearchBar().performSearch();
}
}


/**
* This method is called from JabRefFrame when the user wants to create a new entry.
Expand Down Expand Up @@ -1475,7 +1488,6 @@ public void setupMainPanel() {

setLayout(new BorderLayout());
removeAll();
add(searchBar, BorderLayout.NORTH);
add(splitPane, BorderLayout.CENTER);

// Set up name autocompleter for search:
Expand Down Expand Up @@ -1509,7 +1521,7 @@ public void setupMainPanel() {
}

public void updateSearchManager() {
searchBar.setAutoCompleter(searchAutoCompleter);
frame.getGlobalSearchBar().setAutoCompleter(searchAutoCompleter);
}

private void instantiateSearchAutoCompleter() {
Expand Down Expand Up @@ -2412,4 +2424,12 @@ public Map<String, EntryEditor> getEntryEditors() {
public BibDatabaseContext getDatabaseContext() {
return bibDatabaseContext;
}

public SearchQuery getCurrentSearchQuery() {
return currentSearchQuery;
}

public void setCurrentSearchQuery(SearchQuery currentSearchQuery) {
this.currentSearchQuery = currentSearchQuery;
}
}
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/GUIGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import javax.swing.JLabel;

import net.sf.jabref.Globals;
import net.sf.jabref.external.ExternalFileType;
import net.sf.jabref.external.ExternalFileTypes;
import net.sf.jabref.gui.externalfiletype.ExternalFileType;
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
import net.sf.jabref.gui.keyboard.EmacsKeyBindings;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.entry.FieldName;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public enum JabRefIcon {
FORUM("\uf28c"), /* css: forum */
FACEBOOK("\uf20c"), /* css: facebook */
BLOG("\uf46b"), /* css: rss */
GLOBAL_SEARCH_ON("\uF1E7"), /* css: earth */
GLOBAL_SEARCH_OFF("\uF1E8"), /* css: earth-off */
// STILL MISSING:
GROUP_REGULAR("\uF4E6", Color.RED);

Expand Down
Loading

0 comments on commit 9be2619

Please sign in to comment.