Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2006-05-11 07:59:24 -0400
committerdstadnik2006-05-11 07:59:24 -0400
commit9546e95c2f4776aa683279850becb6e8b4ac2389 (patch)
tree0ff6dd760a8d0e2b92461dbd35e35cc60febd061 /devtools
parent632709062b0937ed62fe29fb16fba57e46e2159c (diff)
downloadorg.eclipse.gmf-tooling-9546e95c2f4776aa683279850becb6e8b4ac2389.tar.gz
org.eclipse.gmf-tooling-9546e95c2f4776aa683279850becb6e8b4ac2389.tar.xz
org.eclipse.gmf-tooling-9546e95c2f4776aa683279850becb6e8b4ac2389.zip
removed
Diffstat (limited to 'devtools')
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/.classpath7
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/.cvsignore1
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/.project28
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/META-INF/MANIFEST.MF14
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/build.properties4
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/eptracer.PNGbin57406 -> 0 bytes
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/oeg.runtime.diagram.ui.txt233
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/oeg.runtime.emf.type.core.txt49
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/DevHookPlugin.java40
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTraceListener.java36
-rw-r--r--devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTracer.java123
11 files changed, 0 insertions, 535 deletions
diff --git a/devtools/org.eclipse.gmf.dev.hook/.classpath b/devtools/org.eclipse.gmf.dev.hook/.classpath
deleted file mode 100644
index 751c8f2e5..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/devtools/org.eclipse.gmf.dev.hook/.cvsignore b/devtools/org.eclipse.gmf.dev.hook/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/devtools/org.eclipse.gmf.dev.hook/.project b/devtools/org.eclipse.gmf.dev.hook/.project
deleted file mode 100644
index 4e47f75b1..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.gmf.dev.hook</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/devtools/org.eclipse.gmf.dev.hook/META-INF/MANIFEST.MF b/devtools/org.eclipse.gmf.dev.hook/META-INF/MANIFEST.MF
deleted file mode 100644
index c989d3e39..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: GMF Dev Hook
-Bundle-SymbolicName: org.eclipse.gmf.dev.hook; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Activator: org.eclipse.gmf.dev.hook.DevHookPlugin
-Bundle-Vendor: eclipse.org
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ui,
- org.eclipse.draw2d,
- org.eclipse.gef
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.gmf.dev.hook
diff --git a/devtools/org.eclipse.gmf.dev.hook/build.properties b/devtools/org.eclipse.gmf.dev.hook/build.properties
deleted file mode 100644
index 34d2e4d2d..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/devtools/org.eclipse.gmf.dev.hook/eptracer.PNG b/devtools/org.eclipse.gmf.dev.hook/eptracer.PNG
deleted file mode 100644
index e40e3abe6..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/eptracer.PNG
+++ /dev/null
Binary files differ
diff --git a/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.diagram.ui.txt b/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.diagram.ui.txt
deleted file mode 100644
index 89ed2bf30..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.diagram.ui.txt
+++ /dev/null
@@ -1,233 +0,0 @@
-Index: META-INF/MANIFEST.MF
-===================================================================
-RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/META-INF/MANIFEST.MF,v
-retrieving revision 1.6
-diff -u -r1.6 MANIFEST.MF
---- META-INF/MANIFEST.MF 11 Nov 2005 16:28:07 -0000 1.6
-+++ META-INF/MANIFEST.MF 15 Nov 2005 09:14:56 -0000
-@@ -74,5 +74,6 @@
- org.eclipse.gmf.runtime.notation;visibility:=reexport,
- org.eclipse.emf.common,
- org.eclipse.emf.ecore,
-- org.eclipse.gmf.runtime.diagram.core;visibility:=reexport
-+ org.eclipse.gmf.runtime.diagram.core;visibility:=reexport,
-+ org.eclipse.gmf.dev.hook
- Eclipse-AutoStart: true
-Index: src/org/eclipse/gmf/runtime/diagram/ui/editparts/ConnectionEditPart.java
-===================================================================
-RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/editparts/ConnectionEditPart.java,v
-retrieving revision 1.14
-diff -u -r1.14 ConnectionEditPart.java
---- src/org/eclipse/gmf/runtime/diagram/ui/editparts/ConnectionEditPart.java 8 Nov 2005 18:50:25 -0000 1.14
-+++ src/org/eclipse/gmf/runtime/diagram/ui/editparts/ConnectionEditPart.java 15 Nov 2005 09:14:57 -0000
-@@ -17,6 +17,7 @@
- import java.util.Dictionary;
- import java.util.HashMap;
- import java.util.Hashtable;
-+import java.util.IdentityHashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.ListIterator;
-@@ -51,6 +52,7 @@
- import org.eclipse.gef.editparts.AbstractConnectionEditPart;
- import org.eclipse.gef.editpolicies.SnapFeedbackPolicy;
- import org.eclipse.gef.rulers.RulerProvider;
-+import org.eclipse.gmf.dev.hook.EditPartTracer;
- import org.eclipse.gmf.runtime.common.ui.services.action.filter.ActionFilterService;
- import org.eclipse.gmf.runtime.diagram.core.internal.util.MEditingDomainGetter;
- import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-@@ -507,17 +509,46 @@
- return UnexecutableCommand.INSTANCE;
- }
-
-+ Command cmd = null;
-+ final Map sources = new IdentityHashMap();
-+ _request.getExtendedData().put("org.eclipse.gmf.dev.sources", sources);
-+ traceCommandRequested(_request);
-+
-+ try {
- final Request request = _request;
-- Command cmd = (Command) MEditingDomainGetter.getMEditingDomain(
-+ cmd = (Command) MEditingDomainGetter.getMEditingDomain(
- (View) getModel()).runAsRead(new MRunnable() {
-
- public Object run() {
-- return ConnectionEditPart.super.getCommand(request);
-+ //return ConnectionEditPart.super.getCommand(request);
-+ return EditPartTracer.Insider.getCommand(
-+ getEditPolicyIterator(), request, sources);
- }
- });
-+ } finally {
-+ traceCommandCreated(_request, cmd, sources);
-+ }
-+
- return cmd;
- }
-
-+ protected final void traceCommandRequested(Request request) {
-+ EditPartTracer tracer = EditPartTracer.getInstance(getViewer());
-+ if (tracer == null) {
-+ return;
-+ }
-+ tracer.fireCommandRequested(this, request);
-+ }
-+
-+ protected final void traceCommandCreated(Request request, Command command,
-+ Map sources) {
-+ EditPartTracer tracer = EditPartTracer.getInstance(getViewer());
-+ if (tracer == null) {
-+ return;
-+ }
-+ tracer.fireCommandCreated(this, request, command, sources);
-+ }
-+
- /**
- * Convenience method returning the editpart's Diagram, the Diagam that owns
- * the edit part
-Index: src/org/eclipse/gmf/runtime/diagram/ui/editparts/GraphicalEditPart.java
-===================================================================
-RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/editparts/GraphicalEditPart.java,v
-retrieving revision 1.17
-diff -u -r1.17 GraphicalEditPart.java
---- src/org/eclipse/gmf/runtime/diagram/ui/editparts/GraphicalEditPart.java 8 Nov 2005 19:38:16 -0000 1.17
-+++ src/org/eclipse/gmf/runtime/diagram/ui/editparts/GraphicalEditPart.java 15 Nov 2005 09:14:57 -0000
-@@ -17,6 +17,7 @@
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.Hashtable;
-+import java.util.IdentityHashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.ListIterator;
-@@ -45,6 +46,7 @@
- import org.eclipse.gef.requests.DropRequest;
- import org.eclipse.gef.requests.GroupRequest;
- import org.eclipse.gef.requests.TargetRequest;
-+import org.eclipse.gmf.dev.hook.EditPartTracer;
- import org.eclipse.gmf.runtime.common.core.util.IAdaptableSelection;
- import org.eclipse.gmf.runtime.common.ui.services.action.filter.ActionFilterService;
- import org.eclipse.gmf.runtime.common.ui.services.parser.CommonParserHint;
-@@ -89,6 +91,7 @@
- import org.eclipse.swt.widgets.Display;
- import org.eclipse.ui.IActionFilter;
-
-+
- /**
- * @author melaasar,mmostafa
- *
-@@ -331,18 +334,29 @@
- return UnexecutableCommand.INSTANCE;
- }
- }
--
-+
- Command cmd = null;
- try {
- GETCOMMAND_RECURSIVE_COUNT++;
- final Request request = _request;
-+
-+ final Map sources = new IdentityHashMap();
-+ request.getExtendedData().put("org.eclipse.gmf.dev.sources", sources);
-+ traceCommandRequested(_request);
-+ try {
-+
- cmd = (Command) MEditingDomainGetter.getMEditingDomain((View)getModel()).runAsRead(new MRunnable() {
-
- public Object run() {
-- return GraphicalEditPart.super.getCommand(request);
-+ //return GraphicalEditPart.super.getCommand(request);
-+ return EditPartTracer.Insider.getCommand(
-+ getEditPolicyIterator(), request, sources);
- }
- });
-
-+ } finally {
-+ traceCommandCreated(_request, cmd, sources);
-+ }
-
- if ( cmd != null ) {
- _disableCanonicalEditPolicyList.addAll(disableCanonicalFor(_request));
-@@ -369,8 +383,25 @@
- GETCOMMAND_RECURSIVE_COUNT = 0;
- throw t;
- }
-- return cmd;
-
-+ return cmd;
-+ }
-+
-+ protected final void traceCommandRequested(Request request) {
-+ EditPartTracer tracer = EditPartTracer.getInstance(getViewer());
-+ if (tracer == null) {
-+ return;
-+ }
-+ tracer.fireCommandRequested(this, request);
-+ }
-+
-+ protected final void traceCommandCreated(Request request, Command command,
-+ Map sources) {
-+ EditPartTracer tracer = EditPartTracer.getInstance(getViewer());
-+ if (tracer == null) {
-+ return;
-+ }
-+ tracer.fireCommandCreated(this, request, command, sources);
- }
-
- /**
-Index: src/org/eclipse/gmf/runtime/diagram/ui/editpolicies/SemanticEditPolicy.java
-===================================================================
-RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/editpolicies/SemanticEditPolicy.java,v
-retrieving revision 1.4
-diff -u -r1.4 SemanticEditPolicy.java
---- src/org/eclipse/gmf/runtime/diagram/ui/editpolicies/SemanticEditPolicy.java 2 Nov 2005 23:30:16 -0000 1.4
-+++ src/org/eclipse/gmf/runtime/diagram/ui/editpolicies/SemanticEditPolicy.java 15 Nov 2005 09:14:57 -0000
-@@ -11,6 +11,8 @@
-
- package org.eclipse.gmf.runtime.diagram.ui.editpolicies;
-
-+import java.util.Map;
-+
- import org.eclipse.emf.ecore.EObject;
- import org.eclipse.gef.EditPart;
- import org.eclipse.gef.Request;
-@@ -68,9 +70,25 @@
- * @see org.eclipse.gef.EditPolicy#getCommand(Request)
- */
- public Command getCommand(Request request) {
-+ Command cmd = getCommandX(request);
-+ Map sources = (Map) request.getExtendedData().get("org.eclipse.gmf.dev.sources");
-+ if (cmd != null && sources != null) {
-+ sources.put(cmd, this);
-+ }
-+ return cmd;
-+ }
-+
-+ /**
-+ * @see org.eclipse.gef.EditPolicy#getCommand(Request)
-+ */
-+ public Command getCommandX(Request request) {
-+ Map sources = (Map) request.getExtendedData().get("org.eclipse.gmf.dev.sources");
- if (RequestConstants.REQ_SEMANTIC_WRAPPER.equals(request.getType())) {
-- return getSemanticCommand(((EditCommandRequestWrapper) request)
-- .getEditCommandRequest());
-+ IEditCommandRequest semRequest = ((EditCommandRequestWrapper) request).getEditCommandRequest();
-+ if (sources != null) {
-+ semRequest.setParameter("org.eclipse.gmf.dev.sources", sources);
-+ }
-+ return getSemanticCommand(semRequest);
- } else if (REQ_RECONNECT_SOURCE.equals(request.getType())
- && relationshipSourceHasChanged((ReconnectRequest) request)) {
- EditPart connectionEP = ((ReconnectRequest) request)
-@@ -128,7 +146,11 @@
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
-
-+ Map sources = (Map) request.getParameter("org.eclipse.gmf.dev.sources");
- IEditCommandRequest completedRequest = completeRequest(request);
-+ if (sources != null) {
-+ completedRequest.setParameter("org.eclipse.gmf.dev.sources", sources);
-+ }
-
- IElementType elementType = ElementTypeRegistry.getInstance()
- .getElementType(completedRequest.getEditHelperContext());
diff --git a/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.emf.type.core.txt b/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.emf.type.core.txt
deleted file mode 100644
index 7ebd513c0..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/oeg.runtime.emf.type.core.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-Index: src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java
-===================================================================
-RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.emf.type.core/src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java,v
-retrieving revision 1.2
-diff -u -r1.2 AbstractEditHelper.java
---- src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java 12 Sep 2005 21:26:55 -0000 1.2
-+++ src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java 15 Nov 2005 09:15:21 -0000
-@@ -91,6 +91,11 @@
-
- CompositeCommand command = createCompositeCommand(req);
-
-+ Map sources = (Map) req.getParameter("org.eclipse.gmf.dev.sources");
-+ if (sources != null) {
-+ sources.put(command, this);
-+ }
-+
- // Get 'before' commands from matching element type
- // specializations
- IEditHelperAdvice[] advice = getEditHelperAdvice(req);
-@@ -104,6 +109,9 @@
-
- if (beforeAdvice != null) {
- command.compose(beforeAdvice);
-+ if (sources != null) {
-+ sources.put(beforeAdvice, nextAdvice);
-+ }
- }
- }
- }
-@@ -117,6 +125,9 @@
-
- } else if (insteadCommand != null) {
- command.compose(insteadCommand);
-+ if (sources != null) {
-+ sources.put(insteadCommand, this);
-+ }
- }
-
- // Get 'after' commands from matching element type
-@@ -130,6 +141,9 @@
-
- if (afterAdvice != null) {
- command.compose(afterAdvice);
-+ if (sources != null) {
-+ sources.put(afterAdvice, nextAdvice);
-+ }
- }
- }
- }
diff --git a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/DevHookPlugin.java b/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/DevHookPlugin.java
deleted file mode 100644
index 4b8973742..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/DevHookPlugin.java
+++ /dev/null
@@ -1,40 +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.dev.hook;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * @author dstadnik
- */
-public class DevHookPlugin extends AbstractUIPlugin {
-
- private static DevHookPlugin instance;
-
- public DevHookPlugin() {
- instance = this;
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- instance = null;
- }
-
- public static DevHookPlugin getInstance() {
- return instance;
- }
-}
diff --git a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTraceListener.java b/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTraceListener.java
deleted file mode 100644
index 08ecca811..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTraceListener.java
+++ /dev/null
@@ -1,36 +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.dev.hook;
-
-import java.util.Map;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-
-/**
- * Traces editparts notifications.
- *
- * @author dstadnik
- */
-public interface EditPartTraceListener {
-
- /**
- * Called when command was requested but before it was created.
- */
- public void commandRequested(EditPart editPart, Request request);
-
- /**
- * Edit part created command in response to the request.
- */
- public void commandCreated(EditPart editPart, Request request, Command command, Map sources);
-}
diff --git a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTracer.java b/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTracer.java
deleted file mode 100644
index 50c20607b..000000000
--- a/devtools/org.eclipse.gmf.dev.hook/src/org/eclipse/gmf/dev/hook/EditPartTracer.java
+++ /dev/null
@@ -1,123 +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.dev.hook;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-/**
- * @author dstadnik
- */
-public class EditPartTracer {
-
- private List listeners;
-
- private EditPartTracer() {}
-
- public static EditPartTracer getInstance(EditPartViewer viewer) {
- if (viewer == null) {
- return null;
- }
- return (EditPartTracer) viewer.getProperty(EditPartTracer.class.getName());
- }
-
- public static EditPartTracer install(EditPartViewer viewer) {
- EditPartTracer tracer = getInstance(viewer);
- if (tracer == null && viewer != null) {
- tracer = new EditPartTracer();
- viewer.setProperty(EditPartTracer.class.getName(), tracer);
- }
- return tracer;
- }
-
- public void addTraceListener(EditPartTraceListener listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- if (listeners == null) {
- listeners = new ArrayList();
- }
- listeners.add(listener);
- }
-
- public void removeTraceListener(EditPartTraceListener listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- if (listeners == null) {
- return;
- }
- listeners.remove(listener);
- }
-
- public void fireCommandRequested(EditPart editPart, Request request) {
- if (listeners == null) {
- return;
- }
- for (int i = 0; i < listeners.size(); i++) {
- try {
- ((EditPartTraceListener) listeners.get(i)).commandRequested(editPart, request);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
-
- public void fireCommandCreated(EditPart editPart, Request request, Command command, Map sources) {
- if (listeners == null) {
- return;
- }
- for (int i = 0; i < listeners.size(); i++) {
- try {
- ((EditPartTraceListener) listeners.get(i)).commandCreated(editPart, request, command, sources);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
-
- public static class Insider extends AbstractGraphicalEditPart {
-
- /**
- * Standard implementation of getCommand(Request) method
- * from AbstractEditPart that also traces edit policies
- * that created particular commands.
- */
- public static Command getCommand(EditPolicyIterator editPolicies, Request request, Map sources) {
- Command command = null;
- while (editPolicies.hasNext()) {
- EditPolicy nextPolicy = editPolicies.next();
- Command nextCommand = nextPolicy.getCommand(request);
- if (nextCommand != null) {
- sources.put(nextCommand, nextPolicy);
- }
- command = command == null ? nextCommand : command.chain(nextCommand);
- }
- return command;
- }
-
- protected IFigure createFigure() {
- return null;
- }
-
- protected void createEditPolicies() {}
- }
-}

Back to the top