I'm testing an non-e4 RCP application using SWTBot and I need to change the size of my view. (Move the sash-bar)
I unsuccessfully tried
- Resize my view using SWTBot (no such api)
- Resize my view using Eclipse 3 API (no supported)
- Resize my view using underlying e4 model (resizing not working)
e4 model seams to be promising, but I'm missing something, so it doesn't work.
I can
- Get MPart of my view:
view = ePartService.findPart(ID) - Get MTrimmedWindow:
window = (view as EObject).eContainer as MTrimmedWindow
I can't
- locale correct MPartSashContainer
- move sash-bar with
setContainerData()
I would like to know
- How can I move from MPart to its direct parent (e.g. MPartStack)
- Why common EObject methods like eContainer() are not present on M... objects?
Ok, I found a solution myself.
The thing is, that the view is not a part of the e4 UI-Tree.
view.eContaineris directly theMWindow. To be placed at the right spot the view is connected to theMPlaceholder, that is a part of the e4 UI-Tree and hasgetParent() != null.In order to resize a view the steps are:
MPlaceholderof the viewMPartStackand `MPartSashContainer´ objectcontainerDataExample: