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 215465 Details for
Bug 379234
Untyped Expand/Collapse listeners are not notified
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]
Fix + updated tests
Bug-379234.patch (text/plain), 5.45 KB, created by
Ivan Furnadjiev
on 2012-05-11 07:16:37 EDT
(
hide
)
Description:
Fix + updated tests
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2012-05-11 07:16:37 EDT
Size:
5.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/internal/widgets/UntypedEventAdapter.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/widgets/UntypedEventAdapter.java,v >retrieving revision 1.44 >diff -u -r1.44 UntypedEventAdapter.java >--- src/org/eclipse/swt/internal/widgets/UntypedEventAdapter.java 14 Nov 2011 23:46:43 -0000 1.44 >+++ src/org/eclipse/swt/internal/widgets/UntypedEventAdapter.java 11 May 2012 11:13:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2011 Innoopract Informationssysteme GmbH and others. >+ * Copyright (c) 2002, 2012 Innoopract Informationssysteme GmbH and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -27,6 +27,7 @@ > SelectionListener, > FocusListener, > TreeListener, >+ ExpandListener, > ShellListener, > MenuListener, > ModifyListener, >@@ -114,6 +115,18 @@ > dispatchEvent( event ); > } > >+ public void itemCollapsed( ExpandEvent typedEvent ) { >+ Event event = createEvent( SWT.Collapse, typedEvent.getSource() ); >+ copyFields( typedEvent, event ); >+ dispatchEvent( event ); >+ } >+ >+ public void itemExpanded( ExpandEvent typedEvent ) { >+ Event event = createEvent( SWT.Expand, typedEvent.getSource() ); >+ copyFields( typedEvent, event ); >+ dispatchEvent( event ); >+ } >+ > public void shellActivated( ShellEvent typedEvent ) { > Event event = createEvent( SWT.Activate, typedEvent.getSource() ); > copyFields( typedEvent, event ); >@@ -272,7 +285,11 @@ > break; > case SWT.Expand: > case SWT.Collapse: >- TreeEvent.addListener( widget, ( TreeListener )this ); >+ if( widget instanceof Tree ) { >+ TreeEvent.addListener( widget, ( TreeListener )this ); >+ } else { >+ ExpandEvent.addListener( widget, ( ExpandListener )this ); >+ } > break; > case SWT.Activate: > case SWT.Deactivate: >@@ -692,6 +709,18 @@ > to.text = from.text; > } > >+ private static void copyFields( ExpandEvent from, Event to ) { >+ copyFields( ( TypedEvent )from, to ); >+ to.detail = from.detail; >+ to.doit = from.doit; >+ to.x = from.x; >+ to.y = from.y; >+ to.height = from.height; >+ to.width = from.width; >+ to.item = from.item; >+ to.text = from.text; >+ } >+ > private static void copyFields( VerifyEvent from, Event to ) { > copyFields( ( TypedEvent )from, to ); > to.start = from.start; >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/internal/widgets/UntypedEventAdapter_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/widgets/UntypedEventAdapter_Test.java,v >retrieving revision 1.22 >diff -u -r1.22 UntypedEventAdapter_Test.java >--- src/org/eclipse/swt/internal/widgets/UntypedEventAdapter_Test.java 4 Dec 2011 19:34:26 -0000 1.22 >+++ src/org/eclipse/swt/internal/widgets/UntypedEventAdapter_Test.java 11 May 2012 11:13:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2011 Innoopract Informationssysteme GmbH and others. >+ * Copyright (c) 2002, 2012 Innoopract Informationssysteme GmbH and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -35,10 +35,11 @@ > private static final String EVENT_FIRED = "fired|"; > private static int eventType; > private static String log; >- >+ > private Display display; > private Control widget; > >+ @Override > protected void setUp() throws Exception { > Fixture.setUp(); > eventType = 0; >@@ -47,6 +48,7 @@ > widget = new Shell( display ); > } > >+ @Override > protected void tearDown() throws Exception { > Fixture.tearDown(); > } >@@ -85,6 +87,12 @@ > adapter.addListener( SWT.Collapse, listener ); > adapter.treeCollapsed( new TreeEvent( widget, null, 0 ) ); > assertEquals( SWT.Collapse, eventType ); >+ adapter.addListener( SWT.Expand, listener ); >+ adapter.itemExpanded( new ExpandEvent( widget, null, 0 ) ); >+ assertEquals( SWT.Expand, eventType ); >+ adapter.addListener( SWT.Collapse, listener ); >+ adapter.itemCollapsed( new ExpandEvent( widget, null, 0 ) ); >+ assertEquals( SWT.Collapse, eventType ); > adapter.addListener( SWT.Activate, listener ); > adapter.shellActivated( new ShellEvent( widget, 0 ) ); > assertEquals( SWT.Activate, eventType ); >@@ -262,13 +270,13 @@ > assertNull( eventLog[ 0 ] ); > widget.removeListener( 505, listener ); > } >- >+ > public void testIsSerializable() throws Exception { > UntypedEventAdapter adapter = new UntypedEventAdapter(); > adapter.addListener( SWT.Move, new SerializableListener() ); >- >+ > UntypedEventAdapter deserializeAdapter = Fixture.serializeAndDeserialize( adapter ); >- >+ > Listener[] listeners = deserializeAdapter.getListeners( SWT.Move ); > assertEquals( 1, listeners.length ); > assertEquals( SerializableListener.class, listeners[ 0 ].getClass() );
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 379234
:
215465
|
215468