-
-
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
[WIP] Conversion of Preferences/preview to mvvm #5062
Conversation
First of all thanks for your efforts. Default button should reset the html code you entered or modified to the default hard codes one. |
Furthermore the position of the current selected preview Style is stored in n the prefs. This info is used for the preview cycle function. Complex stuff 😈 |
|
||
/** | ||
* This was originally created by Carlos Martins (github: @cemarins ) | ||
* Can this be used here? (BSD-2clause License) |
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.
Yep. BSD2-clause aka FreeBSD is compatible
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.
So I can cut the comment? Where do I give credit to him?
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 would suggest extending the javadoc comment, e.g. author copyright, and link to the code
Not sure if you need the whole Disclaimer or licence text.
https://opensource.org/licenses/BSD-2-Clause
That should be enough. We already link to the library in our external-libraries.txt file
@koppor knows more about this licence stuff
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.
src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java
Outdated
Show resolved
Hide resolved
That tab is indeed very confusing. A few suggestions (depending on how much time you want to invest):
|
Drag and drop reorder is implemented in the general tab for moving files up and down as far as I remember |
Thanks for the comments, i will look into it and resurface the next days again. |
I got the code-editor and the Preview now in the layout, as @tobiasdiez suggested, but there are still many issues. E.g. there is something wrong with the PreviewViewer: I can change the source for the default 'Preview', but it wont use the changed source in the PreviewViewer until I completly reload the class, even in the MainTable-Preview-View. Also the defaul-button now does not work at all, I think these two issues are connected. Next I'm going to look into the drag'n'drop-stuff. Just wanted you to know, I am still on it. But I got little time these days to work on it. |
It should work if you call PreviewViewer.setLayout with the updated layout. |
Thanks, that did the trick on the PreviewPane in the Preferences. Code is somehow ugly with typecasting all around, but i did not had a better quick solution.
|
If you adapt the html preview, it's stored in prefs. And under the hood the preview works similar or is similar to the custom html export styles |
Multiple selection is normally handled via the selection model property. Must be explicitly set |
Just to remind of this PR, it would be great to have some feedback on the two issues mentioned above: the displaced icons in the ContextMenu and the internal size of the webpane. the size of the webpane is not that big thing, if there is no solution, the user just has to scroll a little bit more to the right. Not perfect, but ... meh... |
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.
lgtm!
About the icons and the web pane, no idea. I would vote to merge this PR now as is and then create an issue/addtional PR to see if we can fix the icon stuff and the webview
Could you please add a screensehot on the misplaced menu items? |
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.
The code looks good to me. Nice job!
I don't really have an idea of how to fix the two display issues. The dropdown derives some css properties from the original control, which sometimes leads to surprises. But I couldn't identify what css property could result in the display error for the icons. You can use Scenic View to debug for a bit, but I wouldn't spend too much time into it. From my side, we can merge also the current version.
Ok, I tried to debug the css-issues a little bit, but I could not figure it out, so i removed the icons. Of course, this is not a solution for the problem, but nobody will ever notice. ;-) |
Could not resist refactoring a little bit more... 😅 |
I am merging then ;) |
So this was fun again, at least in the beginning and in the end. In the middle it really hurt. Feel free to work on the other tabs. I think, before we start reordering everything, we should convert everything first to mvvm, because otherwise it will become a bit confusing, what is already moved to another prefTab etc. |
Thanks for your great work and your interest! Regarding your thesis, I think you are not alone. You can ask other JabRef devs about how working on JabRef provides a nice distraction from finishing a thesis.... 😈 |
@calixtus We hope you finished your thesis. Feel free to rejoin for #hacktoberfest. |
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (#5052) c74218d Update iso690-full-note-cs.csl (#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (#5050) a0c044d Reindent/reorder (#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
5297abd Delete wirtschaftsuniversitat-wien-interdisziplinares-institut-fur-verhaltenswissenschaftlich-orientiertes-management.csl (JabRef#5023) 4b95fd1 New style - german-yearbook-of-international-law.csl (JabRef#5052) c74218d Update iso690-full-note-cs.csl (JabRef#5062) e72fb75 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#5058) a440a12 Ann. Rev. Astron.: Remove form="short" for URL 325772c Create european-journal-of-theology.csl (JabRef#5055) 7643924 Update society-of-biblical-literature-fullnote-bibliography.csl (JabRef#5022) 15e8a12 Update RCN-Harvard based on feedback b9a37b7 Update harvard-university-of-westminster.csl (JabRef#5044) 7826be2 New version of the style for the History Department at the University of Lausanne (JabRef#5050) a0c044d Reindent/reorder (JabRef#5054) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: 5297abd
follow-up to #5033
This is my first shot on the PreviewTab in the Preferences and it has been a real nightmare. What started as an i-thought-so-easy-sunday-morning-project became a horrorstory of listViews, impossible bindings and codeAreas. codeArea? Yes. Syntax-highlighting is real fancy. But there are questions left.
Can I use the syntax-highlighting-stuff of RichTextFX, or to be more precise: The sample, the creators of RichTextFX credited (see the method computeHighlighting )
What does PreviewCycle do, what should it do?
What should the default-button do?
The store-logic somehow copied from the original PreviewTab