diff options
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/org.eclipse.gmf.dev/ExtEditPartTracer.aj | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/devtools/org.eclipse.gmf.dev/ExtEditPartTracer.aj b/devtools/org.eclipse.gmf.dev/ExtEditPartTracer.aj new file mode 100644 index 000000000..ea330f61d --- /dev/null +++ b/devtools/org.eclipse.gmf.dev/ExtEditPartTracer.aj @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005 Borland Software Corporation + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Dmitri Stadnik (Borland) - initial API and implementation + */ +package org.eclipse.gmf.runtime.emf.type.core; + +import org.eclipse.gmf.dev.EditPartTraceUtil; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +/** + * @author dstadnik + */ +public aspect ExtEditPartTracer { + + pointcut makingCommandInEditHelper(IEditHelper editHelper, IEditCommandRequest request) : execution(ICommand IEditHelper.getEditCommand(IEditCommandRequest)) && target(editHelper) && args(request); + + ICommand around(IEditHelper editHelper, IEditCommandRequest request) : makingCommandInEditHelper(editHelper, request) { + ICommand command = proceed(editHelper, request); + if (command != null) { + EditPartTraceUtil.addSource(command, editHelper); + } + return command; + } + + pointcut makingCommandInEditHelperAdvice(IEditHelperAdvice advice, IEditCommandRequest request) : (execution(ICommand IEditHelperAdvice.getBeforeEditCommand(IEditCommandRequest)) || execution(ICommand IEditHelperAdvice.getAfterEditCommand(IEditCommandRequest))) && target(advice) && args(request); + + ICommand around(IEditHelperAdvice advice, IEditCommandRequest request) : makingCommandInEditHelperAdvice(advice, request) { + ICommand command = proceed(advice, request); + if (command != null) { + EditPartTraceUtil.addSource(command, advice); + } + return command; + } +} |