Skip to content

Commit

Permalink
bugfix in isOpenClassEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
jpstotz authored and nbauma109 committed Mar 30, 2024
1 parent c2e6922 commit 76d5b17
Showing 1 changed file with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,9 @@ public static IWorkbenchPart getActiveEditor(boolean activePageOnly) {
return activePart;
}
} else {
IWorkbenchPage[] pgs = window.getPages();

for (int i = 0; i < pgs.length; i++) {
IWorkbenchPage pg = pgs[i];

for (IWorkbenchPage pg : window.getPages()) {
if (pg != null) {
IWorkbenchPart part = pg.getActivePart();

if (part != null) {
return part;
}
Expand All @@ -222,16 +217,18 @@ public static boolean isOpenClassEditor() {
if (windows != null) {
for (int i = 0; i < windows.length; i++) {
IWorkbenchWindow window = windows[i];
IWorkbenchPage[] pgs = window.getPages();
for (int j = 0; j < pgs.length; j++) {
IWorkbenchPage pg = pgs[j];
if (pg != null) {
IEditorPart[] parts = pg.getEditors();
if (parts != null) {
for (int k = 0; k < parts.length; k++) {
if (parts[i] instanceof JavaDecompilerClassFileEditor)
return true;
}
for (IWorkbenchPage pg : window.getPages()) {
if (pg == null) {
continue;
}
// Deprecated since ?? use getEditorReferences() instead
IEditorPart[] editorParts = pg.getEditors();
if (editorParts == null) {
continue;
}
for (IEditorPart part : editorParts) {
if (part instanceof JavaDecompilerClassFileEditor) {
return true;
}
}
}
Expand Down

0 comments on commit 76d5b17

Please sign in to comment.