Search in sources :

Example 1 with EditCommandRequestWrapper

use of org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper in project tdi-studio-se by Talend.

the class BusinessReferenceConnectionEditPolicy method createDeleteSemanticCommand.

/**
     * @generated
     */
protected Command createDeleteSemanticCommand(GroupRequest deleteRequest) {
    TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
    EditCommandRequestWrapper semReq = new EditCommandRequestWrapper(new DestroyElementRequest(editingDomain, false), deleteRequest.getExtendedData());
    Command semanticCmd = getHost().getCommand(semReq);
    if (semanticCmd != null && semanticCmd.canExecute()) {
        CompoundCommand cc = new CompoundCommand();
        cc.add(semanticCmd);
        return cc;
    }
    return null;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) DestroyElementRequest(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest) UnexecutableCommand(org.eclipse.gef.commands.UnexecutableCommand) DeleteCommand(org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) Command(org.eclipse.gef.commands.Command) EditCommandRequestWrapper(org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)1 Command (org.eclipse.gef.commands.Command)1 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)1 UnexecutableCommand (org.eclipse.gef.commands.UnexecutableCommand)1 DeleteCommand (org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand)1 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)1 EditCommandRequestWrapper (org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper)1 DestroyElementRequest (org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest)1