-
-
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
Citation Relations should be aware of existing papers #10414
Comments
Is this project is ongoing? Let me know further (DOCS) to contribute on it as "good first issue". |
Yes, this project (JabRef) is still ongoing and this issue is free to take. I will assign you. |
As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at. Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback. |
@vimalJD are you still on it or have you given up on this? |
You will have to add a styleclass to the entry that matches. This can be done by configuring the ViewModelTableCellFactory or ViewModelListCellFactory. The css can be added to base.css |
In the citations relations tab this would be somewhere here: jabref/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java Line 194 in 14d9502
|
So, after digging through the code for a while pressing the button (marked as 4 in @koppor 's image in the original post) calls the importEntries method of the ImportHandler class. However, the logic that we want (that checks for duplicates) is in the importEntries method of the ImportEntriesViewModel class. I am wondering what the best way to approach this is. Creating a new instance of the ImportEntriesViewModel just to access that method does not seem like a good choice. Should I try to move some of that logic to the ImportHandler class, maybe with a new method? |
@supernoob00 Hi, are you still working on the issue? |
Assigned @supernoob00 because of first come, first serve. But yes, if an issue has not been worked on for more than 4 weeks or some months and the assigned person is not responding then you may ask to work on it. Our policy is to usually only assign one student per issue or one group of students from the same course to avoid trouble with grading down the road. |
@supernoob00 Difficult question. Doesn't the dialog know the bibdatabasecontext and thus the entries? There is a duplicate checker. And that also is in use in the import dialog. And can say if an entry exists. We recently worked on that at #10914... But you are at a different place in the code. No import, but citation relations. But maybe you get inspirations. Maybe @HoussemNasri can also give hints? |
Hi @supernoob00, thanks for digging into this,
I totally agree that using view models wouldn't be a great idea here. Usually, each UI component has its own view model, but it's possible to use the same one for components that have the same state. Take Android apps, for example. They can run on all sorts of devices, from phones to TVs to watches. You might tweak the design of the UI pages to fit different screen sizes, but you can still keep the state consistent. In our case, we would be sharing the view model to not share the state but to share a single method which is not ideal.
Have you looked into |
From what I see in the code, there might already be something to try to handle this better, in if (entry.isLocal()) {
Button jumpTo = IconTheme.JabRefIcons.LINK.asButton();
jumpTo.setTooltip(new Tooltip(Localization.lang("Jump to entry in library")));
jumpTo.getStyleClass().add("addEntryButton");
jumpTo.setOnMouseClicked(event -> {
libraryTab.showAndEdit(entry.entry());
libraryTab.clearAndSelect(entry.entry());
citingTask.cancel();
citedByTask.cancel();
});
hContainer.getChildren().addAll(entryNode, separator, jumpTo);
} The problem is, currently in private void onSearchForRelationsSucceed(BibEntry entry, CheckListView<CitationRelationItem> listView,
Button abortButton, Button refreshButton,
CitationFetcher.SearchType searchType, Button importButton,
ProgressIndicator progress, List<BibEntry> fetchedList,
ObservableList<CitationRelationItem> observableList) {
hideNodes(abortButton, progress);
observableList.setAll(fetchedList.stream().map(entr -> new CitationRelationItem(entr, false))
.collect(Collectors.toList())); where the new |
Hi @supernoob00, are you still working on this? |
@HoussemNasri can I work on this? |
Sure! |
Open
jabref-authors.bib
.Click on paper 1.
This references paper 2 at position 3. The paper at 3 should be marked in light green (to indicate that it already exists). Additionally, at button 4, the duplicate check should be called (which then warns about possible duplicates).
In the example, I added the paper resulting in paper marked at 5.
The text was updated successfully, but these errors were encountered: