Search in sources :

Example 6 with ICommandProxy

use of org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy in project statecharts by Yakindu.

the class EAttributeDirectEditPolicy method getDirectEditCommand.

@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
    SetRequest setRequest = new SetRequest(getHost().resolveSemanticElement(), provider.getAttribute(), request.getCellEditor().getValue());
    SetValueCommand setCommand = new SetValueCommand(setRequest);
    return new ICommandProxy(setCommand);
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)

Example 7 with ICommandProxy

use of org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy in project statecharts by Yakindu.

the class InitialPointsConnectionBendpointEditPolicy method getBendpointsChangedCommand.

@Override
protected Command getBendpointsChangedCommand(BendpointRequest request) {
    PointList originalPoints = InitialPointsOfRequestDataManager.getOriginalPoints(request);
    Command result = super.getBendpointsChangedCommand(request);
    if (result instanceof ICommandProxy) {
        ICommand iCommand = ((ICommandProxy) result).getICommand();
        if (iCommand instanceof SetConnectionBendpointsAndLabelCommmand) {
            ((SetConnectionBendpointsAndLabelCommmand) iCommand).setLabelsToUpdate((org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) getHost(), originalPoints);
        }
    }
    return result;
}
Also used : PointList(org.eclipse.draw2d.geometry.PointList) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) ICommand(org.eclipse.gmf.runtime.common.core.command.ICommand) Command(org.eclipse.gef.commands.Command) ICommand(org.eclipse.gmf.runtime.common.core.command.ICommand) SetConnectionBendpointsAndLabelCommmand(org.yakindu.sct.ui.editor.commands.SetConnectionBendpointsAndLabelCommmand)

Example 8 with ICommandProxy

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

the class BusinessGraphicalNodeEditPolicy method getConnectionWithReorientedViewCompleteCommand.

/**
     * @generated
     */
protected Command getConnectionWithReorientedViewCompleteCommand(CreateConnectionRequest request) {
    ICommandProxy c = (ICommandProxy) super.getConnectionCompleteCommand(request);
    CompositeCommand cc = (CompositeCommand) c.getICommand();
    TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
    BusinessReorientConnectionViewCommand rcvCommand = new BusinessReorientConnectionViewCommand(editingDomain, null);
    rcvCommand.setEdgeAdaptor(getViewAdapter());
    cc.compose(rcvCommand);
    return c;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) BusinessReorientConnectionViewCommand(org.talend.designer.business.model.business.diagram.edit.commands.BusinessReorientConnectionViewCommand) CompositeCommand(org.eclipse.gmf.runtime.common.core.command.CompositeCommand)

Example 9 with ICommandProxy

use of org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy in project statecharts by Yakindu.

the class TransitionExpressionComponentEditPolicy method createDeleteSemanticCommand.

@Override
protected Command createDeleteSemanticCommand(GroupRequest deleteRequest) {
    SetRequest request = new SetRequest(getHost().resolveSemanticElement(), SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION, null);
    SetValueCommand result = new SetValueCommand(request);
    return new ICommandProxy(result);
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)

Example 10 with ICommandProxy

use of org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy in project statecharts by Yakindu.

the class RegionCompartmentEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentCreationEditPolicy());
    installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new RegionCompartmentCanonicalEditPolicy());
    installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {

        @Override
        protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
            // Remove dithering connection anchors
            CompoundCommand result = new CompoundCommand();
            result.add(super.getResizeChildrenCommand(request));
            AdjustIdentityAnchorCommand command = new AdjustIdentityAnchorCommand(TransactionUtil.getEditingDomain(resolveSemanticElement()), request);
            result.add(new ICommandProxy(command));
            return result;
        }
    });
    // Removes the collapse expand handler
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableEditPolicyEx());
    installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new SimpleSnapFeedbackPolicy());
}
Also used : ChangeBoundsRequest(org.eclipse.gef.requests.ChangeBoundsRequest) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) ResizableEditPolicyEx(org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableEditPolicyEx) XYLayoutEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy) AdjustIdentityAnchorCommand(org.yakindu.base.xtext.utils.gmf.commands.AdjustIdentityAnchorCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) Command(org.eclipse.gef.commands.Command) AdjustIdentityAnchorCommand(org.yakindu.base.xtext.utils.gmf.commands.AdjustIdentityAnchorCommand) CompartmentCreationEditPolicy(org.yakindu.sct.ui.editor.policies.CompartmentCreationEditPolicy) RegionCompartmentCanonicalEditPolicy(org.yakindu.sct.ui.editor.policies.RegionCompartmentCanonicalEditPolicy) DragDropEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

ICommandProxy (org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy)14 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)7 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)6 Command (org.eclipse.gef.commands.Command)3 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)3 EObjectAdapter (org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter)3 ChangeBoundsRequest (org.eclipse.gef.requests.ChangeBoundsRequest)2 ICommand (org.eclipse.gmf.runtime.common.core.command.ICommand)2 CreateViewAndElementRequest (org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)2 CompositeTransactionalCommand (org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand)2 SetValueCommand (org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)2 SetRequest (org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)2 View (org.eclipse.gmf.runtime.notation.View)2 SetConnectionBendpointsAndLabelCommmand (org.yakindu.sct.ui.editor.commands.SetConnectionBendpointsAndLabelCommmand)2 LinkedList (java.util.LinkedList)1 List (java.util.List)1 IFigure (org.eclipse.draw2d.IFigure)1 Point (org.eclipse.draw2d.geometry.Point)1 PointList (org.eclipse.draw2d.geometry.PointList)1 EObject (org.eclipse.emf.ecore.EObject)1