use of org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy in project statecharts by Yakindu.
the class StatechartTextEditPart method createDefaultEditPolicies.
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
// Disables deletion of the text compartment view if additional elements
// are selected too
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new SemanticEditPolicy() {
@Override
protected boolean shouldProceed(DestroyRequest destroyRequest) {
return false;
}
});
// Disables deletion of the text compartment view via keyboard
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PreferredSizeHandlerEditPolicy() {
@Override
protected IFigure getPreferredSizeFigure() {
return getChildBySemanticHint(SemanticHints.STATECHART_NAME).getFigure();
}
});
}
Aggregations