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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
void
static IEditorPart
static IProject
static ResourceSet
static IEditorPart
getLastEditor
(String editorId) protected void
initialize
(IWorkbenchWindow window) void
pageActivated
(IWorkbenchPage page) void
pageClosed
(IWorkbenchPage page) void
pageOpened
(IWorkbenchPage page) void
partActivated
(IWorkbenchPart part) void
void
partClosed
(IWorkbenchPart part) void
void
partOpened
(IWorkbenchPart part) void
windowActivated
(IWorkbenchWindow window) void
windowClosed
(IWorkbenchWindow window) void
windowDeactivated
(IWorkbenchWindow window) void
windowOpened
(IWorkbenchWindow window)
-
Constructor Details
-
ActiveEditorTracker
public ActiveEditorTracker()
-
-
Method Details
-
earlyStartup
public void earlyStartup()- Specified by:
earlyStartup
in 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:
pageActivated
in interfaceIPageListener
-
pageClosed
- Specified by:
pageClosed
in interfaceIPageListener
-
pageOpened
- Specified by:
pageOpened
in interfaceIPageListener
-
partActivated
- Specified by:
partActivated
in interfaceIPartListener
-
partBroughtToTop
- Specified by:
partBroughtToTop
in interfaceIPartListener
-
partClosed
- Specified by:
partClosed
in interfaceIPartListener
-
partDeactivated
- Specified by:
partDeactivated
in interfaceIPartListener
-
getActivePage
-
partOpened
- Specified by:
partOpened
in interfaceIPartListener
-
dispose
public void dispose() -
windowActivated
- Specified by:
windowActivated
in interfaceIWindowListener
-
initialize
-
windowDeactivated
- Specified by:
windowDeactivated
in interfaceIWindowListener
-
windowClosed
- Specified by:
windowClosed
in interfaceIWindowListener
-
windowOpened
- Specified by:
windowOpened
in interfaceIWindowListener
-