1 19 20 package ca.mcgill.sable.soot.resources; 21 22 import org.eclipse.ui.IEditorPart; 23 import org.eclipse.ui.IWindowListener; 24 import org.eclipse.ui.IWorkbenchWindow; 25 26 import ca.mcgill.sable.soot.SootPlugin; 27 28 public class SootWorkbenchListener implements IWindowListener { 29 30 private boolean initialized = false; 31 34 public void windowActivated(IWorkbenchWindow window) { 35 if (!initialized){ 36 window.getActivePage().addPartListener(new EditorActivationListener()); 37 IEditorPart activeEdPart = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); 38 SootPlugin.getDefault().getPartManager().updatePart(activeEdPart); 39 initialized = true; 40 } 41 42 43 } 44 45 48 public void windowDeactivated(IWorkbenchWindow window) { 49 50 } 51 52 55 public void windowClosed(IWorkbenchWindow window) { 56 57 } 58 59 62 public void windowOpened(IWorkbenchWindow window) { 63 window.getActivePage().addPartListener(new EditorActivationListener()); 64 IEditorPart activeEdPart = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); 65 SootPlugin.getDefault().getPartManager().updatePart(activeEdPart); 66 } 67 68 } 69 | Popular Tags |