Commit aae82e60 authored by Simon Barner's avatar Simon Barner
Browse files

Use WorkbenchUtils to determine active editor

Issue-Ref: 3084
Issue-Url: https://af3-developer.fortiss.org/issues/3084

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 302b0b0d
...@@ -7,7 +7,7 @@ EObjectSelectionUtils.java 928280b5dd3bb634debc1ac3be9f15b4e45f2683 GREEN ...@@ -7,7 +7,7 @@ EObjectSelectionUtils.java 928280b5dd3bb634debc1ac3be9f15b4e45f2683 GREEN
KernelUIUtils.java b038a28a44e17e5bca4d71f5dee70ee92e5324b9 GREEN KernelUIUtils.java b038a28a44e17e5bca4d71f5dee70ee92e5324b9 GREEN
ObservableUtils.java 2ffced494a86bd7e8f8eb8882aec38b06f0f2818 GREEN ObservableUtils.java 2ffced494a86bd7e8f8eb8882aec38b06f0f2818 GREEN
PropertiesConstantUtils.java 59b1a1e4d594bb98db3aa396f2ff6474ba405920 GREEN PropertiesConstantUtils.java 59b1a1e4d594bb98db3aa396f2ff6474ba405920 GREEN
SelectionUtils.java d685e3707dfc6ca2fdc10be3bb3a2bc031b7cfe4 GREEN SelectionUtils.java 5ed163fa2111a8b5a5769f276def37e95369b980 YELLOW
TutorialUIServiceUtils.java 416970bb9bd305acee064e2ac199df39cc98b475 GREEN TutorialUIServiceUtils.java 416970bb9bd305acee064e2ac199df39cc98b475 GREEN
UndoRedoImpl.java f218500875bda0ef52f4cc2ccdf452825e6751f7 GREEN UndoRedoImpl.java f218500875bda0ef52f4cc2ccdf452825e6751f7 GREEN
WidgetsFactory.java e92285bee3189ecf1a3fbaede3c4ffb237fc81ed GREEN WidgetsFactory.java e92285bee3189ecf1a3fbaede3c4ffb237fc81ed GREEN
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.util; package org.fortiss.tooling.kernel.ui.util;
import static org.conqat.ide.commons.ui.ui.WorkbenchUtils.getActiveEditor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -25,9 +27,6 @@ import org.eclipse.jface.viewers.IStructuredSelection; ...@@ -25,9 +27,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite; import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/** /**
* Utility methods for dealing with selections. * Utility methods for dealing with selections.
...@@ -122,18 +121,7 @@ public class SelectionUtils { ...@@ -122,18 +121,7 @@ public class SelectionUtils {
* {@link EObject}s to be selected. * {@link EObject}s to be selected.
*/ */
public static void setSelection(List<EObject> eObjects) { public static void setSelection(List<EObject> eObjects) {
IWorkbenchWindow activeWorkbenchWindow = IEditorPart activeEditor = getActiveEditor();
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if(activeWorkbenchWindow == null) {
return;
}
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if(activePage == null) {
return;
}
IEditorPart activeEditor = activePage.getActiveEditor();
if(activeEditor == null) { if(activeEditor == null) {
return; return;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment