Skip to content

Commit 9be2619

Browse files
committed
Merge branch 'master' into xmlunit
* 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)
2 parents 7b7d6f4 + 7bae954 commit 9be2619

File tree

109 files changed

+1141
-806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1141
-806
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Jörg Lenhard
7979
Jörg Wegner
8080
Jörg Zieren
8181
Jørgen Kvalsvik
82+
Jürgen Lange
8283
Kai Mindermann
8384
Koji Yokota
8485
Kolja Brix

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
1212
## [Unreleased]
1313

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

2734
### Fixed
2835
- Fixed selecting an entry out of multiple duplicates
36+
- 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
37+
- Entries in the SearchResultPanel will be shown correctly (Latex to Unicode)
38+
- Suggestions in the autocomplete will be shown correctly (Latex to Unicode)
39+
- Fixed: When searching the first match will be selected if the current selection is no match
40+
- Selecting an entry in the search result Window will now select the correct entry in the bib file
41+
- Entries in the SearchResultDialog are now converted to Unicode
42+
- Suggestions in the autocomplete (search) are now in Unicode
2943
- Fixed NullPointerException when opening search result window for an untitled database
3044
- Fixed entry table traversal with Tab (no column traversal thus no double jump)
3145
- Fixed [#1757](https://github.com/JabRef/jabref/issues/1757): Crash after saving illegal argument in entry editor
3246
- Fixed [#1663](https://github.com/JabRef/jabref/issues/1663): Better multi-monitor support
3347
- Fixed [#1882](https://github.com/JabRef/jabref/issues/1882): Crash after saving illegal bibtexkey in entry editor
3448
- Fixed field `location` containing only city is not exported correctly to MS-Office 2007 xml format
3549
- Fixed field `key` field is not exported to MS-Office 2008 xml format
50+
- Fixed download files failed silently when an invalid directory is selected
3651

3752
### Removed
3853
- 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.
54+
- Automatic migration for the `evastar_pdf` field is removed.
3955

4056

4157

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ You can add the prefix `[WIP]` to indicate that the pull request is not yet comp
101101

102102
[commit guidelines section of Pro Git]: http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines
103103
[good commit message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
104-
[help documentation]: https://help.github.com/articles/using-pull-requests/
104+
[help documentation]: https://help.github.com/articles/about-pull-requests/

build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import org.gradle.internal.os.OperatingSystem
22

3+
// to update the gradle wrapper, execute ./gradlew wrapper --gradle-version 3.0
4+
35
buildscript {
46
repositories {
57
maven {
@@ -46,11 +48,6 @@ install4j {
4648
installDir = file(project.ext.install4jDir)
4749
}
4850

49-
task wrapper(type: Wrapper) {
50-
gradleVersion = '2.14.1'
51-
}
52-
53-
5451
repositories {
5552
jcenter()
5653
}
@@ -154,6 +151,8 @@ processResources {
154151
"year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)),
155152
"authors": new File('AUTHORS').readLines().findAll { !it.startsWith("#") }.join(", "),
156153
"developers": new File('DEVELOPERS').readLines().findAll { !it.startsWith("#") }.join(", "))
154+
155+
filteringCharset = 'UTF-8'
157156
}
158157

159158
filesMatching("resource/**/meta.xml") {

src/main/java/net/sf/jabref/cli/ArgumentProcessor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import net.sf.jabref.Globals;
1919
import net.sf.jabref.JabRefException;
2020
import net.sf.jabref.MetaData;
21-
import net.sf.jabref.external.AutoSetLinks;
21+
import net.sf.jabref.gui.externalfiles.AutoSetLinks;
2222
import net.sf.jabref.gui.importer.fetcher.EntryFetcher;
2323
import net.sf.jabref.gui.importer.fetcher.EntryFetchers;
2424
import net.sf.jabref.logic.CustomEntryTypesManager;
@@ -47,6 +47,7 @@
4747
import net.sf.jabref.model.database.BibDatabaseMode;
4848
import net.sf.jabref.model.entry.BibEntry;
4949
import net.sf.jabref.preferences.JabRefPreferences;
50+
import net.sf.jabref.preferences.SearchPreferences;
5051
import net.sf.jabref.shared.prefs.SharedDatabasePreferences;
5152

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

170+
SearchPreferences searchPreferences = new SearchPreferences(Globals.prefs);
169171
SearchQuery query = new SearchQuery(searchTerm,
170-
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_CASE_SENSITIVE),
171-
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_REG_EXP));
172+
searchPreferences.isCaseSensitive(),
173+
searchPreferences.isRegularExpression());
172174
List<BibEntry> matches = new DatabaseSearcher(query, dataBase).getMatches();
173175

174176
//export matches

src/main/java/net/sf/jabref/gui/BasePanel.java

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@
4747
import net.sf.jabref.collab.FileUpdateListener;
4848
import net.sf.jabref.collab.FileUpdatePanel;
4949
import net.sf.jabref.event.source.EntryEventSource;
50-
import net.sf.jabref.external.AttachFileAction;
51-
import net.sf.jabref.external.ExternalFileMenuItem;
52-
import net.sf.jabref.external.ExternalFileType;
53-
import net.sf.jabref.external.ExternalFileTypes;
54-
import net.sf.jabref.external.FindFullTextAction;
55-
import net.sf.jabref.external.SynchronizeFileField;
56-
import net.sf.jabref.external.WriteXMPAction;
5750
import net.sf.jabref.gui.actions.Actions;
5851
import net.sf.jabref.gui.actions.BaseAction;
5952
import net.sf.jabref.gui.actions.CleanupAction;
@@ -62,7 +55,16 @@
6255
import net.sf.jabref.gui.entryeditor.EntryEditor;
6356
import net.sf.jabref.gui.exporter.ExportToClipboardAction;
6457
import net.sf.jabref.gui.exporter.SaveDatabaseAction;
58+
import net.sf.jabref.gui.externalfiles.FindFullTextAction;
59+
import net.sf.jabref.gui.externalfiles.SynchronizeFileField;
60+
import net.sf.jabref.gui.externalfiles.WriteXMPAction;
61+
import net.sf.jabref.gui.externalfiletype.ExternalFileMenuItem;
62+
import net.sf.jabref.gui.externalfiletype.ExternalFileType;
63+
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
6564
import net.sf.jabref.gui.fieldeditors.FieldEditor;
65+
import net.sf.jabref.gui.filelist.AttachFileAction;
66+
import net.sf.jabref.gui.filelist.FileListEntry;
67+
import net.sf.jabref.gui.filelist.FileListTableModel;
6668
import net.sf.jabref.gui.groups.GroupAddRemoveDialog;
6769
import net.sf.jabref.gui.groups.GroupSelector;
6870
import net.sf.jabref.gui.groups.GroupTreeNodeViewModel;
@@ -76,7 +78,6 @@
7678
import net.sf.jabref.gui.mergeentries.FetchAndMergeEntry;
7779
import net.sf.jabref.gui.mergeentries.MergeEntriesDialog;
7880
import net.sf.jabref.gui.plaintextimport.TextInputDialog;
79-
import net.sf.jabref.gui.search.SearchBar;
8081
import net.sf.jabref.gui.undo.CountingUndoManager;
8182
import net.sf.jabref.gui.undo.NamedCompound;
8283
import net.sf.jabref.gui.undo.UndoableChangeType;
@@ -105,6 +106,7 @@
105106
import net.sf.jabref.logic.l10n.Localization;
106107
import net.sf.jabref.logic.layout.Layout;
107108
import net.sf.jabref.logic.layout.LayoutHelper;
109+
import net.sf.jabref.logic.search.SearchQuery;
108110
import net.sf.jabref.logic.util.FileExtensions;
109111
import net.sf.jabref.logic.util.UpdateField;
110112
import net.sf.jabref.logic.util.io.FileBasedLock;
@@ -203,9 +205,10 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
203205

204206
private final SidePaneManager sidePaneManager;
205207

206-
private final SearchBar searchBar;
207208
private ContentAutoCompleters autoCompleters;
208209

210+
private SearchQuery currentSearchQuery;
211+
209212

210213
public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
211214
Objects.requireNonNull(frame);
@@ -217,17 +220,16 @@ public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
217220
this.frame = frame;
218221
this.tableModel = new MainTableDataModel(getBibDatabaseContext());
219222

220-
searchBar = new SearchBar(this);
221-
222223
setupMainPanel();
223224

224225
setupActions();
225226

226-
Optional<File> file = bibDatabaseContext.getDatabaseFile();
227+
this.getDatabase().registerListener(new SearchListener());
227228

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

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

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

520-
actions.put(Actions.SEARCH, (BaseAction) searchBar::focus);
522+
actions.put(Actions.SEARCH, (BaseAction) frame.getGlobalSearchBar()::focus);
523+
actions.put(Actions.GLOBAL_SEARCH, (BaseAction) frame.getGlobalSearchBar()::performGlobalSearch);
521524

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

1167-
public SearchBar getSearchBar() {
1168-
return searchBar;
1169-
}
1170-
1171-
11721170
private class GroupTreeListener {
11731171

11741172
private final Runnable task = new Runnable() {
@@ -1271,6 +1269,21 @@ public void listen(EntryChangedEvent entryChangedEvent) {
12711269
}
12721270
}
12731271

1272+
/**
1273+
* Ensures that the results of the current search are updated when a new entry is inserted into the database
1274+
*/
1275+
private class SearchListener {
1276+
@Subscribe
1277+
public void listen(EntryAddedEvent addedEntryEvent) {
1278+
frame.getGlobalSearchBar().performSearch();
1279+
}
1280+
1281+
@Subscribe
1282+
public void listen(EntryChangedEvent entryChangedEvent) {
1283+
frame.getGlobalSearchBar().performSearch();
1284+
}
1285+
}
1286+
12741287

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

14761489
setLayout(new BorderLayout());
14771490
removeAll();
1478-
add(searchBar, BorderLayout.NORTH);
14791491
add(splitPane, BorderLayout.CENTER);
14801492

14811493
// Set up name autocompleter for search:
@@ -1509,7 +1521,7 @@ public void setupMainPanel() {
15091521
}
15101522

15111523
public void updateSearchManager() {
1512-
searchBar.setAutoCompleter(searchAutoCompleter);
1524+
frame.getGlobalSearchBar().setAutoCompleter(searchAutoCompleter);
15131525
}
15141526

15151527
private void instantiateSearchAutoCompleter() {
@@ -2412,4 +2424,12 @@ public Map<String, EntryEditor> getEntryEditors() {
24122424
public BibDatabaseContext getDatabaseContext() {
24132425
return bibDatabaseContext;
24142426
}
2427+
2428+
public SearchQuery getCurrentSearchQuery() {
2429+
return currentSearchQuery;
2430+
}
2431+
2432+
public void setCurrentSearchQuery(SearchQuery currentSearchQuery) {
2433+
this.currentSearchQuery = currentSearchQuery;
2434+
}
24152435
}

src/main/java/net/sf/jabref/gui/GUIGlobals.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import javax.swing.JLabel;
99

1010
import net.sf.jabref.Globals;
11-
import net.sf.jabref.external.ExternalFileType;
12-
import net.sf.jabref.external.ExternalFileTypes;
11+
import net.sf.jabref.gui.externalfiletype.ExternalFileType;
12+
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
1313
import net.sf.jabref.gui.keyboard.EmacsKeyBindings;
1414
import net.sf.jabref.logic.l10n.Localization;
1515
import net.sf.jabref.model.entry.FieldName;

src/main/java/net/sf/jabref/gui/IconTheme.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public enum JabRefIcon {
157157
FORUM("\uf28c"), /* css: forum */
158158
FACEBOOK("\uf20c"), /* css: facebook */
159159
BLOG("\uf46b"), /* css: rss */
160+
GLOBAL_SEARCH_ON("\uF1E7"), /* css: earth */
161+
GLOBAL_SEARCH_OFF("\uF1E8"), /* css: earth-off */
160162
// STILL MISSING:
161163
GROUP_REGULAR("\uF4E6", Color.RED);
162164

0 commit comments

Comments
 (0)