Community
Participate
Working Groups
If you add a port to an component and then copy & paste it, it appears on the (root) model. It is not possible to delete this port from the model. 1. add a component to a model 2. add a port to the component 3. select the port element 4. press cmd+c or strg+c to copy it to clipboard 5. press cmd+v or strg+v to paste it. The port element cant be deleted and the model is invalid. The port element should bei deleteable.
it's working fine on the nightly build. Can you attach a screenshot of your model explorer? Or best the corrupted model ?
Created attachment 243027 [details] Screenshot of the model explorer and the model
This code (at the end) forbid your action. Since the graphical port is not in the graphical element of his semantic parent, you can not delete it. You can "hide" it(remove only the graphical part) org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.CustomPortItemSemanticEditPolicy /** * <pre> * Forbid direct destruction of Port in case the graphical parent is not * the semantic parent. * * {@inheritDoc} * </pre> */ @Override protected Command getDestroyElementCommand(DestroyElementRequest req) { EObject graphicalParent = ((GraphicalEditPart)getHost().getParent()).resolveSemanticElement(); EObject semanticParent = req.getElementToDestroy().eContainer(); if(graphicalParent != semanticParent) { return UnexecutableCommand.INSTANCE; } return super.getDestroyElementCommand(req); }