NextTab action: allow Cycling when reaching the end
Specifically for CTabFolders, this commit detects when the NextTab action has reached the last item and will cycle to the first item instead of doing nothing. It will load the item which is displayed in that page.
(achieved by pressing Ctrl + pgdown)
This fix only works for CTabFolders: the "traverse"-Method only returns whether it performed something or nothing. However, it also returns true if it effectively performed nothing but actually couldn't because it was on the last item. For CTabFolders, I can check whether we are on the last item and manually jump to the second-to last item in the row. By jumping to the second-to-last item, I can still perform the "normal action" performed by SWT for traverse, which means that all Components are loaded correctly and the chevron is shown correctly. I could not find a good general API which would allow to tell in general which tab I am on. However, all of the "normal" views use a CTabFolder, so the loss of generality is minimal
Test Results
921 files ±0 921 suites ±0 48m 10s :stopwatch: + 1m 29s 7 535 tests ±0 7 384 :white_check_mark: - 1 150 :zzz: ±0 1 :x: +1 23 757 runs ±0 23 241 :white_check_mark: - 1 515 :zzz: ±0 1 :x: +1
For more details on these failures, see this check.
Results for commit ca8fa8a1. ± Comparison against base commit 17e35c4d.
@Wittmaxi, thank you for contributing this. I haven't really looked at the code yet so my comment is only a general one: is this a new feature or was the behavior "wrong" before this PR?
If I navigate through the tabs before applying this PR then the chevron is opened and I can select the next tab (it takes more clicks, but it's doable), which might be ok for others. This mean that this PR would be changing some normal (maybe even desired?) behavior.
With that in mind, I have only one ask for now and that is: please explain the current behavior and how this PR changes it in the description of this PR so the community can give its opinion. Change the PR to "ready for review" once this is done and see if someone comments on that.
I'll take a look at the code later today.
(FWIW I like the functionality that this PR brings)