Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 231639 Details for
Bug 409309
[Scripting] Add ClientListener using widget#addListener is not always working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
bug-409309.patch (text/plain), 2.48 KB, created by
Ivan Furnadjiev
on 2013-05-28 13:24:08 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2013-05-28 13:24:08 EDT
Size:
2.48 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/clientscripting/ClientScriptingSupport.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/clientscripting/ClientScriptingSupport.java >index 8b7782e..dc1b3d5 100644 >--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/clientscripting/ClientScriptingSupport.java >+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/clientscripting/ClientScriptingSupport.java >@@ -26,7 +26,14 @@ > = "org.eclipse.rap.clientscripting.ClientListener"; > > public static boolean isClientListener( Listener listener ) { >- return CLIENT_LISTENER_CLASS_NAME.equals( listener.getClass().getName() ); >+ Class clazz = listener.getClass(); >+ while( clazz != null ) { >+ if( CLIENT_LISTENER_CLASS_NAME.equals( clazz.getName() ) ) { >+ return true; >+ } >+ clazz = clazz.getSuperclass(); >+ } >+ return false; > } > > public static void addClientListenerTo( Widget widget, int eventType, Listener listener ) { >@@ -54,8 +61,8 @@ > } > > private static Method findMethod( String methodName, Listener listener ) { >- Method[] declaredMethods = listener.getClass().getDeclaredMethods(); >- for( Method method : declaredMethods ) { >+ Method[] methods = listener.getClass().getMethods(); >+ for( Method method : methods ) { > if( hasClientListenerSignature( methodName, method ) ) { > return method; > } >diff --git a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/events/EventLCAUtil_Test.java b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/events/EventLCAUtil_Test.java >index 09aebfe..03e7bdd 100644 >--- a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/events/EventLCAUtil_Test.java >+++ b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/events/EventLCAUtil_Test.java >@@ -176,6 +176,14 @@ > } > > @Test >+ public void testIsListening_withSubclassedClientListenerOnly() { >+ Button button = new Button( shell, SWT.PUSH ); >+ button.addListener( SWT.Selection, new TestClientListener() ); >+ >+ assertFalse( EventLCAUtil.isListening( button, SWT.Selection ) ); >+ } >+ >+ @Test > public void testIsListening_withClientListenerAndSWTListener() { > Button button = new Button( shell, SWT.PUSH ); > button.addListener( SWT.Selection, mock( Listener.class ) ); >@@ -184,4 +192,7 @@ > assertTrue( EventLCAUtil.isListening( button, SWT.Selection ) ); > } > >+ private class TestClientListener extends ClientListener { >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 409309
: 231639