1 11 package org.eclipse.jdt.internal.ui.workingsets; 12 13 import org.eclipse.ui.IEditorPart; 14 import org.eclipse.ui.IPageListener; 15 import org.eclipse.ui.IPartListener; 16 import org.eclipse.ui.IWindowListener; 17 import org.eclipse.ui.IWorkbenchPage; 18 import org.eclipse.ui.IWorkbenchPart; 19 import org.eclipse.ui.IWorkbenchWindow; 20 21 22 public abstract class EditorTracker implements IWindowListener, IPageListener, IPartListener { 23 24 26 public void windowActivated(IWorkbenchWindow window) { 27 } 28 public void windowDeactivated(IWorkbenchWindow window) { 29 } 30 public void windowClosed(IWorkbenchWindow window) { 31 window.removePageListener(this); 32 } 33 public void windowOpened(IWorkbenchWindow window) { 34 window.addPageListener(this); 35 } 36 37 39 public void pageActivated(IWorkbenchPage page) { 40 } 41 public void pageClosed(IWorkbenchPage page) { 42 page.removePartListener(this); 43 } 44 public void pageOpened(IWorkbenchPage page) { 45 page.addPartListener(this); 46 } 47 48 50 public void partActivated(IWorkbenchPart part) { 51 } 52 public void partBroughtToTop(IWorkbenchPart part) { 53 } 54 public void partClosed(IWorkbenchPart part) { 55 if (part instanceof IEditorPart) { 56 editorClosed((IEditorPart)part); 57 } 58 } 59 public void partDeactivated(IWorkbenchPart part) { 60 } 61 public void partOpened(IWorkbenchPart part) { 62 if (part instanceof IEditorPart) { 63 editorOpened((IEditorPart)part); 64 } 65 } 66 67 public abstract void editorOpened(IEditorPart part); 68 69 public abstract void editorClosed(IEditorPart part); 70 71 } 72 | Popular Tags |