Skip to content

Commit cf4f3d5

Browse files
committed
Use MultiPageEditorPart for getting active editor
1 parent e365828 commit cf4f3d5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ClipboardCompare.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
import org.eclipse.ui.IWorkbenchPage;
4747
import org.eclipse.ui.IWorkbenchPart;
4848
import org.eclipse.ui.PlatformUI;
49-
import org.eclipse.ui.forms.editor.FormEditor;
49+
import org.eclipse.ui.part.EditorPart;
50+
import org.eclipse.ui.part.MultiPageEditorPart;
5051
import org.eclipse.ui.texteditor.ITextEditor;
5152

5253
public class ClipboardCompare extends BaseCompareAction implements IObjectActionDelegate {
@@ -102,8 +103,11 @@ private void processComparison(Shell parentShell) throws IOException, CoreExcept
102103
return;
103104
}
104105
final String selectionContents;
105-
if (editor instanceof FormEditor fromEditor) {
106-
editor = fromEditor.getActiveEditor();
106+
if (editor instanceof MultiPageEditorPart mpe) {
107+
Object page2 = mpe.getSelectedPage();
108+
if (page2 instanceof EditorPart e) {
109+
editor = e;
110+
}
107111
}
108112
if (editor instanceof ITextEditor txtEditor) {
109113
ISelection selection = txtEditor.getSelectionProvider().getSelection();

0 commit comments

Comments
 (0)