[WIP] Show PDF-Comments in JabRef#1883
Conversation
# Conflicts: # src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java
| PdfCommentImporter commentImporter = new PdfCommentImporter(); | ||
| HashMap<String, String> importedNotes = commentImporter.importNotes(field.get()); | ||
| for (String note : importedNotes.values()) listModel.addElement(note); | ||
| String pdfPath = field.get().replaceFirst(".*?:", System.getProperty("file.separator")).replaceAll(":PDF", ""); |
There was a problem hiding this comment.
Just a hint, there is a convenience method in FileUtilwhich does the job for you and because the file field could contain more than one file entry.
getListOfLinkedFiles(...) just look at the call hierarchy of that method to see how to use it...
There was a problem hiding this comment.
Thank you for that! Is it a valid use case that more than one pdf file is linked? If so, I would have to take care about parsing multiple files and we need a UI that is capable of representing that.
There was a problem hiding this comment.
I am not sure about that, well at least it is possible to add/have multiple pdf files ;) I think the typical workflow is to attach one pdf and some additional resources (e.g. maybe source code archive or some other data).
There was a problem hiding this comment.
Or have a list of all comments but grouped by the containing pdf file. Probably 90% of the entries have just one linked pdf file and thus the UI should primarily support this.
|
Ok then. I pushed the quick hack with the bridge to awt. |
|
I support @Braunch here and would vote for an exception for
|
|
I would follow the argumentation by @tobiasdiez. As he says names are just hollow words. Add an exception for awt.geom. I took a quick look at the package api doc and it seems like it contains not any logic for drawing, but just proving a model |
| File_annotations= | ||
| Show_file_annotations= | ||
| Adobe_Acrobat_Reader= | ||
| Sumatra_Reader= |
There was a problem hiding this comment.
The name is Sumatra PDF (https://www.sumatrapdfreader.org/free-pdf-reader-de.html) and does not need to be translated, does it? - See asian Sumatra PDF page: https://www.sumatrapdfreader.org/free-pdf-reader-ja.html
|
So we decided in the devcall that we will create an exception for the |
|
Ok I will change that back and add the exception. |
|
I added an |
|
Ok, the test works. In my honest opinion that is a good example that lambdas are hard to understand when they get big. So, could you perhaps just refactor the test a little bit to make it more easily understandable? What I am thinking about is extracting the boolean parts of the lambda into predicates that you define at the start of the method and then just reusing that, i.e.: and then you can call Please add and use this predicate and build at least one more nicely named one for another boolean condition. Then the lambda will be much more readable and I promise that I will be happy :-) P.S.: The localization tests fail, so this needs to be fixed before merging as well. |
|
That is a good idea. The filters are getting unreadable. But I think I have to rewrite the predicate a bit different, because the predicates are the parameters for the filter and the one you wrote is just one condition for the predicate of another filter so a boolean is expected. I put the whole predicate in it (still a big filter but already way better to read) and extract the isPackage predicate from the filter above too. |
|
I just had a look at the |
|
Is this PR ready for review? (I saw a few "TODO" statements in the code, so I suspect it is not yet finished.) |
|
No its not ready. I dint try the open pdf on an other setup than linux/acroread |
|
@Braunch Any news? Any timeline? |
|
The code is moved over to #2545 and this can be closed. |
Extract Comments from linked PDF-Files and show them in JabRef.
See here for related issues:
#662
#139
Features TODO: