forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added LayoutFormatterPreferences (and related files) (JabRef#1608)
* Added LayoutFormatterPreferences (and related files) * Rebased * Included JournalAbbreviationLoader in LayoutPreferences
- Loading branch information
Showing
21 changed files
with
308 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/net/sf/jabref/logic/layout/LayoutFormatterPreferences.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package net.sf.jabref.logic.layout; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import net.sf.jabref.logic.journals.JournalAbbreviationLoader; | ||
import net.sf.jabref.logic.journals.JournalAbbreviationPreferences; | ||
import net.sf.jabref.logic.layout.format.FileLinkPreferences; | ||
import net.sf.jabref.logic.layout.format.NameFormatterPreferences; | ||
import net.sf.jabref.preferences.JabRefPreferences; | ||
|
||
public class LayoutFormatterPreferences { | ||
|
||
private final NameFormatterPreferences nameFormatterPreferences; | ||
private final JournalAbbreviationPreferences journalAbbreviationPreferences; | ||
private final FileLinkPreferences fileLinkPreferences; | ||
private final Map<String, String> customExportNameFormatters; | ||
private final JournalAbbreviationLoader journalAbbreviationLoader; | ||
|
||
public LayoutFormatterPreferences(NameFormatterPreferences nameFormatterPreferences, | ||
JournalAbbreviationPreferences journalAbbreviationPreferences, FileLinkPreferences fileLinkPreferences, | ||
Map<String, String> customExportNameFormatters, JournalAbbreviationLoader journalAbbreviationLoader) { | ||
this.nameFormatterPreferences = nameFormatterPreferences; | ||
this.journalAbbreviationPreferences = journalAbbreviationPreferences; | ||
this.customExportNameFormatters = customExportNameFormatters; | ||
this.fileLinkPreferences = fileLinkPreferences; | ||
this.journalAbbreviationLoader = journalAbbreviationLoader; | ||
} | ||
|
||
public static LayoutFormatterPreferences fromPreferences(JabRefPreferences jabRefPreferences, | ||
JournalAbbreviationLoader journalAbbreviationLoader) { | ||
Objects.requireNonNull(jabRefPreferences); | ||
Objects.requireNonNull(journalAbbreviationLoader); | ||
return new LayoutFormatterPreferences(NameFormatterPreferences.fromPreferences(jabRefPreferences), | ||
JournalAbbreviationPreferences.fromPreferences(jabRefPreferences), | ||
FileLinkPreferences.fromPreferences(jabRefPreferences), | ||
jabRefPreferences.customExportNameFormatters, journalAbbreviationLoader); | ||
} | ||
|
||
public NameFormatterPreferences getNameFormatterPreferences() { | ||
return nameFormatterPreferences; | ||
} | ||
|
||
public JournalAbbreviationPreferences getJournalAbbreviationPreferences() { | ||
return journalAbbreviationPreferences; | ||
} | ||
|
||
public Map<String, String> getCustomExportNameFormatters() { | ||
return customExportNameFormatters; | ||
} | ||
|
||
public FileLinkPreferences getFileLinkPreferences() { | ||
return fileLinkPreferences; | ||
} | ||
|
||
public JournalAbbreviationLoader getJournalAbbreviationLoader() { | ||
return journalAbbreviationLoader; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.