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
Do not call addListener in constructors of CCombo and StyledText #2733
The method is not final, which may cause issues if a subclass overrides
it because it ends up being called upon instantiation, when the object
is not fully initialized
Since these 2 classes are not in the same package as other subclasses of
Widget, I had to resort to expanding the functionality in TypedListener.
Fixes#2733
Copy file name to clipboardExpand all lines: bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ public class TypedListener implements Listener {
48
48
/**
49
49
* The receiver's event listener
50
50
*/
51
+
@Deprecated
51
52
protectedEventListenereventListener;
52
53
53
54
/**
@@ -81,7 +82,7 @@ public TypedListener (SWTEventListener listener) {
81
82
*
82
83
* @noreference This method is not intended to be referenced by clients.
83
84
*/
84
-
85
+
@Deprecated
85
86
publicTypedListener (EventListenerlistener) {
86
87
eventListener = listener;
87
88
}
@@ -99,6 +100,7 @@ public TypedListener (EventListener listener) {
99
100
*
100
101
* @noreference This method is not intended to be referenced by clients.
101
102
*/
103
+
@Deprecated
102
104
publicEventListenergetEventListener () {
103
105
// 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.
104
106
// This method should not be called for typed listeners listeners that only implement EventListener.
@@ -120,6 +122,7 @@ public EventListener getEventListener () {
120
122
* @noreference This method is not intended to be referenced by clients.
121
123
*/
122
124
@Override
125
+
@Deprecated
123
126
publicvoidhandleEvent (Evente) {
124
127
switch (e.type) {
125
128
caseSWT.Activate: {
@@ -313,6 +316,10 @@ public void handleEvent (Event e) {
0 commit comments