diff --git a/src/main/java/net/sf/jabref/external/ExternalFileTypeEditor.java b/src/main/java/net/sf/jabref/external/ExternalFileTypeEditor.java
index 374b1778bca8..8f2ca3deff2a 100644
--- a/src/main/java/net/sf/jabref/external/ExternalFileTypeEditor.java
+++ b/src/main/java/net/sf/jabref/external/ExternalFileTypeEditor.java
@@ -21,6 +21,7 @@
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -58,6 +59,7 @@
* Editor for external file types.
*/
public class ExternalFileTypeEditor extends JDialog {
+
private JFrame frame;
private JDialog dialog;
private List fileTypes;
@@ -111,6 +113,7 @@ private void init() {
dispose();
});
Action cancelAction = new AbstractAction() {
+
@Override
public void actionPerformed(ActionEvent e) {
dispose();
@@ -134,9 +137,10 @@ public void actionPerformed(ActionEvent e) {
//}
});
- add.addActionListener(e -> {
+ add.addActionListener(e -> {
// Generate a new file type:
- ExternalFileType type = new ExternalFileType("", "", "", "", "new", IconTheme.JabRefIcon.FILE.getSmallIcon());
+ ExternalFileType type = new ExternalFileType("", "", "", "", "new",
+ IconTheme.JabRefIcon.FILE.getSmallIcon());
// Show the file type editor:
getEditor(type).setVisible(true);
if (entryEditor.okPressed()) {
@@ -246,6 +250,7 @@ public static AbstractAction getAction(JDialog dialog) {
return new EditExternalFileTypesAction(dialog);
}
+
class EditListener implements ActionListener {
@Override
@@ -276,6 +281,7 @@ public Component getTableCellRendererComponent(JTable tab, Object value, boolean
}
private class FileTypeTableModel extends AbstractTableModel {
+
@Override
public int getColumnCount() {
return 5;
@@ -354,6 +360,7 @@ public void mouseReleased(MouseEvent e) {
}
public static class EditExternalFileTypesAction extends MnemonicAwareAction {
+
private JabRefFrame frame;
private JDialog dialog;
private ExternalFileTypeEditor editor;
diff --git a/src/main/java/net/sf/jabref/gui/FileExtensions.java b/src/main/java/net/sf/jabref/gui/FileExtensions.java
index 3b69b5fbff7b..923d3478d772 100644
--- a/src/main/java/net/sf/jabref/gui/FileExtensions.java
+++ b/src/main/java/net/sf/jabref/gui/FileExtensions.java
@@ -5,12 +5,16 @@ public enum FileExtensions {
//importatn: No dot before the extension
BIBTEX_DB(
"BibTeX Database", "bib"),
+ AUX(
+ "Aux file", "aux"),
SILVER_PLATTERN(
"SilverPlatter", "dat"),
JSTYLE(
"Style File", "jstyle"),
LAYOUT(
- "Custom Layout File", "layout");
+ "Custom Layout File", "layout"),
+ XML(
+ "XML File", "xml");
private final String[] extension;
private final String description;
@@ -32,6 +36,6 @@ public String getDescription() {
}
public String getFirstExtensionWithDot() {
- return "." + extension[0];
+ return "." + extension[0].trim();
}
}
diff --git a/src/main/java/net/sf/jabref/gui/actions/BrowseAction.java b/src/main/java/net/sf/jabref/gui/actions/BrowseAction.java
index 81105c966fa7..6d3267db7237 100644
--- a/src/main/java/net/sf/jabref/gui/actions/BrowseAction.java
+++ b/src/main/java/net/sf/jabref/gui/actions/BrowseAction.java
@@ -18,6 +18,7 @@
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.Collections;
+import java.util.EnumSet;
import java.util.Set;
import javax.swing.AbstractAction;
@@ -48,18 +49,24 @@ public static BrowseAction buildForDir(JTextField tc) {
}
public static BrowseAction buildForFile(JTextField tc) {
+
return new BrowseAction(null, tc, false, Collections.emptySet());
}
+ public static BrowseAction buildForFile(JTextField tc, FileExtensions extensions) {
- public static BrowseAction buildForFile(JTextField tc, Set extension) {
- return new BrowseAction(null, tc, false, extension);
+ return new BrowseAction(null, tc, false, EnumSet.of(extensions));
}
+ public static BrowseAction buildForFile(JTextField tc, Set extensions) {
+ return new BrowseAction(null, tc, false, extensions);
+ }
+ /* public static BrowseAction buildForFile(JTextField tc, extension...) {
+ return new BrowseAction(null, tc, false, extension);
+ }*/
- private BrowseAction(JFrame frame, JTextField tc, boolean dirsOnly,
- Set extensions) {
+ private BrowseAction(JFrame frame, JTextField tc, boolean dirsOnly, Set extensions) {
super(Localization.lang("Browse"));
this.frame = frame;
this.dirsOnly = dirsOnly;
diff --git a/src/main/java/net/sf/jabref/gui/auximport/FromAuxDialog.java b/src/main/java/net/sf/jabref/gui/auximport/FromAuxDialog.java
index 809fbbf4c3ba..a00264be8bed 100644
--- a/src/main/java/net/sf/jabref/gui/auximport/FromAuxDialog.java
+++ b/src/main/java/net/sf/jabref/gui/auximport/FromAuxDialog.java
@@ -38,8 +38,6 @@
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
-import java.io.File;
-import java.util.Collections;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
@@ -49,7 +47,6 @@
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDialog;
-import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
@@ -60,8 +57,9 @@
import net.sf.jabref.Globals;
import net.sf.jabref.gui.BasePanel;
-import net.sf.jabref.gui.FileDialogs;
+import net.sf.jabref.gui.FileExtensions;
import net.sf.jabref.gui.JabRefFrame;
+import net.sf.jabref.gui.actions.BrowseAction;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.logic.auxparser.AuxParser;
import net.sf.jabref.logic.auxparser.AuxParserResult;
@@ -73,6 +71,7 @@
import com.jgoodies.forms.layout.FormLayout;
public class FromAuxDialog extends JDialog {
+
private final JPanel statusPanel = new JPanel();
private final JPanel buttons = new JPanel();
private final JButton generateButton = new JButton();
@@ -95,8 +94,7 @@ public class FromAuxDialog extends JDialog {
private final JabRefFrame parentFrame;
- public FromAuxDialog(JabRefFrame frame, String title, boolean modal,
- JTabbedPane viewedDBs) {
+ public FromAuxDialog(JabRefFrame frame, String title, boolean modal, JTabbedPane viewedDBs) {
super(frame, title, modal);
parentTabbedPane = viewedDBs;
@@ -141,9 +139,11 @@ private void jbInit() {
this.setTitle(Localization.lang("AUX file import"));
JLabel desc = new JLabel("" + Localization.lang("AUX file import") + "
"
+ Localization.lang("This feature generates a new database based on which entries "
- + "are needed in an existing LaTeX document.") + "
"
- + "" + Localization.lang("You need to select one of your open databases from which to choose "
- + "entries, as well as the AUX file produced by LaTeX when compiling your document.") + "
");
+ + "are needed in an existing LaTeX document.")
+ + "
" + ""
+ + Localization.lang("You need to select one of your open databases from which to choose "
+ + "entries, as well as the AUX file produced by LaTeX when compiling your document.")
+ + "