Summary: | EModelService#move cannot move within the same container because of The 'no duplicates' constraint is violated | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> | ||||
Component: | UI | Assignee: | Rolf Theunissen <rolf.theunissen> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | Lars.Vogel, rolf.theunissen | ||||
Version: | 4.14 | ||||||
Target Milestone: | 4.19 M3 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
See Also: |
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/167937 https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/168031 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=204977606931bf8f645c7d201473686db562c4b6 |
||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 576186 | ||||||
Attachments: |
|
Description
Lars Vogel
2020-08-19 04:13:57 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/167937 New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/168031 Mass change to 4.19 M1, please update the target if you have other plans. Mass move 4.19 M1 bugs to M3 Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/168031 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=204977606931bf8f645c7d201473686db562c4b6 Created attachment 287176 [details]
Screenshot
The move method does not through an exception anymore but the UI does not get updated.
I don't think this is the correct behavior:
Method to move:
package atest.handlers;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
public class MoveHandler {
@Execute
public void execute(MPart part, EModelService modelService, MWindow window) {
MPartStack find = (MPartStack) modelService.find("atest.partstack.sample", window);
modelService.move(part, find, 2);
}
}
If I move the part manually then the UI gets updated.
find.getChildren().remove(part);
find.getChildren().add(2, part);
Rolf, WDTY? (In reply to Lars Vogel from comment #7) > Rolf, WDTY? As a result of the ECollections.move an 'move' event is raise, instead of the 'remove'/'insert' when remove and add are used, see UIEvents.EventTypes.Move. However, this event is not handled in any of the renderers. I had a patch that used this (I think in the when working on toolbar/menu renderer), but this was reverted. (In reply to Rolf Theunissen from comment #8) > (In reply to Lars Vogel from comment #7) > > Rolf, WDTY? > > As a result of the ECollections.move an 'move' event is raise, instead of > the 'remove'/'insert' when remove and add are used, see > UIEvents.EventTypes.Move. > However, this event is not handled in any of the renderers. I had a patch > that used this (I think in the when working on toolbar/menu renderer), but > this was reverted. Thanks Rolf, I opened Bug 576186 for considering this event in the stack renderer. |