Skip to content

Make CTabFolder.setItemOrder package-private again, keep moveItem#3352

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-setitemorder-package-private
Jun 1, 2026
Merged

Make CTabFolder.setItemOrder package-private again, keep moveItem#3352
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-setitemorder-package-private

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Jun 1, 2026

Following review feedback on #3350, CTabFolder.setItemOrder(int[]) should not be exposed as public API. This demotes it back to a package-private helper and drops its @since tag, while keeping the public moveItem(int, int) method as the supported primitive for the common single-tab reorder (drag) gesture.

The priority[]/firstIndex remap fix from #3350 is retained, since moveItem delegates to setItemOrder and relies on it to keep the chevron and scroll state correct after a reorder. The unit tests that called setItemOrder directly are removed (they can no longer compile from the test package); the moveItem tests stay and continue to exercise the remap logic.

Following review feedback, setItemOrder(int[]) should not be exposed as
public API. Demote it back to a package-private helper and drop its
@SInCE tag, but keep the public moveItem(int, int) method as the
supported single-tab reorder primitive. The priority[]/firstIndex remap
fix is retained since moveItem relies on it for correct chevron and
scroll state. Removes the now-uncompilable setItemOrder unit tests.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Test Results

  182 files  ± 0    182 suites  ±0   27m 37s ⏱️ +54s
4 729 tests  -  5  4 706 ✅  -  5   23 💤 ±0  0 ❌ ±0 
6 848 runs   - 30  6 685 ✅  - 30  163 💤 ±0  0 ❌ ±0 

Results for commit 12b780e. ± Comparison against base commit 42b9859.

This pull request removes 5 tests.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_CTabFolder ‑ test_setItemOrder_chevronStillWorks
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_CTabFolder ‑ test_setItemOrder_errorCases
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_CTabFolder ‑ test_setItemOrder_identityIsNoOp
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_CTabFolder ‑ test_setItemOrder_keepsSelection
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_custom_CTabFolder ‑ test_setItemOrder_reordersItems

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Jun 1, 2026

The removed tests are due to the removal of the API. The fix in the incorrect handling of reordering in setItemOrder is of course left in the code and is indirectly tested via the moveItem method.

FYI - @HeikoKlare I plan to merge this today, to avoid having a SWT release with unwanted API.

@HeikoKlare
Copy link
Copy Markdown
Contributor

The removed tests are due to the removal of the API.

Would it make sense to preserve the tests as unit tests instead of API tests?

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Jun 1, 2026

The removed tests are due to the removal of the API.

Would it make sense to preserve the tests as unit tests instead of API tests?

I would say no, we didn't have them before and the new moveItem API is well-tested.

@vogella vogella merged commit 8d2155e into eclipse-platform:master Jun 1, 2026
24 checks passed
@vogella vogella deleted the ctabfolder-setitemorder-package-private branch June 1, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants