eclipse.platform.ui icon indicating copy to clipboard operation
eclipse.platform.ui copied to clipboard

Fix traverse in multi page editors

Open Christopher-Hermann opened this issue 2 months ago • 2 comments

control.traverse on a CTabFolder in the MultiPageEditor is navigation up the the outer CTabFolder itself.

This is causing several issues: Setting the page for example to the second-to-last is changing the page in the multipage editor. Then the traverse direction is changed causing the outer tab to move in the wrong direction. Furthermore on the outer tab you cannot jump from the last tab to the very first tab.

How to reproduce

  1. Open two .java editor and one multi page editor, for example the manifest.
  2. On the java editors, traverse to the next tab until you are in the manifest editor
  3. In the manifest editor, traverse next tab will not work
  4. Traverse to previous tab will jump to the plugin.xml inner tab
  5. Traverse to previous again will jump to the java editor

See

https://github.com/user-attachments/assets/3af76624-462c-40e6-85e3-bc5c8b9d56ea

Christopher-Hermann avatar Nov 21 '25 10:11 Christopher-Hermann

@fedejeanne I saw that you introduced the fix that enables to navigate from the last to the first tab:

loopToFirstOrLastItem(folder, forward);
traversalDirection = translateToTraversalDirection(!forward); 

Maybe you can have a look on my fix. I'm not really sure if this is really the best solution for the problem. It somehow feels like the wrong place here since control.traverse(traversalDirection) is looping up to the parent controls as well. So now we somehow skip the traverse in multi page editors. Not sure if this is a problem.

Maybe you have an opinion on that, but I guess you are not an expert here as well :D

Christopher-Hermann avatar Nov 21 '25 10:11 Christopher-Hermann

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 16m 43s ⏱️ -36s  8 234 tests ±0   7 985 ✅ ±0  249 💤 ±0  0 ❌ ±0  23 622 runs  ±0  22 828 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit adb2a2e1. ± Comparison against base commit a3fa0658.

github-actions[bot] avatar Nov 21 '25 11:11 github-actions[bot]