From f10acfb151e9cb6e933d67cec4b545c4f155d886 Mon Sep 17 00:00:00 2001
From: Patrick Ziegler <ziegler.patrick@hotmail.de>
Date: Fri, 3 Apr 2026 16:00:33 +0200
Subject: [PATCH] [GEF] Mark our TreeEditPart copy as for-removal

This marks our copy as "for removal" and updates all references to work
on the GEF interface instead.
---
 .../eclipse/wb/core/gefTree/part/JavaEditPart.java |  5 +++--
 .../core/gefTree/part/ArrayObjectEditPart.java     |  4 ++--
 .../gefTree/part/FlowContainerGroupEditPart.java   |  3 ++-
 .../eclipse/wb/gef/tree/DesignTreeEditPart.java    |  1 +
 .../org/eclipse/wb/gef/tree/TreeEditPart.java      |  3 +++
 .../wb/gef/tree/policies/LayoutEditPolicy.java     |  4 ++--
 .../eclipse/wb/internal/gef/tree/RootEditPart.java |  2 +-
 .../eclipse/wb/internal/gef/tree/TreeViewer.java   |  4 ++--
 .../gef/tree/policies/AutoExpandEditPolicy.java    |  4 ++--
 .../wb/core/gefTree/part/ObjectEditPart.java       |  2 +-
 .../core/gefTree/part/menu/MenuEditPart.java       |  3 ++-
 .../core/gefTree/part/menu/MenuItemEditPart.java   |  3 ++-
 .../model/generic/FlowContainerGroupGefTest.java   |  5 +++--
 .../eclipse/wb/tests/gef/TreeCreateToolTest.java   |  4 ++--
 .../org/eclipse/wb/tests/gef/TreeDragToolTest.java |  4 ++--
 .../src/org/eclipse/wb/tests/gef/TreeRobot.java    | 14 +++++++-------
 .../src/org/eclipse/wb/tests/gef/TreeToolTest.java |  9 +++++----
 17 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/core/gefTree/part/JavaEditPart.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/core/gefTree/part/JavaEditPart.java
index 25d38efd12..89ea2491ff 100644
--- a/org.eclipse.wb.core.java/src/org/eclipse/wb/core/gefTree/part/JavaEditPart.java
+++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/core/gefTree/part/JavaEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 Google, Inc.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -13,9 +13,10 @@
 package org.eclipse.wb.core.gefTree.part;
 
 import org.eclipse.wb.core.model.JavaInfo;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.gefTree.policy.dblclick.DoubleClickLayoutEditPolicy;
 
+import org.eclipse.gef.TreeEditPart;
+
 /**
  * {@link TreeEditPart} for {@link JavaInfo}.
  *
diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/ArrayObjectEditPart.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/ArrayObjectEditPart.java
index 253399edb5..f467edd56c 100644
--- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/ArrayObjectEditPart.java
+++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/ArrayObjectEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2025 Google, Inc. and others.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -13,11 +13,11 @@
 package org.eclipse.wb.internal.core.gefTree.part;
 
 import org.eclipse.wb.core.gefTree.part.ObjectEditPart;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.gefTree.policy.ArrayObjectLayoutEditPolicy;
 import org.eclipse.wb.internal.core.model.nonvisual.AbstractArrayObjectInfo;
 
 import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.TreeEditPart;
 
 /**
  * {@link TreeEditPart} for {@link AbstractArrayObjectInfo}.
diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/FlowContainerGroupEditPart.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/FlowContainerGroupEditPart.java
index 495c40a7c4..f216f53500 100644
--- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/FlowContainerGroupEditPart.java
+++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/gefTree/part/FlowContainerGroupEditPart.java
@@ -13,11 +13,12 @@
 package org.eclipse.wb.internal.core.gefTree.part;
 
 import org.eclipse.wb.core.gefTree.part.ObjectEditPart;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.gefTree.policy.generic.FlowContainerLayoutEditPolicy;
 import org.eclipse.wb.internal.core.model.generic.FlowContainerConfigurable;
 import org.eclipse.wb.internal.core.model.nonvisual.FlowContainerGroupInfo;
 
+import org.eclipse.gef.TreeEditPart;
+
 import java.util.List;
 
 /**
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/DesignTreeEditPart.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/DesignTreeEditPart.java
index 71e978079f..0259615d5d 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/DesignTreeEditPart.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/DesignTreeEditPart.java
@@ -28,6 +28,7 @@
  *
  * @see {@link RequestProcessor}
  */
