Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
- Fix bug #194: JabRef starts again on Win XP and Win Vista
- Remove support for custom icon themes. The user has to use the default one.
- Bugfix: Tooltips are now shown for the #-field when the bibtex entry is incomplete.
- Improvements to search:
- Search bar is now at the top
- Autocompletion suggestions are shown in a popup
- Search options are available via a drop-down list, this implements Feature Request #853
- "Clear search" button also clears search field, this implements Feature Request #601
- In incremental search mode: next result is selected by pressing enter (instead of Control + F as previously)
- Incremental search now uses the same search engine as the other search modes
- Added a new search mode (Live filter) which filters the table as soon as the search text is changed
- Solved feature request #767: New subdatabase based on AUX file (biblatex)
- Fixes GH Bug #173: Personal journal abbreviation list is not loaded twice
- Bugfix: Preview of external journal abbreviation list now displays the correct list
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ dependencies {

compile 'net.java.dev.jna:jna:4.2.1'

compile files('lib/JSplitButton_1.2.jar')

compile 'com.google.guava:guava:18.0'

compile 'commons-logging:commons-logging:1.2'
Expand Down
7 changes: 6 additions & 1 deletion external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,9 @@ 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.
Path: lib/JSplitButton_1.2.jar
Project: jsplitbutton
URL: https://code.google.com/p/jsplitbutton/
License: LGPL

The last entry has to end with an empty line. Otherwise the entry is not present in About.html.
Binary file added lib/JSplitButton_1.2.jar
Binary file not shown.
Empty file modified scripts/upload-to-gett.sh
100755 → 100644
Empty file.
53 changes: 23 additions & 30 deletions src/main/java/net/sf/jabref/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,9 @@ public class JabRefPreferences {
public static final String SIDE_PANE_COMPONENT_NAMES = "sidePaneComponentNames";
public static final String XMP_PRIVACY_FILTERS = "xmpPrivacyFilters";
public static final String USE_XMP_PRIVACY_FILTER = "useXmpPrivacyFilter";
public static final String SEARCH_AUTO_COMPLETE = "searchAutoComplete";
public static final String INCREMENT_S = "incrementS";
public static final String SEARCH_ALL = "searchAll";
public static final String SEARCH_GEN = "searchGen";
public static final String SEARCH_OPT = "searchOpt";
public static final String SEARCH_REQ = "searchReq";
public static final String CASE_SENSITIVE_SEARCH = "caseSensitiveSearch";
public static final String SEARCH_MODE_LIVE_FILTER = "searchModeLiveFilter";
public static final String SEARCH_MODE_INCREMENTAL = "incrementS";
public static final String SEARCH_CASE_SENSITIVE = "caseSensitiveSearch";
public static final String DEFAULT_AUTO_SORT = "defaultAutoSort";
public static final String DEFAULT_SHOW_SOURCE = "defaultShowSource";
public static final String STRINGS_SIZE_Y = "stringsSizeY";
Expand Down Expand Up @@ -164,9 +160,10 @@ public class JabRefPreferences {
public static final String AUTO_COMP_FIRST_LAST = "autoCompFF";
public static final String AUTO_COMPLETE_FIELDS = "autoCompleteFields";
public static final String AUTO_COMPLETE = "autoComplete";
public static final String HIGH_LIGHT_WORDS = "highLightWords";
public static final String REG_EXP_SEARCH = "regExpSearch";
public static final String SELECT_S = "selectS";
public static final String SEARCH_PANE_POS_Y = "searchPanePosY";
public static final String SEARCH_PANE_POS_X = "searchPanePosX";
public static final String SEARCH_HIGHLIGHT_WORDS = "highLightWords";
public static final String SEARCH_REG_EXP = "regExpSearch";
public static final String EDITOR_EMACS_KEYBINDINGS = "editorEMACSkeyBindings";
public static final String EDITOR_EMACS_KEYBINDINGS_REBIND_CA = "editorEMACSkeyBindingsRebindCA";
public static final String EDITOR_EMACS_KEYBINDINGS_REBIND_CF = "editorEMACSkeyBindingsRebindCF";
Expand Down Expand Up @@ -227,7 +224,7 @@ public class JabRefPreferences {
public static final String DEFAULT_OWNER = "defaultOwner";
public static final String GROUPS_VISIBLE_ROWS = "groupsVisibleRows";
public static final String DEFAULT_ENCODING = "defaultEncoding";
public static final String SEARCH_PANEL_VISIBLE = "searchPanelVisible";
public static final String SEARCH_BAR_VISIBLE = "searchBarVisible";
public static final String TOOLBAR_VISIBLE = "toolbarVisible";
public static final String HIGHLIGHT_GROUPS_MATCHING_ALL = "highlightGroupsMatchingAll";
public static final String HIGHLIGHT_GROUPS_MATCHING_ANY = "highlightGroupsMatchingAny";
Expand Down Expand Up @@ -256,9 +253,9 @@ public class JabRefPreferences {
// When this should be made possible, the code to inspect is net.sf.jabref.gui.preftabs.LabelPatternPrefTab.storeSettings() -> LabelPattern keypatterns = getLabelPattern(); etc
public static final String DEFAULT_LABEL_PATTERN = "defaultLabelPattern";

public static final String SEARCH_ALL_BASES = "searchAllBases";
public static final String SHOW_SEARCH_IN_DIALOG = "showSearchInDialog";
public static final String FLOAT_SEARCH = "floatSearch";
public static final String SEARCH_MODE_GLOBAL = "searchAllBases";
public static final String SEARCH_MODE_RESULTS_IN_DIALOG = "showSearchInDialog";
public static final String SEARCH_MODE_FLOAT = "floatSearch";
public static final String GRAY_OUT_NON_HITS = "grayOutNonHits";
public static final String CONFIRM_DELETE = "confirmDelete";
public static final String WARN_BEFORE_OVERWRITING_KEY = "warnBeforeOverwritingKey";
Expand Down Expand Up @@ -541,25 +538,21 @@ private JabRefPreferences() {
defaults.put(DUPLICATES_SIZE_Y, 600);
defaults.put(DEFAULT_SHOW_SOURCE, Boolean.FALSE);
defaults.put(DEFAULT_AUTO_SORT, Boolean.FALSE);
defaults.put(CASE_SENSITIVE_SEARCH, Boolean.FALSE);
defaults.put(SEARCH_REQ, Boolean.TRUE);
defaults.put(SEARCH_OPT, Boolean.TRUE);
defaults.put(SEARCH_GEN, Boolean.TRUE);
defaults.put(SEARCH_ALL, Boolean.FALSE);
defaults.put(INCREMENT_S, Boolean.FALSE);
defaults.put(SEARCH_AUTO_COMPLETE, Boolean.TRUE);

defaults.put(SELECT_S, Boolean.FALSE);
defaults.put(REG_EXP_SEARCH, Boolean.TRUE);
defaults.put(HIGH_LIGHT_WORDS, Boolean.TRUE);
defaults.put(SEARCH_CASE_SENSITIVE, Boolean.FALSE);
defaults.put(SEARCH_MODE_INCREMENTAL, Boolean.FALSE);
defaults.put(SEARCH_MODE_LIVE_FILTER, Boolean.TRUE);
defaults.put(SEARCH_REG_EXP, Boolean.TRUE);
defaults.put(SEARCH_HIGHLIGHT_WORDS, Boolean.TRUE);
defaults.put(SEARCH_PANE_POS_X, 0);
defaults.put(SEARCH_PANE_POS_Y, 0);
defaults.put(EDITOR_EMACS_KEYBINDINGS, Boolean.FALSE);
defaults.put(EDITOR_EMACS_KEYBINDINGS_REBIND_CA, Boolean.TRUE);
defaults.put(EDITOR_EMACS_KEYBINDINGS_REBIND_CF, Boolean.TRUE);
defaults.put(AUTO_COMPLETE, Boolean.TRUE);
defaults.put(AUTO_COMPLETE_FIELDS, "author;editor;title;journal;publisher;keywords;crossref");
defaults.put(AUTO_COMP_FIRST_LAST, Boolean.FALSE); // "Autocomplete names in 'Firstname Lastname' format only"
defaults.put(AUTO_COMP_LAST_FIRST, Boolean.FALSE); // "Autocomplete names in 'Lastname, Firstname' format only"
defaults.put(SHORTEST_TO_COMPLETE, 2);
defaults.put(SHORTEST_TO_COMPLETE, 1);
defaults.put(AUTOCOMPLETE_FIRSTNAME_MODE, JabRefPreferences.AUTOCOMPLETE_FIRSTNAME_MODE_BOTH);
defaults.put(GROUP_FLOAT_SELECTIONS, Boolean.TRUE);
defaults.put(GROUP_INTERSECT_SELECTIONS, Boolean.TRUE);
Expand All @@ -579,7 +572,7 @@ private JabRefPreferences() {
defaults.put(HIGHLIGHT_GROUPS_MATCHING_ANY, Boolean.FALSE);
defaults.put(HIGHLIGHT_GROUPS_MATCHING_ALL, Boolean.FALSE);
defaults.put(TOOLBAR_VISIBLE, Boolean.TRUE);
defaults.put(SEARCH_PANEL_VISIBLE, Boolean.FALSE);
defaults.put(SEARCH_BAR_VISIBLE, Boolean.TRUE);
defaults.put(DEFAULT_ENCODING, "UTF-8");
defaults.put(GROUPS_VISIBLE_ROWS, 8);
defaults.put(DEFAULT_OWNER, System.getProperty("user.name"));
Expand Down Expand Up @@ -653,9 +646,9 @@ private JabRefPreferences() {
defaults.put(WARN_BEFORE_OVERWRITING_KEY, Boolean.TRUE);
defaults.put(CONFIRM_DELETE, Boolean.TRUE);
defaults.put(GRAY_OUT_NON_HITS, Boolean.TRUE);
defaults.put(FLOAT_SEARCH, Boolean.TRUE);
defaults.put(SHOW_SEARCH_IN_DIALOG, Boolean.FALSE);
defaults.put(SEARCH_ALL_BASES, Boolean.FALSE);
defaults.put(SEARCH_MODE_FLOAT, Boolean.TRUE);
defaults.put(SEARCH_MODE_RESULTS_IN_DIALOG, Boolean.FALSE);
defaults.put(SEARCH_MODE_GLOBAL, Boolean.FALSE);
defaults.put(DEFAULT_LABEL_PATTERN, "[authors3][year]");
defaults.put(PREVIEW_ENABLED, Boolean.TRUE);
defaults.put(ACTIVE_PREVIEW, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/SearchManagerNoGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public BibtexDatabase getDBfromMatches() {
}

SearchRule searchRule = SearchRules.getSearchRuleByQuery(searchTerm,
Globals.prefs.getBoolean(JabRefPreferences.CASE_SENSITIVE_SEARCH),
Globals.prefs.getBoolean(JabRefPreferences.REG_EXP_SEARCH));
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_CASE_SENSITIVE),
Globals.prefs.getBoolean(JabRefPreferences.SEARCH_REG_EXP));

if (!searchRule.validateSearchStrings(searchTerm)) {
LOGGER.warn(Localization.lang("Search failed: illegal search expression"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/exporter/layout/Layout.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.commons.logging.LogFactory;

import java.util.ArrayList;
import java.util.List;

import net.sf.jabref.model.database.BibtexDatabase;
import net.sf.jabref.model.entry.BibtexEntry;
Expand Down Expand Up @@ -121,7 +122,7 @@ public String doLayout(BibtexEntry bibtex, BibtexDatabase database) {
* string references will be replaced by the strings' contents. Even
* recursive string references are resolved.
*/
public String doLayout(BibtexEntry bibtex, BibtexDatabase database, ArrayList<String> wordsToHighlight)
public String doLayout(BibtexEntry bibtex, BibtexDatabase database, List<String> wordsToHighlight)
{
StringBuilder sb = new StringBuilder(100);

Expand Down
14 changes: 8 additions & 6 deletions src/main/java/net/sf/jabref/exporter/layout/LayoutEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -178,7 +180,7 @@ private String doLayout(BibtexEntry bibtex, BibtexDatabase database) {
return doLayout(bibtex, database, null);
}

public String doLayout(BibtexEntry bibtex, BibtexDatabase database, ArrayList<String> wordsToHighlight) {
public String doLayout(BibtexEntry bibtex, BibtexDatabase database, List<String> wordsToHighlight) {
switch (type) {
case LayoutHelper.IS_LAYOUT_TEXT:
return text;
Expand Down Expand Up @@ -480,16 +482,16 @@ public ArrayList<String> getInvalidFormatters() {
* This check is a quick hack to avoid highlighting of HTML tags It does not always work, but it does its job mostly
*
* @param text This is a String in which we search for different words
* @param toHighlight List of all words which must be highlighted
*
* @param wordsToHighlight List of all words which must be highlighted
*
* @return String that was called by the method, with HTML Tags if a word was found
*/
private String highlightWords(String text, ArrayList<String> toHighlight) {
if (toHighlight == null) {
private String highlightWords(String text, List<String> wordsToHighlight) {
if (wordsToHighlight == null) {
return text;
}

Matcher matcher = Util.getPatternForWords(toHighlight).matcher(text);
Matcher matcher = Util.getPatternForWords(wordsToHighlight).matcher(text);

if (Character.isLetterOrDigit(text.charAt(0))) {
String hlColor = HIGHLIGHT_COLOR;
Expand Down
34 changes: 13 additions & 21 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.actions.BaseAction;
import net.sf.jabref.gui.actions.CleanUpAction;
import net.sf.jabref.gui.desktop.JabRefDesktop;
import net.sf.jabref.gui.entryeditor.EntryEditor;
import net.sf.jabref.gui.fieldeditors.FieldEditor;
import net.sf.jabref.gui.journals.AbbreviateAction;
Expand All @@ -70,7 +71,6 @@
import net.sf.jabref.logic.search.matchers.NoSearchMatcher;
import net.sf.jabref.logic.search.matchers.SearchMatcher;
import net.sf.jabref.logic.util.io.FileBasedLock;
import net.sf.jabref.gui.desktop.JabRefDesktop;
import net.sf.jabref.model.database.BibtexDatabase;
import net.sf.jabref.model.database.DatabaseChangeEvent;
import net.sf.jabref.model.database.DatabaseChangeEvent.ChangeType;
Expand Down Expand Up @@ -126,11 +126,8 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints con = new GridBagConstraints();

// Hashtable indexing the only search auto completer
// required for the SearchAutoCompleterUpdater
private AutoCompleter searchAutoCompleter;

private AutoCompleteListener searchCompleteListener;
// AutoCompleter used in the search bar
private AutoCompleter<String> searchAutoCompleter;

// The undo manager.
public final CountingUndoManager undoManager = new CountingUndoManager(this);
Expand Down Expand Up @@ -189,6 +186,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
private final SidePaneManager sidePaneManager;


// Returns a collection of AutoCompleters, which are populated from the current database
public ContentAutoCompleters getAutoCompleters() {
return autoCompleters;
}
Expand Down Expand Up @@ -722,24 +720,20 @@ public void run() {
actions.put(Actions.MERGE_ENTRIES, (BaseAction) () -> new MergeEntriesDialog(BasePanel.this));

actions.put(Actions.SEARCH, (BaseAction) () -> {
sidePaneManager.show("search");
frame.searchToggle.setSelected(true);
frame.getSearchManager().startSearch();
frame.setSearchBarVisible(true);
frame.getSearchBar().focus();
});

actions.put(Actions.TOGGLE_SEARCH, (BaseAction) () -> {
sidePaneManager.toggle("search");
boolean on = sidePaneManager.isComponentVisible("search");
frame.searchToggle.setSelected(on);
if (on) {
frame.getSearchManager().startSearch();
}
frame.setSearchBarVisible(! frame.searchBar.isVisible());
if (frame.searchBar.isVisible()) {
frame.getSearchBar().focus();
}
});

actions.put(Actions.INC_SEARCH, (BaseAction) () -> {
sidePaneManager.show("search");
frame.searchToggle.setSelected(true);
frame.getSearchManager().startIncrementalSearch();
frame.setSearchBarVisible(true);
frame.getSearchBar().startIncrementalSearch();
});

// The action for copying the selected entry's key.
Expand Down Expand Up @@ -1840,16 +1834,14 @@ protected boolean accept(Component c) {
}

public void updateSearchManager() {
frame.getSearchManager().setAutoCompleteListener(searchCompleteListener);
frame.getSearchBar().setAutoCompleter(searchAutoCompleter);
}

private void instantiateSearchAutoCompleter() {
searchAutoCompleter = AutoCompleterFactory.getFor("author", "editor");
for (BibtexEntry entry : database.getEntries()) {
searchAutoCompleter.addBibtexEntry(entry);
}
searchCompleteListener = new AutoCompleteListener(searchAutoCompleter);
searchCompleteListener.setConsumeEnterKey(false); // So you don't have to press Enter twice
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/IconComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Comparator that handles icon columns.
*/
class IconComparator implements Comparator<BibtexEntry> {
public class IconComparator implements Comparator<BibtexEntry> {

private final String[] fields;

Expand Down
79 changes: 0 additions & 79 deletions src/main/java/net/sf/jabref/gui/IncrementalSearcher.java

This file was deleted.

Loading