11/*******************************************************************************
2- * Copyright (c) 2011, 2023 Google, Inc.
2+ * Copyright (c) 2011, 2026 Google, Inc. and others .
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License 2.0 which is available at
1212 *******************************************************************************/
1313package org .eclipse .wb .tests .gef ;
1414
15- import org .eclipse .wb .gef .core .requests .AbstractCreateRequest ;
16- import org .eclipse .wb .gef .core .tools .AbstractCreationTool ;
17-
1815import org .eclipse .draw2d .geometry .Dimension ;
1916import org .eclipse .draw2d .geometry .Point ;
17+ import org .eclipse .gef .Request ;
18+ import org .eclipse .gef .tools .TargetingTool ;
2019
2120import org .junit .jupiter .api .BeforeEach ;
2221import org .junit .jupiter .api .Test ;
2625 *
2726 */
2827public abstract class AbstractCreationToolTest extends RequestTestCase {
29- protected AbstractCreateRequest m_request ;
30- protected AbstractCreationTool m_tool ;
28+ protected Request m_request ;
29+ protected TargetingTool m_tool ;
3130
3231 ////////////////////////////////////////////////////////////////////////////
3332 //
@@ -44,6 +43,10 @@ public void setUp() throws Exception {
4443
4544 protected abstract void configureTestCase ();
4645
46+ protected abstract void setSize (Dimension d );
47+
48+ protected abstract void setLocation (Point p );
49+
4750 ////////////////////////////////////////////////////////////////////////////
4851 //
4952 // Tests
@@ -70,7 +73,7 @@ public void test_Move_DND() throws Exception {
7073 // enter in "editPart"
7174 {
7275 m_sender .moveTo (60 , 60 );
73- m_request . setLocation (new Point (60 , 60 ));
76+ setLocation (new Point (60 , 60 ));
7477 //
7578 expectedLogger .log (editPart , new String []{
7679 "getTargetEditPart" ,
@@ -83,7 +86,7 @@ public void test_Move_DND() throws Exception {
8386 // exit from "editPart" and enter in "childEditPart1"
8487 {
8588 m_sender .moveTo (120 , 120 );
86- m_request . setLocation (new Point (120 , 120 ));
89+ setLocation (new Point (120 , 120 ));
8790 //
8891 expectedLogger .log (
8992 childEditPart1 ,
@@ -100,7 +103,7 @@ public void test_Move_DND() throws Exception {
100103 {
101104 m_sender .moveTo (130 , 130 );
102105 //
103- m_request . setLocation (new Point (130 , 130 ));
106+ setLocation (new Point (130 , 130 ));
104107 //
105108 expectedLogger .log (childEditPart1 , new String []{
106109 "getTargetEditPart" ,
@@ -118,8 +121,8 @@ public void test_Move_DND() throws Exception {
118121 {
119122 m_sender .dragTo (200 , 200 );
120123 //
121- m_request . setLocation (new Point (130 , 130 ));
122- m_request . setSize (new Dimension (70 , 70 ));
124+ setLocation (new Point (130 , 130 ));
125+ setSize (new Dimension (70 , 70 ));
123126 //
124127 expectedLogger .log (
125128 childEditPart1 ,
@@ -129,8 +132,8 @@ public void test_Move_DND() throws Exception {
129132 ////////////////////////////////////////////////////////////////
130133 m_sender .dragTo (330 , 140 );
131134 //
132- m_request . setLocation (new Point (130 , 130 ));
133- m_request . setSize (new Dimension (200 , 10 ));
135+ setLocation (new Point (130 , 130 ));
136+ setSize (new Dimension (200 , 10 ));
134137 //
135138 expectedLogger .log (
136139 childEditPart1 ,
@@ -142,8 +145,8 @@ public void test_Move_DND() throws Exception {
142145 {
143146 m_sender .endDrag ();
144147 //
145- m_request . setLocation (new Point (130 , 130 ));
146- m_request . setSize (new Dimension (200 , 10 ));
148+ setLocation (new Point (130 , 130 ));
149+ setSize (new Dimension (200 , 10 ));
147150 //
148151 expectedLogger .log (childEditPart1 , "eraseTargetFeedback" , m_request );
149152 expectedLogger .log (childEditPart2 , new String []{
@@ -178,7 +181,7 @@ public void test_Move_DND_InvalidInput() throws Exception {
178181 {
179182 m_sender .moveTo (70 , 70 );
180183 //
181- m_request . setLocation (new Point (70 , 70 ));
184+ setLocation (new Point (70 , 70 ));
182185 //
183186 expectedLogger .log (editPart , new String []{
184187 "getTargetEditPart" ,
@@ -192,7 +195,7 @@ public void test_Move_DND_InvalidInput() throws Exception {
192195 {
193196 m_sender .click (70 , 70 , 2 );
194197 //
195- m_request . setLocation (new Point (70 , 70 ));
198+ setLocation (new Point (70 , 70 ));
196199 //
197200 expectedLogger .log (editPart , "eraseTargetFeedback" , m_request );
198201 assertLoggers (expectedLogger , actualLogger );
@@ -207,7 +210,7 @@ public void test_Move_DND_InvalidInput() throws Exception {
207210 m_domain .setActiveTool (m_tool );
208211 m_sender .moveTo (90 , 90 );
209212 //
210- m_request . setLocation (new Point (90 , 90 ));
213+ setLocation (new Point (90 , 90 ));
211214 //
212215 expectedLogger .log (editPart , new String []{
213216 "getTargetEditPart" ,
@@ -226,17 +229,17 @@ public void test_Move_DND_InvalidInput() throws Exception {
226229 {
227230 m_sender .dragTo (100 , 100 );
228231 //
229- m_request . setLocation (new Point (90 , 90 ));
230- m_request . setSize (new Dimension (10 , 10 ));
232+ setLocation (new Point (90 , 90 ));
233+ setSize (new Dimension (10 , 10 ));
231234 //
232235 expectedLogger .log (editPart , new String []{"showTargetFeedback" , "getCommand" }, m_request );
233236 assertLoggers (expectedLogger , actualLogger );
234237 }
235238 // click invalid button during drag process
236239 {
237240 m_sender .click (100 , 100 , 3 );
238- m_request . setLocation (new Point (90 , 90 ));
239- m_request . setSize (new Dimension (10 , 10 ));
241+ setLocation (new Point (90 , 90 ));
242+ setSize (new Dimension (10 , 10 ));
240243 //
241244 expectedLogger .log (editPart , "eraseTargetFeedback" , m_request );
242245 assertLoggers (expectedLogger , actualLogger );
0 commit comments