Add support for jumping in ordered author list by typing letters#6440
Conversation
… into pdf-icon-in-linked-files-column
…uthor-list-by-typing-letters
calixtus
left a comment
There was a problem hiding this comment.
You can also shorten this with some lambda-expression:
list.getItems().stream().filter(item -> item.getName().toLowerCase().startsWith(target_char))
.findFirst().ifPresent(item -> { this.scrollTo(item); this.getSelectionModel().clearAndSelect(item); });
for an example, have a look at gui/preferences/PreviewTabView.java::jumpToSearchKey
|
Hi @leitianjian , thank you very much for your contribution. |
|
Thanks for your suggestions. The method in jumpToSearchKey provides a very good template. I will rewrite the code and try to add test cases to test it. |
|
Hi, I think I have done it now. I used the stream to replace the for loop you have mentioned above, but I cannot construct a test case to test the method I added. I only test manually. I set the time to 700ms because I think 1s is too long for our typing. |
|
Is this ready for review? |
That's fine, There are many scenarios some gui stuff just cannot be tested. |
Yeah, I found the sad truth finally T^T |
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
|
@calixtus Thanks for your suggestions, I made a mistake when I adjust the code format and had not realized that. |
koppor
left a comment
There was a problem hiding this comment.
Have some code nitpicks. The acutal implementation should be (please) checked by @tobiasdiez
tobiasdiez
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your contribution!
(I didn't test if this interferes with typing in the entry editor or searchbar, but it shouldn't as the event is registered on the maintable).
Yeah, I tested it manually, which will not interfere with the searchbar. The target of the input is depended on the focusing window |
|
Ok, 2 approvals, @koppor s suggestions are fixed and the change is tested. |
…read * upstream/master: Fix label name Add support for jumping in ordered author list by typing letters (#6440) Bump flexmark-ext-gfm-strikethrough from 0.61.24 to 0.61.26 Bump org.beryx.jlink from 2.18.0 to 2.19.0 Bump flexmark from 0.61.24 to 0.61.26 Bump flexmark-ext-gfm-tasklist from 0.61.24 to 0.61.26
Fixes #6146
I think I have added the support for jumping to the entry when typing letters.
Should I add some comments to the method I added?
Thanks :D