Jump to entry from cli#10578
Conversation
|
Hi, thanks for your Pull Request. |
|
What I immediately imagine would be a List of sth like |
|
@calixtus Thank you for the feedback! I assume UiCommand is some interface that I would create, however I am not sure exactly what would be included in this interface. Unless you are referring to https://docs.oracle.com/javaee/7/api/javax/faces/component/UICommand.html. I also not familiar with Java pattern matching so I am not sure where to apply pattern matching to this problem. Considering my current approach does not easily allow me to check for the argument citation key in recently opened databases, I was thinking of adding a String field to JabRefFrame storing the key which gets passed from the Launcher class. Then during the openDatabase() method I could check all databases for the key and open the respective library and entry. Would this approach be too simplistic or even applicable given it woud require changing multiple Constructors and class fields to pass this string to the JabRef. |
|
I made UiCommand up when i was commenting, I did not know there is already a idk class the same name. Give me some days, I will try to support you with this, although I'm a bit of a very tight schedule the next days. |
|
@calixtus Thank ou again. If my changes are useful I could submit a PR and someone else could pick this up where I left off. Otherwise I can also continue working on this in the coming weeks, however I also am very busy the next few weeks. |
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Test setting: @Article{test,
}
@Article{lala,
}
@Article{coverpage,
title = {YEAH},
}
@Comment{jabref-meta: databaseType:bibtex;}gradle run configuration |
|
The functionality is WRONG. I have OPENED LIBRARIES. The jump-to-entry should search in the OPENED LIBRARIES! It is OK if additionally one can jump to an entry of a library which is given by the command line. However, the idea is just to call |
|
jumpToKey should only use the String citation key. No parser result needed |
…try-cli # Conflicts: # src/main/java/org/jabref/gui/MainApplication.java
…try-cli # Conflicts: # src/main/java/org/jabref/gui/JabRefFrame.java # src/main/java/org/jabref/gui/JabRefGUI.java # src/main/java/org/jabref/gui/LibraryTab.java # src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java
|
Played a little bit around with bindings: BooleanBinding loadingBinding = Bindings.createBooleanBinding(
() -> loadings.stream().anyMatch(ObservableBooleanValue::get),
loadings.toArray(Observable[]::new)
);
EasyBind.subscribe(loadingBinding, loading -> {
if (!loading) {
future.complete(null);
}
}); |
|
I have following output Even if all tabs are loaded... |
This reverts commit a39742f.
|
When a file is loaded from outside, |
|
As far as i can approve koppors changes, @Siedlerchr should also approve. |
* upstream/main: Bump org.apache.lucene:lucene-core from 9.9.1 to 9.9.2 (#10860) Bump org.junit.jupiter:junit-jupiter from 5.10.1 to 5.10.2 (#10863) Bump org.apache.lucene:lucene-highlighter from 9.9.1 to 9.9.2 (#10861) Bump org.tinylog:tinylog-api from 2.6.2 to 2.7.0 (#10862) Bump org.apache.lucene:lucene-queryparser from 9.9.1 to 9.9.2 (#10859) Bump gradle/wrapper-validation-action from 1 to 2 (#10858) Bump codecov/codecov-action from 3 to 4 (#10857) Bump peter-evans/create-pull-request from 5 to 6 (#10856) Update Gradle Wrapper from 8.5 to 8.6. (#10854) Enable auto merge of gradle wrapper update Jump to entry from cli (#10578) Fix closing of JabRef in case of issues with index writer (#10840) Update deployment-arm64.yml Fix secrents presence chcek
* upstream/main: (68 commits) BibTeX 'Title' to MS Office 'Publicationtitle' field (JabRef#10864) Introduce BibliographyConsistencyCheckResultTxtWriter (JabRef#10847) Upgrade gradle-build-action to actions/setup-gradle (JabRef#10866) Bump org.apache.lucene:lucene-core from 9.9.1 to 9.9.2 (JabRef#10860) Bump org.junit.jupiter:junit-jupiter from 5.10.1 to 5.10.2 (JabRef#10863) Bump org.apache.lucene:lucene-highlighter from 9.9.1 to 9.9.2 (JabRef#10861) Bump org.tinylog:tinylog-api from 2.6.2 to 2.7.0 (JabRef#10862) Bump org.apache.lucene:lucene-queryparser from 9.9.1 to 9.9.2 (JabRef#10859) Bump gradle/wrapper-validation-action from 1 to 2 (JabRef#10858) Bump codecov/codecov-action from 3 to 4 (JabRef#10857) Bump peter-evans/create-pull-request from 5 to 6 (JabRef#10856) Update Gradle Wrapper from 8.5 to 8.6. (JabRef#10854) Enable auto merge of gradle wrapper update Jump to entry from cli (JabRef#10578) Fix closing of JabRef in case of issues with index writer (JabRef#10840) Update deployment-arm64.yml use nio path fix submodules Fix secrents presence chcek Update deployment-arm64.yml ...
Fixes JabRef#540
Command line now supports option "jumpToEntryKey" or "-j" folowed by one entrykey argument.
Upon start up, jabref will search the imported files (BibTex files given as command line arguments) for the entrykey and focus this library and select this entry. Recently opened files will not be searched for this key, as it may be out of the scope of my knowledge of the repository to handle this gracefully.
As mentioned by @calixtus refactoring is likely necessary to create a better way to mix the cli commands into the UI. Though functionality works as expected.
If this change is merged user documentation at https://docs.jabref.org/advanced/commandline may need to add this feature.
Feature demonstration


Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)