Skip to content

Commit

Permalink
Merge branch 'master' into office07
Browse files Browse the repository at this point in the history
* master:
  Fix imports
  Rename NewFileDialog -> FileDialog
  Also cancel duplicate finder workflow on close button
  Removed/moved preferences which are constants
  implements JabRef#1767: Add Help Button to access new help page
  Fixed BibTeXMLImporter
  Set more default file filters in dialogs JabRef#1763
  Resolve crossrefs and strings in main table (JabRef#1644)
  Rewrite bibtexml importer with JAXB parser (JabRef#1666)
  Moved a few more initialization to GUIGlobals.init() (JabRef#1756)
  Added program to generate a table of all characters and fixed some characters (JabRef#1766)
  Improve focus of the maintable after a sidepane gets closed (JabRef#1741)
  Table row height adjusts on Windows as the font scales with the menu (JabRef#1623)
  Added more characters to converters (JabRef#1761)
  • Loading branch information
Siedlerchr committed Aug 18, 2016
2 parents dbb35e5 + 63baf6f commit de1a98e
Show file tree
Hide file tree
Showing 88 changed files with 1,863 additions and 372 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- [#462](https://github.com/JabRef/jabref/issues/462) Extend the OpenConsoleFeature by offering a selection between default terminal emulator and configurable command execution.
- The field name in the layout files for entry type is changed from `bibtextype` to `entrytype`. Please update your existing files as support for `bibtextype` will be removed eventually.
- [#1516](https://github.com/JabRef/jabref/issues/1516) Selected field names are written in uppercase in the entry editor
- Table row height is adjusted on Windows which is useful for high resolution displays
- For developers: Moved the bst package into logic. This requires the regeneration of antlr sources, execute: gradlew generateSource
- [#1026](https://github.com/JabRef/jabref/issues/1026) JabRef does no longer delete user comments outside of BibTeX entries and strings
- [#1249](https://github.com/JabRef/jabref/issues/1249) Date layout formatter added
- Undo/redo are enabled/disabled and show the action in the tool tip
- Added ISBN integrity checker
- Added filter to not show selected integrity checks
- The contents of `crossref` and `related` will be automatically updated if a linked entry changes key
- The information shown in the main table now resolves crossrefs and strings and it can be shown which fields are resolved in this way (Preferences -> Appearance -> Color codes for resolved fields)
- Enhance the entry customization dialog to give better visual feedback
- It is now possible to generate a new BIB database from the citations in an OpenOffice/LibreOffice document
- The arXiv fetcher now also supports free-text search queries
Expand All @@ -38,8 +40,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Add integrity check to avoid non-ASCII characters in BibTeX files
- [#1751](https://github.com/JabRef/jabref/issues/1751) Added tooltip to web search button
- [#1758](https://github.com/JabRef/jabref/issues/1758) Added a button to open Database Properties dialog help


- Improve focus of the maintable after a sidepane gets closed (Before it would focus the toolbar or it would focus the wrong entry)

### Fixed
- Fixed [#1632](https://github.com/JabRef/jabref/issues/1632): User comments (@Comment) with or without brackets are now kept
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: 'checkstyle'

apply from: 'eclipse.gradle'
apply from: 'localization.gradle'
apply from: 'medline.gradle'
apply from: 'xjc.gradle'

group = "net.sf.jabref"
version = "3.6dev"
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/net/sf/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package net.sf.jabref;

import java.awt.Font;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -117,8 +116,6 @@ private void openWindow() {
}

GUIGlobals.init();
GUIGlobals.currentFont = new Font(Globals.prefs.get(JabRefPreferences.FONT_FAMILY),
Globals.prefs.getInt(JabRefPreferences.FONT_STYLE), Globals.prefs.getInt(JabRefPreferences.FONT_SIZE));

LOGGER.debug("Initializing frame");
JabRefGUI.mainFrame = new JabRefFrame();
Expand Down Expand Up @@ -185,11 +182,10 @@ private void openWindow() {
JOptionPane.ERROR_MESSAGE);
}

if (Globals.prefs.getBoolean(JabRefPreferences.DISPLAY_KEY_WARNING_DIALOG_AT_STARTUP)) {
int i = 0;
for (ParserResult pr : bibDatabases) {
ParserResultWarningDialog.showParserResultWarningDialog(pr, JabRefGUI.getMainFrame(), i++);
}
// Display warnings, if any
int tabNumber = 0;
for (ParserResult pr : bibDatabases) {
ParserResultWarningDialog.showParserResultWarningDialog(pr, JabRefGUI.getMainFrame(), tabNumber++);
}

// After adding the databases, go through each and see if
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/net/sf/jabref/cli/GenerateCharacterTable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package net.sf.jabref.cli;

import java.util.Map;
import java.util.TreeMap;

import net.sf.jabref.logic.util.strings.HTMLUnicodeConversionMaps;

public class GenerateCharacterTable {

public static void main(String[] args) {
Map<Integer, String> characterMap = new TreeMap<>(HTMLUnicodeConversionMaps.NUMERICAL_LATEX_CONVERSION_MAP);
System.out.println("\\documentclass[10pt, a4paper]{article}");
System.out.println("\\usepackage[T5,T1]{fontenc}");
System.out.println("\\usepackage{amssymb}");
System.out.println("\\usepackage{amsmath}");
System.out.println("\\usepackage{txfonts}");
System.out.println("\\usepackage{xfrac}");
System.out.println("\\usepackage{combelow}");
System.out.println("\\usepackage{textcomp}");
System.out.println("\\usepackage{mathspec}");
System.out.println("\\usepackage{fontspec}");
System.out.println("\\usepackage[a4paper,margin=1cm]{geometry}");
System.out.println("\\usepackage{supertabular}");
System.out.println("\\usepackage{mathabx}");
System.out.println("\\fontspec{Cambria}");
System.out.println("\\DeclareTextSymbolDefault{\\OHORN}{T5}");
System.out.println("\\DeclareTextSymbolDefault{\\UHORN}{T5}");
System.out.println("\\DeclareTextSymbolDefault{\\ohorn}{T5}");
System.out.println("\\DeclareTextSymbolDefault{\\uhorn}{T5}");
System.out.println("\\begin{document}");
System.out.println("\\twocolumn");
System.out.println("\\begin{supertabular}{c|c|c|c|c}");
System.out.println("No. & Uni & Symb & \\LaTeX & Code \\\\ \n \\hline");

for (Map.Entry<Integer, String> character : characterMap.entrySet()) {
System.out
.println(
character.getKey() + " & "
+ ((character.getKey() > 128) ? String
.valueOf(Character.toChars(character.getKey())) : "")
+ " & \\symbol{" + Integer.toString(character.getKey()) + "} & "
+ character.getValue() + " & \\verb¤" + character.getValue() + \\\\");
}
System.out.println("\\end{supertabular}");
System.out.println("\\end{document}");

}

}
3 changes: 3 additions & 0 deletions src/main/java/net/sf/jabref/collab/ChangeDisplayDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import net.sf.jabref.gui.BasePanel;
import net.sf.jabref.gui.undo.NamedCompound;
import net.sf.jabref.gui.util.GUIUtil;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.database.BibDatabase;

Expand Down Expand Up @@ -64,6 +65,8 @@ public ChangeDisplayDialog(JFrame owner, final BasePanel panel,
}
tree = new JTree(root);
tree.addTreeSelectionListener(this);
GUIUtil.correctRowHeight(tree);

JSplitPane pane = new JSplitPane();
pane.setLeftComponent(new JScrollPane(tree));
JPanel infoBorder = new JPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.gui.actions.MnemonicAwareAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.gui.util.GUIUtil;
import net.sf.jabref.logic.l10n.Localization;

import com.jgoodies.forms.builder.ButtonBarBuilder;
Expand Down Expand Up @@ -181,6 +182,8 @@ public void actionPerformed(ActionEvent e) {
table.getColumnModel().getColumn(3).setMinWidth(100);
table.getColumnModel().getColumn(0).setResizable(false);

GUIUtil.correctRowHeight(table);

JScrollPane sp = new JScrollPane(table);

JPanel upper = new JPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import javax.swing.event.DocumentListener;

import net.sf.jabref.Globals;
import net.sf.jabref.gui.FileDialog;
import net.sf.jabref.gui.IconTheme;
import net.sf.jabref.gui.NewFileDialog;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.util.OS;
import net.sf.jabref.preferences.JabRefPreferences;
Expand Down Expand Up @@ -73,7 +73,7 @@ public class ExternalFileTypeEntryEditor {
appDir = Globals.prefs.get(JabRefPreferences.FILE_WORKING_DIRECTORY);
}

Optional<Path> path = new NewFileDialog(fParent, appDir).openDialogAndGetSelectedFile();
Optional<Path> path = new FileDialog(fParent, appDir).openDialogAndGetSelectedFile();
path.ifPresent(applicationDir -> {
if (applicationDir.getParent() != null) {
Globals.prefs.put(JabRefPreferences.FILE_WORKING_DIRECTORY, applicationDir.getParent().toString());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/external/MoveFileAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import javax.swing.JOptionPane;

import net.sf.jabref.Globals;
import net.sf.jabref.gui.FileDialog;
import net.sf.jabref.gui.FileListEntry;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.gui.NewFileDialog;
import net.sf.jabref.gui.entryeditor.EntryEditor;
import net.sf.jabref.gui.fieldeditors.FileListEditor;
import net.sf.jabref.gui.util.component.CheckBoxMessage;
Expand Down Expand Up @@ -142,7 +142,7 @@ public void actionPerformed(ActionEvent event) {
}
chosenFile = sb.toString();
} else {
Optional<Path> path = new NewFileDialog(frame, file.getPath()).saveNewFile();
Optional<Path> path = new FileDialog(frame, file.getPath()).saveNewFile();
if (path.isPresent()) {
chosenFile = path.get().toString();
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,7 @@ private BibEntry getShowing() {
* @param entry The entry that is now to be shown.
*/
public void newEntryShowing(BibEntry entry) {

// If this call is the result of a Back or Forward operation, we must take
// care not to make any history changes, since the necessary changes will
// already have been done in the back() or forward() method:
Expand All @@ -2253,7 +2254,7 @@ public void newEntryShowing(BibEntry entry) {
// Add the entry we are leaving to the history:
if (showing != null) {
previousEntries.add(showing);
if (previousEntries.size() > Globals.prefs.getInt(JabRefPreferences.MAX_BACK_HISTORY_SIZE)) {
if (previousEntries.size() > GUIGlobals.MAX_BACK_HISTORY_SIZE) {
previousEntries.remove(0);
}
}
Expand Down Expand Up @@ -2307,14 +2308,15 @@ private class SaveSelectedAction implements BaseAction {

private final SavePreferences.DatabaseSaveType saveType;


public SaveSelectedAction(SavePreferences.DatabaseSaveType saveType) {
this.saveType = saveType;
}

@Override
public void action() throws SaveException {
Optional<Path> chosenFile = new NewFileDialog(frame).withExtension(FileExtensions.BIBTEX_DB).saveNewFile();
FileDialog dialog = new FileDialog(frame).withExtension(FileExtensions.BIBTEX_DB);
dialog.setDefaultExtension(FileExtensions.BIBTEX_DB);
Optional<Path> chosenFile = dialog.saveNewFile();

if (chosenFile.isPresent()) {
Path path = chosenFile.get();
Expand All @@ -2326,11 +2328,9 @@ public void action() throws SaveException {
}

private static class SearchAndOpenFile {

private final BibEntry entry;
private final BasePanel basePanel;


public SearchAndOpenFile(final BibEntry entry, final BasePanel basePanel) {
this.entry = entry;
this.basePanel = basePanel;
Expand Down
23 changes: 15 additions & 8 deletions src/main/java/net/sf/jabref/gui/DuplicateResolverDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@
package net.sf.jabref.gui;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;

import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.importer.ImportInspectionDialog;
import net.sf.jabref.gui.mergeentries.MergeEntries;
import net.sf.jabref.gui.util.PositionWindow;
import net.sf.jabref.logic.help.HelpFile;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.preferences.JabRefPreferences;

// created by : ?
//
// modified : r.nagel 2.09.2004
// - insert close button

public class DuplicateResolverDialog extends JDialog {

public enum DuplicateResolverType {
Expand All @@ -55,6 +54,7 @@ public enum DuplicateResolverResult {

private final JButton cancel = new JButton(Localization.lang("Cancel"));
private final JButton merge = new JButton(Localization.lang("Keep merged entry only"));
JButton helpButton = new HelpAction(Localization.lang("Help"), HelpFile.FIND_DUPLICATES).getHelpButton();
private final JabRefFrame frame;
private final JPanel options = new JPanel();
private DuplicateResolverResult status = DuplicateResolverResult.NOT_CHOSEN;
Expand Down Expand Up @@ -117,6 +117,7 @@ private void init(BibEntry one, BibEntry two, DuplicateResolverType type) {
options.add(merge);
options.add(Box.createHorizontalStrut(5));
options.add(cancel);
options.add(helpButton);

first.addActionListener(e -> buttonPressed(DuplicateResolverResult.KEEP_LEFT));
second.addActionListener(e -> buttonPressed(DuplicateResolverResult.KEEP_RIGHT));
Expand All @@ -125,7 +126,14 @@ private void init(BibEntry one, BibEntry two, DuplicateResolverType type) {
if (removeExact != null) {
removeExact.addActionListener(e -> buttonPressed(DuplicateResolverResult.AUTOREMOVE_EXACT));
}

cancel.addActionListener(e -> buttonPressed(DuplicateResolverResult.BREAK));
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
buttonPressed(DuplicateResolverResult.BREAK);
}
});

getContentPane().add(me.getMergeEntryPanel());
getContentPane().add(options, BorderLayout.SOUTH);
Expand All @@ -137,12 +145,11 @@ private void init(BibEntry one, BibEntry two, DuplicateResolverType type) {
pw.setWindowPosition();

both.requestFocus();

}


private void buttonPressed(DuplicateResolverResult button) {
status = button;
private void buttonPressed(DuplicateResolverResult result) {
status = result;
dispose();
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/sf/jabref/gui/DuplicateSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ static class DuplicateCallBack implements CallBack {


public DuplicateCallBack(JabRefFrame frame, BibEntry one, BibEntry two, DuplicateResolverType dialogType) {

this.frame = frame;
this.one = one;
this.two = two;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import net.sf.jabref.logic.util.FileExtensions;
import net.sf.jabref.preferences.JabRefPreferences;

public class NewFileDialog {
public class FileDialog {
/**
* Custom confirmation dialog
* http://stackoverflow.com/a/3729157
Expand Down Expand Up @@ -64,7 +64,7 @@ public void approveSelection() {
* Creates a new filedialog showing the current working dir {@link JabRefPreferences#WORKING_DIRECTORY}
* @param parent The parent frame associated with this dialog
*/
public NewFileDialog(JFrame parent) {
public FileDialog(JFrame parent) {
this(parent, getWorkingDir());
}

Expand All @@ -73,7 +73,7 @@ public NewFileDialog(JFrame parent) {
* @param parent The parent frame associated with this dialog
* @param dir The starting directory to show in the dialog
*/
public NewFileDialog(JFrame parent, String dir) {
public FileDialog(JFrame parent, String dir) {
Objects.requireNonNull(dir, "Directory must not be null");

this.parent = parent;
Expand All @@ -83,29 +83,29 @@ public NewFileDialog(JFrame parent, String dir) {

/**
* Show only directories instead of files and folders
* @return NewFileDialog
* @return FileDialog
*/
public NewFileDialog dirsOnly() {
public FileDialog dirsOnly() {
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
return this;
}

/**
* Add a single extension as file filter
* @param singleExt The extension
* @return NewFileDialog
* @return FileDialog
*/
public NewFileDialog withExtension(FileExtensions singleExt) {
public FileDialog withExtension(FileExtensions singleExt) {
withExtensions(EnumSet.of(singleExt));
return this;
}

/**
* Add a multiple extensions as file filter
* @param fileExtensions The extensions
* @return NewFileDialog
* @return FileDialog
*/
public NewFileDialog withExtensions(Collection<FileExtensions> fileExtensions) {
public FileDialog withExtensions(Collection<FileExtensions> fileExtensions) {
this.extensions = fileExtensions;

for (FileExtensions ext : fileExtensions) {
Expand All @@ -132,9 +132,9 @@ public void setDefaultExtension(FileExtensions extension) {

/**
* Updates the working directory preference
* @return NewFileDialog
* @return FileDialog
*/
public NewFileDialog updateWorkingDirPref() {
public FileDialog updateWorkingDirPref() {
Globals.prefs.put(JabRefPreferences.WORKING_DIRECTORY, this.directory);
return this;
}
Expand Down
Loading

0 comments on commit de1a98e

Please sign in to comment.