Just as I thought all works fine, something doesn't. Let me basically describe my e4-App:
I have a Application which contains initially a single Part with a empty table (NatTable). In the Toolbar is a Command to setup the part. The Handler behind the Command first setups the initial Part. But when the first part is already setup, a new Part is created using the EPartService and a defined PartDescriptor (which uses the same class as the initial part).
The Part also has a (empty) Popup Menu defined. The Table of the Part is linked with this Menu over EMenuService#registerContextMenu. The Menu Items itself are provided by a second plugin over a Model Fragment which Element ID is the menu ID and which contains HandledMenuItem's.
Now the problem is, this works for the initial Part. For the Parts which are created over the EPartService using a PartDescriptor, no Popup Menu shows up on right click on the table.
What must be done that my "dynamic" Parts show up the same Popup Menu as my "static" Part? The PartDescriptor has defined a Popup Menu with the same (Menu-)ID.
I have some kind of workaround for my problem. I changed my Handler to search for all MParts matching my Part-ID. I check all Parts for there setup and possible update it. But when I decide I need a new Part, I clone the Part using the cloneElement-Method of the EModelService and activate it with the EPartService.
With this method the popup menu also shows on the newly created Part.
There is still a Problem, removing the second Plugin which contains the HandledItems for the Parts results in an error for the active part and a disabled popup menu for the other parts. I also don't known what will happen if I later add a new Plugin with new HandledItems.
So still it would be nice if anyone can lead me to the right direction.