Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/JabRef/jabref
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Jan 27, 2016
2 parents 1023aa1 + 04be416 commit 3d7d02f
Show file tree
Hide file tree
Showing 273 changed files with 347 additions and 19,225 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
- [#459](https://github.com/JabRef/jabref/issues/459) Open default directory when trying to add files to an entry
- Implemented [#668](https://github.com/JabRef/jabref/issues/668): Replace clear with icon to reduce search bar width
- Improved layout for OSX: Toolbar buttons and search field
- Migrated JabRef help to markdown at https://github.com/JabRef/help.jabref.org

### Fixed
- Make BibTex parser more robust against missing newlines
Expand All @@ -40,6 +41,7 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
- Removed configuration option to use database file directory as base directory for attached files and make it default instead.
- Removed save session functionality as it just saved the last opened tabs which is done by default
- Removed CLI option -l to load a session
- Removed JabRef offline help files which are replaced by the new online documentation at https://github.com/JabRef/help.jabref.org



Expand Down
60 changes: 3 additions & 57 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,65 +118,11 @@ sourceSets {
}

processResources {
def licenseInformation = ""
def id = ""
def projectName
def url
def license
def note = ""

def externalLibraries = new File('external-libraries.txt')
externalLibraries.eachLine { currentLine ->
if (currentLine.startsWith('Id')) {
id = currentLine.substring(9)
// TODO: we can distinguish between fonts and libraries by the suffix of the id:
// fonts always end with ".font"
// With that information we can generate different sections
} else if (currentLine.startsWith('Project')) {
projectName = currentLine.substring(9)
} else if (currentLine.startsWith('URL')) {
url = currentLine.substring(9)
} else if (currentLine.startsWith('License:')) {
license = currentLine.substring(9)
} else if (currentLine.startsWith('Note:')) {
note = currentLine.substring(9)
} else if (currentLine.isEmpty() && (!id.equals(""))) {
// the entry is finished, write it

licenseInformation += "\n<h3>" + projectName + "</h3>\n"
licenseInformation += '<p>URL: <a href="' + url + '">' + url + '</a></p>\n'
licenseInformation += '<p>License: ' + license + '</p>\n'
if (!note.equals("")) {
licenseInformation += '<p>Note: ' + note + '</p>\n'
}

id = id.replaceAll(':', '_')
def fileName = "licenses/" + id + ".txt"
def licenseInformationFile = new File(fileName)
if (licenseInformationFile.exists()) {
licenseInformation += '\n<h4>Further information</h4>\n'
licenseInformation += '<pre>\n'
licenseInformation += licenseInformationFile.text
licenseInformation += '</pre>\n'
}

// mark that entry has been written
id = ""
// note is not present at all entries. Ensure that no note is written instead of the last note.
note = ""
}
}

filesMatching("help/**/About.html") {
expand ("version": project.version,
filesMatching("build.properties") {
expand (version: project.version,
"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(", "),
"licenseInformation": licenseInformation)
}

filesMatching("build.properties") {
expand version: project.version
"developers": new File('DEVELOPERS').readLines().findAll {!it.startsWith("#")}.join(", "))
}

filesMatching("resource/**/meta.xml") {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/sf/jabref/bibtex/EntryTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.model.database.BibDatabase;
import net.sf.jabref.model.entry.*;

import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.sf.jabref.*;
import net.sf.jabref.gui.GUIGlobals;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.gui.util.FocusRequester;
Expand Down Expand Up @@ -126,7 +127,7 @@ public void actionPerformed(ActionEvent e) {
JButton close = new JButton(Localization.lang("Close"));
close.addActionListener(closeAction);

JButton help = new HelpAction(frame.helpDiag, GUIGlobals.exportCustomizationHelp).getIconButton();
JButton help = new HelpAction(HelpFiles.exportCustomizationHelp).getHelpButton();

DefaultEventTableModel<String[]> tableModel = new DefaultEventTableModel<>(
Globals.prefs.customExports.getSortedList(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.*;
import java.util.List;
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/net/sf/jabref/groups/GroupSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import javax.swing.undo.CompoundEdit;

import net.sf.jabref.gui.*;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.worker.AbstractWorker;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.Globals;
Expand All @@ -70,7 +72,6 @@
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.search.rules.InvertSearchRule;
import net.sf.jabref.logic.search.SearchRule;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.logic.search.rules.sets.SearchRuleSets;
import net.sf.jabref.logic.search.rules.sets.SearchRuleSet;
import net.sf.jabref.gui.undo.NamedCompound;
Expand Down Expand Up @@ -338,8 +339,8 @@ public void actionPerformed(ActionEvent e) {
newButton.setMinimumSize(butDim);
refresh.setPreferredSize(butDim);
refresh.setMinimumSize(butDim);
JButton helpButton = new HelpAction(frame.helpDiag, GUIGlobals.groupsHelp, Localization.lang("Help on groups"))
.getIconButton();
JButton helpButton = new HelpAction(Localization.lang("Help on groups"), HelpFiles.groupsHelp)
.getHelpButton();
helpButton.setPreferredSize(butDim);
helpButton.setMinimumSize(butDim);
autoGroup.setPreferredSize(butDim);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/gui/ContentSelectorDialog2.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

import net.sf.jabref.Globals;
import net.sf.jabref.MetaData;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.util.FocusRequester;
import net.sf.jabref.logic.l10n.Localization;
Expand Down Expand Up @@ -522,7 +523,7 @@ private void initLayout() {
bsb.addButton(apply);
bsb.addButton(cancel);
bsb.addRelatedGap();
bsb.addButton(new HelpAction(frame.helpDiag, GUIGlobals.contentSelectorHelp).getIconButton());
bsb.addButton(new HelpAction(HelpFiles.contentSelectorHelp).getHelpButton());
bsb.addGlue();

// Add panels to dialog:
Expand Down
36 changes: 3 additions & 33 deletions src/main/java/net/sf/jabref/gui/GUIGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.external.ExternalFileType;
import net.sf.jabref.external.ExternalFileTypes;
import net.sf.jabref.gui.help.HelpDialog;
import net.sf.jabref.gui.help.AboutDialog;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.specialfields.Printed;
import net.sf.jabref.specialfields.Priority;
Expand All @@ -56,9 +56,6 @@ public class GUIGlobals {
public static Font CURRENTFONT;
public static Font typeNameFont;

// Size of help window.
public static final Dimension
helpSize = new Dimension(750, 600);
public static final Dimension aboutSize = new Dimension(600, 265);
public static Double zoomLevel = 1.0;

Expand All @@ -78,38 +75,12 @@ public class GUIGlobals {
private static final String extension = ".gif";
public static String ex = GUIGlobals.imageSize + GUIGlobals.extension;
public static String pre = "/images/";
public static final String helpPre = "/help/";

private static final Map<String, JLabel> tableIcons = new HashMap<>(); // Contains table icon mappings. Set up
// further below.
public static final Color activeEditor = new Color(230, 230, 255);
public static SidePaneManager sidePaneManager;
public static HelpDialog helpDiag;

//Help files (in HTML format):
public static final String baseFrameHelp = "BaseFrameHelp.html";
public static final String entryEditorHelp = "EntryEditorHelp.html";
public static final String stringEditorHelp = "StringEditorHelp.html";
public static final String helpContents = "Contents.html";
public static final String searchHelp = "SearchHelp.html";
public static final String groupsHelp = "GroupsHelp.html";
public static final String contentSelectorHelp = "ContentSelectorHelp.html";
public static final String specialFieldsHelp = "SpecialFieldsHelp.html";
public static final String labelPatternHelp = "LabelPatterns.html";
public static final String ownerHelp = "OwnerHelp.html";
public static final String timeStampHelp = "TimeStampHelp.html";
public static final String exportCustomizationHelp = "CustomExports.html";
public static final String importCustomizationHelp = "CustomImports.html";
public static final String medlineHelp = "MedlineHelp.html";
public static final String generalFieldsHelp = "GeneralFields.html";
public static final String aboutPage = "About.html";
public static final String importInspectionHelp = "ImportInspectionDialog.html";
public static final String remoteHelp = "RemoteHelp.html";
public static final String journalAbbrHelp = "JournalAbbreviations.html";
public static final String regularExpressionSearchHelp = "ExternalFiles.html#RegularExpressionSearch";
public static final String nameFormatterHelp = "CustomExports.html#NameFormatter";
public static final String previewHelp = "PreviewHelp.html";
public static final String autosaveHelp = "Autosave.html";
public static AboutDialog helpDiag;

// Colors.
public static final Color entryEditorLabelColor = new Color(100, 100, 150); // Empty field, blue.
Expand Down Expand Up @@ -179,7 +150,6 @@ public static JLabel getTableIcon(String fieldType) {
}
}


public static void updateEntryEditorColors() {
GUIGlobals.activeBackground = JabRefPreferences.getInstance().getColor(JabRefPreferences.ACTIVE_FIELD_EDITOR_BACKGROUND_COLOR);
GUIGlobals.validFieldBackgroundColor = JabRefPreferences.getInstance().getColor(JabRefPreferences.VALID_FIELD_BACKGROUND_COLOR);
Expand Down Expand Up @@ -266,4 +236,4 @@ public static void init() {
}
}

}
}
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/gui/GenFieldsCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.swing.*;
import net.sf.jabref.*;
import net.sf.jabref.gui.entryeditor.EntryEditorTabList;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.keyboard.KeyBinding;

Expand Down Expand Up @@ -60,7 +61,7 @@ public class GenFieldsCustomizer extends JDialog {
public GenFieldsCustomizer(JabRefFrame frame/*, EntryCustomizationDialog diag*/) {
super(frame, Localization.lang("Set general fields"), false);
parent = frame;
helpBut = new HelpAction(parent.helpDiag, GUIGlobals.generalFieldsHelp).getIconButton();
helpBut = new HelpAction(HelpFiles.generalFieldsHelp).getHelpButton();
try {
jbInit();
setSize(new Dimension(650, 300));
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/sf/jabref/gui/ImportInspectionDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import javax.swing.table.TableModel;
import javax.swing.undo.AbstractUndoableEdit;

import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand All @@ -76,7 +78,6 @@
import net.sf.jabref.groups.structure.AllEntriesGroup;
import net.sf.jabref.groups.GroupTreeNode;
import net.sf.jabref.groups.UndoableChangeAssignment;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.importer.ImportInspector;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.labelPattern.LabelPatternUtil;
Expand Down Expand Up @@ -305,7 +306,7 @@ public ImportInspectionDialog(JabRefFrame frame, BasePanel panel, String[] field
Localization.lang("Cancel"));
bb.addButton(cancel);
bb.addRelatedGap();
JButton help = new HelpAction(frame.helpDiag, GUIGlobals.importInspectionHelp).getIconButton();
JButton help = new HelpAction(HelpFiles.importInspectionHelp).getHelpButton();
bb.addButton(help);
bb.addGlue();
bb.getPanel().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
Expand Down
25 changes: 11 additions & 14 deletions src/main/java/net/sf/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import net.sf.jabref.groups.GroupSelector;
import net.sf.jabref.gui.actions.*;
import net.sf.jabref.gui.desktop.JabRefDesktop;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.help.HelpDialog;
import net.sf.jabref.gui.journals.ManageJournalsAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.gui.keyboard.KeyBindingRepository;
Expand All @@ -52,6 +52,11 @@
import net.sf.jabref.logic.util.OS;
import net.sf.jabref.logic.util.io.FileUtil;
import net.sf.jabref.model.database.BibDatabase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import net.sf.jabref.gui.help.AboutAction;
import net.sf.jabref.gui.help.AboutDialog;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import net.sf.jabref.model.entry.EntryType;
Expand All @@ -61,8 +66,6 @@
import net.sf.jabref.sql.importer.DbImportAction;
import net.sf.jabref.util.ManageKeywordsAction;
import net.sf.jabref.util.MassSetFieldAction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import osx.macadapter.MacAdapter;

import javax.swing.*;
Expand Down Expand Up @@ -208,7 +211,7 @@ void addJToogleButton(JToggleButton button) {
private final FileHistoryMenu fileHistory = new FileHistoryMenu(prefs, this);

// The help window.
public final HelpDialog helpDiag = new HelpDialog(this);
public final AboutDialog helpDiag = new AboutDialog(this);

// Here we instantiate menu/toolbar actions. Actions regarding
// the currently open database are defined as a GeneralAction
Expand All @@ -231,15 +234,10 @@ void addJToogleButton(JToggleButton button) {
private final AbstractAction newSubDatabaseAction = new NewSubDatabaseAction(this);
private final AbstractAction forkMeOnGitHubAction = new ForkMeOnGitHubAction();
private final AbstractAction donationAction = new DonateAction();
private final AbstractAction help = new HelpAction(Localization.menuTitle("JabRef help"), helpDiag,
GUIGlobals.baseFrameHelp, Localization.lang("JabRef help"),
Globals.getKeyPrefs().getKey(KeyBinding.HELP));
private final AbstractAction contents = new HelpAction(Localization.menuTitle("Help contents"), helpDiag,
GUIGlobals.helpContents, Localization.lang("Help contents"),
IconTheme.JabRefIcon.HELP_CONTENTS.getIcon());
private final AbstractAction about = new HelpAction(Localization.menuTitle("About JabRef"), helpDiag,
GUIGlobals.aboutPage, Localization.lang("About JabRef"),
IconTheme.getImage("about"));
private final AbstractAction help = new HelpAction(Localization.menuTitle("JabRef help"), Localization.lang("JabRef help"),
HelpFiles.helpContents, Globals.getKeyPrefs().getKey(KeyBinding.HELP));
private final AbstractAction about = new AboutAction(Localization.menuTitle("About JabRef"), helpDiag,
Localization.lang("About JabRef"), IconTheme.getImage("about"));
private final AbstractAction editEntry = new GeneralAction(Actions.EDIT, Localization.menuTitle("Edit entry"),
Localization.lang("Edit entry"), Globals.getKeyPrefs().getKey(KeyBinding.EDIT_ENTRY), IconTheme.JabRefIcon.EDIT_ENTRY.getIcon());
private final AbstractAction focusTable = new GeneralAction(Actions.FOCUS_TABLE,
Expand Down Expand Up @@ -1322,7 +1320,6 @@ private void fillMenu() {
mb.add(options);

helpMenu.add(help);
helpMenu.add(contents);
helpMenu.addSeparator();
helpMenu.add(errorConsole);
helpMenu.addSeparator();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/gui/StringDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.sf.jabref.bibtex.comparator.BibtexStringComparator;
import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.gui.undo.UndoableInsertString;
Expand Down Expand Up @@ -60,7 +61,7 @@ public StringDialog(JabRefFrame frame, BasePanel panel, BibDatabase base) {

sortStrings();

helpAction = new HelpAction(frame.helpDiag, GUIGlobals.stringEditorHelp, Localization.lang("Help"));
helpAction = new HelpAction(Localization.lang("Help"), HelpFiles.stringEditorHelp);

addWindowListener(new WindowAdapter() {

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@
import net.sf.jabref.bibtex.EntryTypes;
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.fieldeditors.*;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.gui.menus.ChangeEntryTypeMenu;
import net.sf.jabref.logic.autocompleter.AutoCompleter;
import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.external.WriteXMPEntryEditorAction;
import net.sf.jabref.gui.*;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.importer.fileformat.BibtexParser;
import net.sf.jabref.importer.ParserResult;
import net.sf.jabref.logic.l10n.Localization;
Expand Down Expand Up @@ -172,7 +173,7 @@ public EntryEditor(JabRefFrame frame, BasePanel panel, BibEntry entry) {
this.entry.addPropertyChangeListener(this);
this.entry.addPropertyChangeListener(SpecialFieldUpdateListener.getInstance());

helpAction = new HelpAction(this.frame.helpDiag, GUIGlobals.entryEditorHelp, IconTheme.JabRefIcon.HELP.getIcon());
helpAction = new HelpAction(HelpFiles.entryEditorHelp, IconTheme.JabRefIcon.HELP.getIcon());
closeAction = new CloseAction();
generateKeyAction = new GenerateKeyAction();
storeFieldAction = new StoreFieldAction();
Expand Down
Loading

0 comments on commit 3d7d02f

Please sign in to comment.