+@SuppressWarnings("removal")
 public abstract class DesignTreeEditPart extends TreeEditPart {
 
 	////////////////////////////////////////////////////////////////////////////
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/TreeEditPart.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/TreeEditPart.java
index 9cd70489b6..5210882d9f 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/TreeEditPart.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/TreeEditPart.java
@@ -28,8 +28,11 @@
 /**
  * @author lobas_av
  * @coverage gef.tree
+ * @deprecated Cast to {@link org.eclipse.gef.TreeEditPart TreeEditPart}
+ *             directly or extend {@link AbstractTreeEditPart}.
  */
 @SuppressWarnings("removal")
+@Deprecated(forRemoval = true, since = "2026-06")
 public abstract class TreeEditPart extends org.eclipse.wb.gef.core.EditPart implements org.eclipse.gef.TreeEditPart {
 	private TreeItem m_widget;
 	private boolean m_expandedShouldRestore;
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/policies/LayoutEditPolicy.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/policies/LayoutEditPolicy.java
index 883a59b68c..2d6593431e 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/policies/LayoutEditPolicy.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/tree/policies/LayoutEditPolicy.java
@@ -17,7 +17,6 @@
 import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
 import org.eclipse.wb.gef.core.requests.CreateRequest;
 import org.eclipse.wb.gef.core.requests.PasteRequest;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.EnvironmentUtils;
 import org.eclipse.wb.internal.gef.tree.TreeViewer;
 
@@ -27,6 +26,7 @@
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.editpolicies.AbstractEditPolicy;
 import org.eclipse.gef.requests.DropRequest;
@@ -71,7 +71,7 @@ public TreeEditPart getHost() {
 	 * Convenience method to return the host's {@link TreeItem}.
 	 */
 	protected final TreeItem getHostWidget() {
-		return getHost().getWidget();
+		return (TreeItem) getHost().getWidget();
 	}
 
 	/**
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/RootEditPart.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/RootEditPart.java
index 71f8691732..c2cc6ec9d7 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/RootEditPart.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/RootEditPart.java
@@ -14,10 +14,10 @@
 
 import org.eclipse.wb.gef.core.IEditPartViewer;
 import org.eclipse.wb.gef.tree.DesignTreeEditPart;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/TreeViewer.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/TreeViewer.java
index 5c3596f010..063993f41e 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/TreeViewer.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/TreeViewer.java
@@ -12,12 +12,12 @@
  *******************************************************************************/
 package org.eclipse.wb.internal.gef.tree;
 
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.gef.core.AbstractEditPartViewer;
 
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.gef.EditDomain;
 import org.eclipse.gef.EditPart;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -156,7 +156,7 @@ public void setSelectionToTreeWidget() {
 		List<TreeItem> treeItems = new ArrayList<>();
 		for (EditPart editPart : getSelectedEditParts()) {
 			TreeEditPart treeEditPart = (TreeEditPart) editPart;
-			treeItems.add(treeEditPart.getWidget());
+			treeItems.add((TreeItem) treeEditPart.getWidget());
 		}
 		// set selection in tree
 		m_tree.setSelection(treeItems.toArray(new TreeItem[treeItems.size()]));
diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/policies/AutoExpandEditPolicy.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/policies/AutoExpandEditPolicy.java
index 0eadbc0d60..5b90e81b21 100644
--- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/policies/AutoExpandEditPolicy.java
+++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/policies/AutoExpandEditPolicy.java
@@ -14,7 +14,6 @@
 
 import org.eclipse.wb.core.gef.policy.PolicyUtils;
 import org.eclipse.wb.gef.core.requests.PasteRequest;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.gef.tree.TreeViewer;
 
 import org.eclipse.draw2d.geometry.Point;
@@ -22,6 +21,7 @@
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.gef.editpolicies.AbstractEditPolicy;
 import org.eclipse.gef.requests.DropRequest;
 import org.eclipse.swt.widgets.Tree;
@@ -48,7 +48,7 @@ public EditPart getTargetEditPart(Request request) {
 		}
 		// prepare host widget
 		final TreeEditPart host = (TreeEditPart) getHost();
-		final TreeItem hostWidget = host.getWidget();
+		final TreeItem hostWidget = (TreeItem) host.getWidget();
 		final Tree tree = hostWidget.getParent();
 		// prepare target widget
 		TreeItem targetWidget;
diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/core/gefTree/part/ObjectEditPart.java b/org.eclipse.wb.core/src/org/eclipse/wb/core/gefTree/part/ObjectEditPart.java
index 1fd12fb553..2d0ca8d91c 100644
--- a/org.eclipse.wb.core/src/org/eclipse/wb/core/gefTree/part/ObjectEditPart.java
+++ b/org.eclipse.wb.core/src/org/eclipse/wb/core/gefTree/part/ObjectEditPart.java
@@ -17,7 +17,6 @@
 import org.eclipse.wb.core.model.ObjectInfo;
 import org.eclipse.wb.core.model.broadcast.ObjectEventListener;
 import org.eclipse.wb.gef.tree.DesignTreeEditPart;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;
 import org.eclipse.wb.internal.gef.tree.TreeViewer;
 import org.eclipse.wb.internal.gef.tree.policies.AutoExpandEditPolicy;
@@ -26,6 +25,7 @@
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.SWT;
diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuEditPart.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuEditPart.java
index 4ca2391070..dd8f12d712 100644
--- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuEditPart.java
+++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuEditPart.java
@@ -14,10 +14,11 @@
 
 import org.eclipse.wb.core.gefTree.part.ObjectEditPart;
 import org.eclipse.wb.core.model.ObjectInfo;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.gefTree.policy.menu.MenuLayoutEditPolicy;
 import org.eclipse.wb.internal.core.model.menu.IMenuInfo;
 
+import org.eclipse.gef.TreeEditPart;
+
 /**
  * {@link TreeEditPart} for {@link IMenuInfo}.
  *
diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuItemEditPart.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuItemEditPart.java
index 5eed13b42c..4a9864eb15 100644
--- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuItemEditPart.java
+++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/gefTree/part/menu/MenuItemEditPart.java
@@ -14,10 +14,11 @@
 
 import org.eclipse.wb.core.gefTree.part.ObjectEditPart;
 import org.eclipse.wb.core.model.ObjectInfo;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.gefTree.policy.menu.MenuItemLayoutEditPolicy;
 import org.eclipse.wb.internal.core.model.menu.IMenuItemInfo;
 
+import org.eclipse.gef.TreeEditPart;
+
 /**
  * {@link TreeEditPart} for {@link IMenuItemInfo}.
  *
diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerGroupGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerGroupGefTest.java
index 12bf6ff496..fa195899b6 100644
--- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerGroupGefTest.java
+++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerGroupGefTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2025 Google, Inc. and others.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -13,11 +13,12 @@
 package org.eclipse.wb.tests.designer.core.model.generic;
 
 import org.eclipse.wb.core.gef.policy.layout.ILayoutEditPolicyFactory;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.model.nonvisual.FlowContainerGroupInfo;
 import org.eclipse.wb.internal.swing.model.component.ComponentInfo;
 import org.eclipse.wb.internal.swing.model.component.ContainerInfo;
 
+import org.eclipse.gef.TreeEditPart;
+
 import org.junit.jupiter.api.Test;
 
 /**
diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeCreateToolTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeCreateToolTest.java
index a11bc34db7..9a133389fa 100644
--- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeCreateToolTest.java
+++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeCreateToolTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2025 Google, Inc. and others.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -14,9 +14,9 @@
 
 import org.eclipse.wb.gef.core.requests.ICreationFactory;
 import org.eclipse.wb.gef.core.tools.CreationTool;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 
 import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.TreeEditPart;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeDragToolTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeDragToolTest.java
index 735777d28f..b432fcb23a 100644
--- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeDragToolTest.java
+++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeDragToolTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2025 Google, Inc. and others.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -13,10 +13,10 @@
 package org.eclipse.wb.tests.gef;
 
 import org.eclipse.wb.gef.graphical.tools.SelectionTool;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;
 
 import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTarget;
 import org.eclipse.swt.widgets.Display;
diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeRobot.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeRobot.java
index 34920ddd21..e232717c3d 100644
--- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeRobot.java
+++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeRobot.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2025 Google, Inc. and others.
+ * Copyright (c) 2011, 2026 Google, Inc. and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -15,7 +15,6 @@
 import org.eclipse.wb.core.model.ObjectInfo;
 import org.eclipse.wb.gef.core.tools.Tool;
 import org.eclipse.wb.gef.graphical.tools.SelectionTool;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;
 import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;
 import org.eclipse.wb.internal.core.utils.ui.UiUtils;
@@ -25,6 +24,7 @@
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.gef.EditPart;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.dnd.DND;
@@ -183,7 +183,7 @@ private Command getDragCommand() {
 	}
 
 	private Event createDNDEvent(TreeEditPart dragPart, Point locationInTree) {
-		Tree tree = dragPart.getWidget().getParent();
+		Tree tree = ((TreeItem) dragPart.getWidget()).getParent();
 		// create DNDEvent
 		Event event = createDNDEvent();
 		// configure event
@@ -308,7 +308,7 @@ public TreeEditPart[] getEditParts(Object[] models) {
 	public void setExpanded(TreeEditPart editPart, boolean expanded) {
 		TreeEditPart parentEditPart = (TreeEditPart) editPart.getParent();
 		if (parentEditPart != null) {
-			TreeItem widget = parentEditPart.getWidget();
+			TreeItem widget = (TreeItem) parentEditPart.getWidget();
 			if (expanded) {
 				setExpanded(parentEditPart, expanded);
 				if (widget != null) {
@@ -387,7 +387,7 @@ public Point getLocationAfter(Object object) {
 	 * @return bounds of given {@link EditPart} in {@link Tree}.
 	 */
 	public static Rectangle getBounds(TreeEditPart editPart) {
-		TreeItem widget = editPart.getWidget();
+		TreeItem widget = (TreeItem) editPart.getWidget();
 		return new Rectangle(widget.getBounds());
 	}
 
@@ -494,14 +494,14 @@ public TreeRobot assertFeedback_empty() {
 	public TreeRobot assertFeedback_on(Object object) {
 		TreeEditPart editPart = getEditPart(object);
 		List<TreeItem> selectedItems = getFeedbackSelection();
-		Assertions.assertThat(selectedItems).containsOnly(editPart.getWidget());
+		Assertions.assertThat(selectedItems).containsOnly((TreeItem) editPart.getWidget());
 		return this;
 	}
 
 	public TreeRobot assertFeedback_notOn(Object object) {
 		TreeEditPart editPart = getEditPart(object);
 		List<TreeItem> selectedItems = getFeedbackSelection();
-		Assertions.assertThat(selectedItems).doesNotContain(editPart.getWidget());
+		Assertions.assertThat(selectedItems).doesNotContain((TreeItem) editPart.getWidget());
 		return this;
 	}
 
diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeToolTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeToolTest.java
index a011d49aa6..8ba3fe3e6a 100644
--- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeToolTest.java
+++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/TreeToolTest.java
@@ -15,7 +15,6 @@
 import org.eclipse.wb.gef.core.requests.PasteRequest;
 import org.eclipse.wb.gef.core.tools.Tool;
 import org.eclipse.wb.gef.tree.DesignTreeEditPart;
-import org.eclipse.wb.gef.tree.TreeEditPart;
 import org.eclipse.wb.gef.tree.policies.LayoutEditPolicy;
 import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;
 import org.eclipse.wb.internal.core.utils.ui.UiUtils;
@@ -27,10 +26,12 @@
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.Request;
+import org.eclipse.gef.TreeEditPart;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.requests.SelectionRequest;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TreeItem;
 
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
@@ -92,7 +93,7 @@ public void tearDown() throws Exception {
 	 * @return <code>(x + width / 2, y + 1)</code> location of part tree item bounds.
 	 */
 	protected static final Point getBeforeLocation(TreeEditPart part) {
-		Rectangle bounds = new Rectangle(part.getWidget().getBounds());
+		Rectangle bounds = new Rectangle(((TreeItem) part.getWidget()).getBounds());
 		Point location = bounds.getTop();
 		location.y++;
 		return location;
@@ -102,7 +103,7 @@ protected static final Point getBeforeLocation(TreeEditPart part) {
 	 * @return <code>(x + width / 2, y + height / 2)</code> location of part tree item bounds.
 	 */
 	protected static final Point getOnLocation(TreeEditPart part) {
-		Rectangle bounds = new Rectangle(part.getWidget().getBounds());
+		Rectangle bounds = new Rectangle(((TreeItem) part.getWidget()).getBounds());
 		return bounds.getCenter();
 	}
 
@@ -110,7 +111,7 @@ protected static final Point getOnLocation(TreeEditPart part) {
 	 * @return <code>(x + width / 2, y + height - 1)</code> location of part tree item bounds.
 	 */
 	protected static final Point getAfterLocation(TreeEditPart part) {
-		Rectangle bounds = new Rectangle(part.getWidget().getBounds());
+		Rectangle bounds = new Rectangle(((TreeItem) part.getWidget()).getBounds());
 		Point location = bounds.getBottom();
 		location.y--;
 		return location;
