Przeglądaj źródła

Removed part listener

Andreas Mülder 11 lat temu
rodzic
commit
deb6a9c0a2

+ 1 - 30
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/model/presenter/SCTSourceDisplay.java

@@ -24,19 +24,15 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
 import org.eclipse.gmf.runtime.notation.Diagram;
 import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartListener;
 import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.FileEditorInput;
 import org.yakindu.sct.simulation.core.engine.ISimulationEngine;
-import org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor;
 import org.yakindu.sct.ui.editor.partitioning.DiagramPartitioningUtil;
 
 import de.itemis.gmf.runtime.commons.highlighting.IHighlightingSupport;
@@ -49,7 +45,7 @@ import de.itemis.gmf.runtime.commons.highlighting.IHighlightingSupport;
  * @author andreas muelder - Initial contribution and API
  * 
  */
-public class SCTSourceDisplay implements ISourceDisplay, IPartListener {
+public class SCTSourceDisplay implements ISourceDisplay {
 
 	private Map<IEditorPart, IDynamicNotationHandler> handler = null;
 	private ISimulationEngine container = null;
@@ -58,7 +54,6 @@ public class SCTSourceDisplay implements ISourceDisplay, IPartListener {
 	public SCTSourceDisplay(ISimulationEngine container) {
 		this.container = container;
 		handler = new HashMap<IEditorPart, IDynamicNotationHandler>();
-		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().addPartListener(this);
 	}
 
 	public void displaySource(Object element, IWorkbenchPage page, boolean forceSourceLookup) {
@@ -93,12 +88,6 @@ public class SCTSourceDisplay implements ISourceDisplay, IPartListener {
 				notationHandler.getHighlightingSupport().releaseEditor();
 		}
 		handler.clear();
-		Display.getDefault().syncExec(new Runnable() {
-
-			public void run() {
-				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().removePartListener(SCTSourceDisplay.this);
-			}
-		});
 	}
 
 	private IEditorPart openEditor(DebugElement debugElement, IWorkbenchPage page) {
@@ -148,22 +137,4 @@ public class SCTSourceDisplay implements ISourceDisplay, IPartListener {
 		// No editor found
 		throw new RuntimeException("No editor found for semantic element " + semanticObject);
 	}
-
-	public void partOpened(IWorkbenchPart part) {
-		if (part instanceof StatechartDiagramEditor && debugElement != null)
-			displaySource((IEditorPart) part);
-	}
-
-	public void partActivated(IWorkbenchPart part) {
-	}
-
-	public void partBroughtToTop(IWorkbenchPart part) {
-	}
-
-	public void partClosed(IWorkbenchPart part) {
-	}
-
-	public void partDeactivated(IWorkbenchPart part) {
-	}
-
 }