Skip to content

Commit c197fd6

Browse files
committed
Fix: use IWorkbenchWindow/IWorkbenchPage, add copyright headers
1 parent ca0a8c1 commit c197fd6

20 files changed

+34
-81
lines changed

tests/org.eclipse.ui.tests.dnd/.project

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/DetachedDropTarget.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
*******************************************************************************/
14+
1415
package org.eclipse.ui.tests.dnd;
1516

1617
import org.eclipse.swt.graphics.Point;

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/DragDropPerspectiveFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import org.eclipse.ui.IPerspectiveFactory;
66
import org.eclipse.ui.IPlaceholderFolderLayout;
77

8-
/**
9-
* @since 3.0
10-
*/
118
public class DragDropPerspectiveFactory implements IPerspectiveFactory {
129

1310
// Id's needed by the 'Detached Window' Drag / Drop tests

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/DragOperations.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
import org.eclipse.ui.IWorkbenchPartReference;
1212
import org.junit.Assert;
1313

14-
/**
15-
* @since 3.0
16-
*/
1714
public class DragOperations {
1815

1916
/**

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/DragTest.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Ali Muhsin KÖKSAL.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License 2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* Contributors:
9+
* Ali Muhsin KÖKSAL - initial API and implementation
10+
*******************************************************************************/
11+
112
package org.eclipse.ui.tests.dnd;
213

314
import org.eclipse.core.resources.IFile;
@@ -6,9 +17,10 @@
617
import org.eclipse.swt.widgets.Display;
718
import org.eclipse.swt.widgets.Shell;
819
import org.eclipse.ui.IEditorPart;
20+
import org.eclipse.ui.IWorkbenchPage;
21+
import org.eclipse.ui.IWorkbenchWindow;
922
import org.eclipse.ui.PlatformUI;
1023
import org.eclipse.ui.internal.WorkbenchPage;
11-
import org.eclipse.ui.internal.WorkbenchWindow;
1224
import org.eclipse.ui.part.FileEditorInput;
1325
import org.eclipse.ui.tests.api.MockEditorPart;
1426
import org.eclipse.ui.tests.harness.util.FileUtil;
@@ -26,8 +38,8 @@ public class DragTest {
2638

2739
IEditorPart editor1, editor2, editor3;
2840

29-
static WorkbenchWindow window;
30-
static WorkbenchPage page;
41+
static IWorkbenchWindow window;
42+
static IWorkbenchPage page;
3143

3244
public DragTest(TestDragSource dragSource, TestDropLocation dropTarget) {
3345
this.dragSource = dragSource;
@@ -37,8 +49,8 @@ public DragTest(TestDragSource dragSource, TestDropLocation dropTarget) {
3749
@AfterEach
3850
public void doSetUp() throws Exception {
3951
if (window == null) {
40-
window = (WorkbenchWindow) PlatformUI.getWorkbench();
41-
page = (WorkbenchPage) window.getActivePage();
52+
window = (IWorkbenchWindow) PlatformUI.getWorkbench();
53+
page = (IWorkbenchPage) window.getActivePage();
4254

4355
project = FileUtil.createProject("DragTest");
4456
file1 = FileUtil.createFile("DragTest1.txt", project);
@@ -86,10 +98,10 @@ public void stallTest() {
8698
}
8799
}
88100
}
89-
90-
@Test
101+
102+
@Test
91103
public void performTest() throws Throwable {
92-
dragSource.setPage(page);
104+
dragSource.setPage((WorkbenchPage) page);
93105
dragSource.drag(dropTarget);
94106
}
95107
}

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/DragTestSuite.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Ali Muhsin KÖKSAL.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License 2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* Contributors:
9+
* Ali Muhsin KÖKSAL - initial API and implementation
10+
*******************************************************************************/
11+
112
package org.eclipse.ui.tests.dnd;
213

314
import org.eclipse.swt.SWT;
@@ -189,7 +200,7 @@ private void addAllCombinations(TestDragSource dragSource,
189200
continue;
190201
}
191202

192-
DragTest newTest = new DragTest(dragSource, dropTarget);
203+
new DragTest(dragSource, dropTarget);
193204
}
194205
}
195206

@@ -199,7 +210,7 @@ private void addAllCombinationsDetached(TestDragSource dragSource,
199210

200211
if (isDetachingSupported) {
201212
for (TestDropLocation dropTarget : dropTargets) {
202-
DragTest newTest = new DetachedWindowDragTest(dragSource, dropTarget);
213+
new DetachedWindowDragTest(dragSource, dropTarget);
203214
}
204215
}
205216
}

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/EditorAreaDropTarget.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import org.eclipse.swt.graphics.Point;
44

5-
/**
6-
* @since 3.0
7-
*/
85
public class EditorAreaDropTarget extends WorkbenchWindowDropTarget {
96
int side;
107

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/EditorDragSource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import org.eclipse.ui.IEditorPart;
44

5-
/**
6-
* @since 3.0
7-
*/
85
public class EditorDragSource extends TestDragSource {
96

107
int editorIdx;

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/EditorDropTarget.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import org.eclipse.swt.widgets.Shell;
55
import org.eclipse.ui.IEditorPart;
66

7-
/**
8-
* @since 3.0
9-
*/
107
public class EditorDropTarget extends WorkbenchWindowDropTarget {
118

129
int editorIdx;

tests/org.eclipse.ui.tests.dnd/src/org/eclipse/ui/tests/dnd/EditorTabDropTarget.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import org.eclipse.swt.widgets.Shell;
66
import org.eclipse.ui.IEditorPart;
77

8-
/**
9-
* @since 3.0
10-
*/
118
public class EditorTabDropTarget extends WorkbenchWindowDropTarget {
129

1310
int editorIdx;

0 commit comments

Comments
 (0)