Skip to content

Commit

Permalink
General UI Tools - not yet used
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-hickman-epistimis committed Jan 4, 2024
1 parent d8b5e8a commit dc5331b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions com.epistimis.uddl.ui/src/com/epistimis/uddl/ui/UITools.java
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();
}
}

0 comments on commit dc5331b

Please sign in to comment.