I seem to have a problem with removing parts programatically, which contain a toolbar.
I create the parts with the following commands:
final MPart newPart = partService.createPart("rcpcan.partdescriptor.signalmapping");
partStack.getChildren().add(newPart);
partService.activate(newPart, true);
newPart.setVisible(true);
The Partdescriptor looks like this:
The Problem occurs when I remove those parts created with the partdescriptor. Heres the code for removing those parts:
final MPart inactivePart = (MPart) name, application);
final MElementContainer<MUIElement> parent = inactivePart.getParent();
parent.getChildren().remove(inactivePart);
inactivePart.setToBeRendered(false);
partService.hidePart(inactivePart, true);
As soon as I remove one part, all other Parts get one more HandledToolItem added. That's for each Part that is created by the PartDescriptor. To show you what I mean I have some screenshots.
Before removal:
Maybe you guys have some idea why this occurs. Thanks in advance!