Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug 950 #21

Merged
merged 2 commits into from
Oct 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[master]
- Fix for bug 950: NullPointerException on "Manage custom imports"
- Feature 850: Keyboard shortcut for 'Cleanup entries' (by eduardogreco)
- Change default behaviour to be more non-invasive: timestamps and owners are NOT set by default per entry.
- "Open Folder" works again
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/net/sf/jabref/imports/CustomImportList.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

Further information about the GNU GPL is available at:
http://www.gnu.org/copyleft/gpl.ja.html
Copyright (C) 2005-2014 JabRef contributors.

*/
package net.sf.jabref.imports;

Expand Down Expand Up @@ -93,13 +95,15 @@ public void setClassName(String className) {
public void setBasePath(String basePath) {
this.basePath = basePath;
}

public File getBasePath() {
public String getBasePath() {
return basePath;
}
public File getFileFromBasePath() {
return new File(basePath);
}

public URL getBasePathUrl() throws MalformedURLException {
return getBasePath().toURI().toURL();
return getFileFromBasePath().toURI().toURL();
}

public String[] getAsStringArray() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

Further information about the GNU GPL is available at:
http://www.gnu.org/copyleft/gpl.ja.html

Copyright (C) 2005-2014 JabRef contributors.
*/
package net.sf.jabref.imports;

Expand Down Expand Up @@ -113,14 +113,16 @@ public ImportCustomizationDialog(JabRefFrame frame_) throws HeadlessException {
JButton addFromFolderButton = new JButton(Globals.lang("Add from folder"));
addFromFolderButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String chosenFileStr = null;
CustomImportList.Importer importer = prefs.customImports.new Importer();
importer.setBasePath(FileDialogs.getNewDir(frame, new File(prefs.get("workingDirectory")), "",
Globals.lang("Select Classpath of New Importer"), JFileChooser.CUSTOM_DIALOG, false));
String chosenFileStr = FileDialogs.getNewFile(frame, importer.getBasePath(), ".class",
if(importer.getBasePath()!=null)
chosenFileStr = FileDialogs.getNewFile(frame, importer.getFileFromBasePath(), ".class",
Globals.lang("Select new ImportFormat Subclass"), JFileChooser.CUSTOM_DIALOG, false);
if (chosenFileStr != null) {
try {
importer.setClassName(pathToClass(importer.getBasePath(), new File(chosenFileStr)));
importer.setClassName(pathToClass(importer.getFileFromBasePath(), new File(chosenFileStr)));
importer.setName(importer.getInstance().getFormatName());
importer.setCliId(importer.getInstance().getCLIId());
addOrReplaceImporter(importer);
Expand Down Expand Up @@ -286,7 +288,7 @@ public Object getValueAt(int rowIndex, int columnIndex) {
} else if (columnIndex == 2) {
value = importer.getClassName();
} else if (columnIndex == 3) {
value = importer.getBasePath();
value = importer.getFileFromBasePath();
}
return value;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/help/About.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ <h2>Contributions from:</h2>
Seb Wills,
John Zedlewski,
Waluyo Adi Siswanto,
Eduardo Roberto Greco</p>
Eduardo Roberto Greco,
Thiago Gomes Toledo</p>

<h2>Thanks to:</h2>

Expand Down