Class ActiveEditorTracker
java.lang.Object
org.yakindu.base.xtext.utils.jface.viewers.util.ActiveEditorTracker
- All Implemented Interfaces:
IPageListener,IPartListener,IStartup,IWindowListener
public class ActiveEditorTracker
extends Object
implements IPageListener, IPartListener, IStartup, IWindowListener
Get the last active editor in general or of a specific type.
Please note that the ActiveEditorTracker currently only supports one single
workbench window properly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voidstatic IEditorPartstatic IProjectstatic ResourceSetstatic IEditorPartgetLastEditor(String editorId) protected voidinitialize(IWorkbenchWindow window) voidpageActivated(IWorkbenchPage page) voidpageClosed(IWorkbenchPage page) voidpageOpened(IWorkbenchPage page) voidpartActivated(IWorkbenchPart part) voidvoidpartClosed(IWorkbenchPart part) voidvoidpartOpened(IWorkbenchPart part) voidwindowActivated(IWorkbenchWindow window) voidwindowClosed(IWorkbenchWindow window) voidwindowDeactivated(IWorkbenchWindow window) voidwindowOpened(IWorkbenchWindow window)
-
Constructor Details
-
ActiveEditorTracker
public ActiveEditorTracker()
-
-
Method Details
-
earlyStartup
public void earlyStartup()- Specified by:
earlyStartupin interfaceIStartup
-
getLastActiveEditor
- Returns:
- The last active editor in the current active workbench page.
-
getLastEditor
- Returns:
- The last active editor with the given editor ID in the current active workbench page.
-
getLastActiveEditorResourceSet
- Returns:
- The EMF resource set of the last active editor (if it is still open).
-
getLastActiveEditorProject
- Returns:
- The project which contains the file that is open in the last active editor in the current workbench page.
-
pageActivated
- Specified by:
pageActivatedin interfaceIPageListener
-
pageClosed
- Specified by:
pageClosedin interfaceIPageListener
-
pageOpened
- Specified by:
pageOpenedin interfaceIPageListener
-
partActivated
- Specified by:
partActivatedin interfaceIPartListener
-
partBroughtToTop
- Specified by:
partBroughtToTopin interfaceIPartListener
-
partClosed
- Specified by:
partClosedin interfaceIPartListener
-
partDeactivated
- Specified by:
partDeactivatedin interfaceIPartListener
-
getActivePage
-
partOpened
- Specified by:
partOpenedin interfaceIPartListener
-
dispose
public void dispose() -
windowActivated
- Specified by:
windowActivatedin interfaceIWindowListener
-
initialize
-
windowDeactivated
- Specified by:
windowDeactivatedin interfaceIWindowListener
-
windowClosed
- Specified by:
windowClosedin interfaceIWindowListener
-
windowOpened
- Specified by:
windowOpenedin interfaceIWindowListener
-