Search in sources :

Example 1 with UpdateAnnotationsOnCreationCommand

use of org.yakindu.base.gmf.runtime.treelayout.commands.UpdateAnnotationsOnCreationCommand in project statecharts by Yakindu.

the class TreeLayoutEditPolicy method getCreateCommand.

@Override
protected Command getCreateCommand(CreateRequest request) {
    final CompoundCommand cmd = new CompoundCommand();
    cmd.add(super.getCreateCommand(request));
    if (request instanceof CreateViewAndElementRequest) {
        final CreateViewAndElementRequest req = (CreateViewAndElementRequest) request;
        if (shouldUpdateAnnotationsOnCreation(req)) {
            cmd.add(new ICommandProxy(new UpdateAnnotationsOnCreationCommand(getHost().getEditingDomain(), req)));
        }
    }
    return cmd;
}
Also used : ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) CreateViewAndElementRequest(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest) UpdateAnnotationsOnCreationCommand(org.yakindu.base.gmf.runtime.treelayout.commands.UpdateAnnotationsOnCreationCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

CompoundCommand (org.eclipse.gef.commands.CompoundCommand)1 ICommandProxy (org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy)1 CreateViewAndElementRequest (org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)1 UpdateAnnotationsOnCreationCommand (org.yakindu.base.gmf.runtime.treelayout.commands.UpdateAnnotationsOnCreationCommand)1