You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,11 @@
14
14
packageorg.eclipse.swt.widgets;
15
15
16
16
17
-
importorg.eclipse.swt.internal.SWTEventListener;
17
+
importjava.util.*;
18
+
18
19
importorg.eclipse.swt.*;
19
20
importorg.eclipse.swt.events.*;
21
+
importorg.eclipse.swt.internal.*;
20
22
21
23
/**
22
24
* Instances of this class are <em>internal SWT implementation</em>
@@ -40,7 +42,7 @@ public class TypedListener implements Listener {
40
42
/**
41
43
* The receiver's event listener
42
44
*/
43
-
protectedSWTEventListenereventListener;
45
+
protectedEventListenereventListener;
44
46
45
47
/**
46
48
* Constructs a new instance of this class for the given event listener.
@@ -59,6 +61,10 @@ public TypedListener (SWTEventListener listener) {
59
61
eventListener = listener;
60
62
}
61
63
64
+
TypedListener (EventListenerlistener) {
65
+
eventListener = listener;
66
+
}
67
+
62
68
/**
63
69
* Returns the receiver's event listener.
64
70
* <p>
@@ -73,7 +79,11 @@ public TypedListener (SWTEventListener listener) {
73
79
* @noreference This method is not intended to be referenced by clients.
74
80
*/
75
81
publicSWTEventListenergetEventListener () {
76
-
returneventListener;
82
+
// At the moment all typed listeners implement SWTEventListener but that interface is intended to be removed in the future and then they will only implement EventListener.
83
+
// This method should not be called for typed listeners listeners that only implement EventListener.
84
+
// This is only relevant for custom typed listeners that implement EventListener directly before SWTEventListener is eventually removed.
85
+
// But then the new Widget.getTypedListener() method can be used.
0 commit comments