-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Migrate Review field in entry preview to comment #4100
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3051c7a
Migrate Review field in entry preview to comment
Siedlerchr d30d65a
Replace review with comment in every layout file
Siedlerchr 0e57b3b
add test and fix small error in replace
Siedlerchr d50bf47
Merge remote-tracking branch 'upstream/master' into fixentrypreviewco…
Siedlerchr fa7074c
simplify test code, create getters and setters
Siedlerchr f9d6fb1
extract Globals.prefs and mainPrefsNode as parameter
Siedlerchr a1a27cf
fix checkstyle
Siedlerchr 91dedb2
Merge branch 'master' into fixentrypreviewcomments
Siedlerchr 7e71094
Merge remote-tracking branch 'upstream/master' into fixentrypreviewco…
Siedlerchr 5a5beb7
simply test using verify
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,15 @@ public class JabRefPreferences implements PreferencesService { | |
// Id Entry Generator Preferences | ||
public static final String ID_ENTRY_GENERATOR = "idEntryGenerator"; | ||
|
||
// Preview | ||
//public because needed for pref migration | ||
public static final String PREVIEW_STYLE = "previewStyle"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can simply add a get/setPreviewStyle method which I would prefer. |
||
|
||
private static final String CYCLE_PREVIEW_POS = "cyclePreviewPos"; | ||
private static final String CYCLE_PREVIEW = "cyclePreview"; | ||
private static final String PREVIEW_PANEL_HEIGHT = "previewPanelHeightFX"; | ||
private static final String PREVIEW_ENABLED = "previewEnabled"; | ||
|
||
// Auto completion | ||
private static final String AUTO_COMPLETE = "autoComplete"; | ||
private static final String AUTOCOMPLETER_FIRSTNAME_MODE = "autoCompFirstNameMode"; | ||
|
@@ -396,13 +405,6 @@ public class JabRefPreferences implements PreferencesService { | |
//GroupViewMode | ||
private static final String GROUP_INTERSECT_UNION_VIEW_MODE = "groupIntersectUnionViewModes"; | ||
|
||
// Preview | ||
private static final String CYCLE_PREVIEW_POS = "cyclePreviewPos"; | ||
private static final String CYCLE_PREVIEW = "cyclePreview"; | ||
private static final String PREVIEW_PANEL_HEIGHT = "previewPanelHeightFX"; | ||
private static final String PREVIEW_STYLE = "previewStyle"; | ||
private static final String PREVIEW_ENABLED = "previewEnabled"; | ||
|
||
// Helper string | ||
private static final String USER_HOME = System.getProperty("user.home"); | ||
// solves the issue java.lang.RuntimeException: Internal graphics not initialized yet | ||
|
@@ -788,7 +790,7 @@ private JabRefPreferences() { | |
+ "\\begin{year}<b>\\year</b>\\end{year}\\begin{volume}<i>, \\volume</i>\\end{volume}" | ||
+ "\\begin{pages}, \\format[FormatPagesForHTML]{\\pages} \\end{pages}__NEWLINE__" | ||
+ "\\begin{abstract}<BR><BR><b>Abstract: </b> \\format[HTMLChars]{\\abstract} \\end{abstract}__NEWLINE__" | ||
+ "\\begin{review}<BR><BR><b>Review: </b> \\format[HTMLChars]{\\review} \\end{review}" | ||
+ "\\begin{comment}<BR><BR><b>Comment: </b> \\format[HTMLChars]{\\comment} \\end{comment}" | ||
+ "</dd>__NEWLINE__<p></p></font>"); | ||
|
||
setLanguageDependentDefaultValues(); | ||
|
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
10 changes: 5 additions & 5 deletions
10
src/main/resources/resource/layout/listrefs/listrefs.layout
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
10 changes: 5 additions & 5 deletions
10
src/main/resources/resource/layout/listrefs/listrefs.misc.layout
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can pass the preferences class as a parameter and then use
mock
in combination withverify
in the tests below (instead of working on the actual preference object).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried around with this but I currently see no way to do this. When I mock the object, calling the migration method on the object will have no effect as it operates directly on the preferences object. I don't like that operating on the real prefs object but
Sure I can mock returns, but that's not the goal of this test.
However, I could remove the dependency on the actual Globals.prefs object by passing a Preferences object as parametre