-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8b5e8a
commit dc5331b
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
com.epistimis.uddl.ui/src/com/epistimis/uddl/ui/UITools.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* | ||
*/ | ||
package com.epistimis.uddl.ui; | ||
|
||
import org.eclipse.ui.IEditorPart; | ||
import org.eclipse.ui.IEditorReference; | ||
import org.eclipse.ui.PlatformUI; | ||
|
||
/** | ||
* | ||
*/ | ||
public class UITools { | ||
|
||
// See https://stackoverflow.com/questions/9348767/how-to-get-active-editor-in-eclipse-plugin | ||
public static IEditorPart getActiveEditor() { | ||
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); | ||
} | ||
|
||
// See https://stackoverflow.com/questions/9348767/how-to-get-active-editor-in-eclipse-plugin | ||
public static IEditorReference[] allOpenEditors() { | ||
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences(); | ||
} | ||
} |