Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2006-05-12 13:32:40 +0000
committerdstadnik2006-05-12 13:32:40 +0000
commit4d9d08c81b98868487e2b28b90db6bc397995d40 (patch)
treed2bfa9512cc47d6b3178e9ab86f538c60ca59557 /devtools/org.eclipse.gmf.dev/EditPartTracer.aj
parenta9093b3c23a93d17746386033e1ab2abd1f0d2a4 (diff)
downloadorg.eclipse.gmf-tooling-4d9d08c81b98868487e2b28b90db6bc397995d40.tar.gz
org.eclipse.gmf-tooling-4d9d08c81b98868487e2b28b90db6bc397995d40.tar.xz
org.eclipse.gmf-tooling-4d9d08c81b98868487e2b28b90db6bc397995d40.zip
move aspect to this plugin; remove gmf rt dep
Diffstat (limited to 'devtools/org.eclipse.gmf.dev/EditPartTracer.aj')
-rw-r--r--devtools/org.eclipse.gmf.dev/EditPartTracer.aj80
1 files changed, 0 insertions, 80 deletions
diff --git a/devtools/org.eclipse.gmf.dev/EditPartTracer.aj b/devtools/org.eclipse.gmf.dev/EditPartTracer.aj
deleted file mode 100644
index 0587a51b1..000000000
--- a/devtools/org.eclipse.gmf.dev/EditPartTracer.aj
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.diagram.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author dstadnik
- */
-public aspect EditPartTracer {
-
- pointcut makingCommand(EditPart editPart, Request request) : (execution(Command ConnectionEditPart.getCommand(Request)) || execution(Command GraphicalEditPart.getCommand(Request))) && target(editPart) && args(request);
-
- Command around(EditPart editPart, Request request) : makingCommand(editPart, request) {
- fireCommandRequested(editPart, request);
- Map sources = new HashMap();
- Command command = null;
- try {
- command = proceed(editPart, request);
- } finally {
- fireCommandCreated(editPart, request, command, sources);
- }
- return command;
- }
-
- private static Object getTraceView() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- return null;
- }
- IWorkbenchPage page = window.getActivePage();
- if (page == null) {
- return null;
- }
- return page.findView("org.eclipse.gmf.dev.EditPartTraceView");
- }
-
- private void fireCommandRequested(EditPart editPart, Request request) {
- Object view = getTraceView();
- if (view == null) {
- return;
- }
- try {
- view.getClass().getDeclaredMethod("traceCommandRequested", EditPart.class, Request.class).invoke(view, editPart, request);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- private void fireCommandCreated(EditPart editPart, Request request, Command command, Map sources) {
- Object view = getTraceView();
- if (view == null) {
- return;
- }
- try {
- view.getClass().getDeclaredMethod("traceCommandCreated", EditPart.class, Request.class, Command.class, Map.class).invoke(view, editPart, request, command, sources);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-}

Back to the top