-
Notifications
You must be signed in to change notification settings - Fork 231
StackRenderer updates correctly when part is moved #3705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
StackRenderer updates correctly when part is moved #3705
Conversation
874fa44 to
709a71f
Compare
Test Results 3 024 files +6 3 024 suites +6 2h 24m 39s ⏱️ + 1m 35s Results for commit 67d31e2. ± Comparison against base commit 8567247. This pull request removes 12 and adds 13 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
|
Does not work, in case I use the example with from the Bug 576186 the UI gets correctly updated BUT if you start interacting with the UI you get additional tabs. We would not see that in the IDE because move alone (without additonal code)cannot be used due to the bug. Example code for moving a part around. @execute
|
709a71f to
a31fb7d
Compare
Fixes Eclipse Bug 576186. The StackRenderer now correctly updates its UI when a part within the stack is moved. This was achieved by handling UIEvents.isMOVE events for MPartStack children in StackRenderer.java. CTabItems, which represent tabs, cannot be reordered directly and must be disposed of and recreated at the new index. The methods calcIndexFor and findItemForPart in StackRenderer were updated to accept a more generic MElementContainer<? extends MUIElement> parameter to resolve type compatibility issues with MPartStack.
Ensure OWNING_ME data is preserved when a CTabItem is recreated during a move operation. This prevents the renderer from creating duplicate tabs for the same part.
164ac71 to
ce0ff9e
Compare
| newItem.setFont(font); | ||
| newItem.setData(data); | ||
| newItem.setData(OWNING_ME, movedElement); | ||
| newItem.setControl(control); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the currently selected tab is moved, the selection is not preserved. I should try to save it
java boolean wasSelected = tabFolder.getSelection() == item;
// ... dispose and recreate ...
if (wasSelected) {
tabFolder.setSelection(newItem);
}
|
|
||
| // The old item1 should be disposed | ||
| assertTrue(item1.isDisposed(), "Old item for part1 should be disposed"); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also check assertFalse(item2.isDisposed(), "Item2 should not be disposed");
vogella
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs adjustments
|
FYI: EModelService.move is not used at all in platform accoding to call hierachy |

Fixes Eclipse Bug 576186.
The StackRenderer now correctly updates its UI when a part within the stack is moved. This was achieved by handling UIEvents.isMOVE events for MPartStack children in StackRenderer.java. CTabItems, which represent tabs, cannot be reordered directly and must be disposed of and recreated at the new index. The methods calcIndexFor and findItemForPart in StackRenderer were updated to accept a more generic MElementContainer<? extends MUIElement> parameter to resolve type compatibility issues with MPartStack.
Also a test is added for this behaivor