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 192469 Details for
Bug 340736
RWT Dialog setDefaultButton is not recognized properly
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]
Proposed fix
Bug-340736.patch (text/plain), 4.11 KB, created by
Ivan Furnadjiev
on 2011-04-04 11:17:04 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2011-04-04 11:17:04 EDT
Size:
4.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/Display.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Display.java,v >retrieving revision 1.121 >diff -u -r1.121 Display.java >--- src/org/eclipse/swt/widgets/Display.java 14 Mar 2011 10:11:20 -0000 1.121 >+++ src/org/eclipse/swt/widgets/Display.java 4 Apr 2011 15:11:44 -0000 >@@ -275,18 +275,18 @@ > return focusControl; > } > >- private void setFocusControl( final Control focusControl ) { >+ private void setFocusControl( Control focusControl ) { > if( this.focusControl != focusControl ) { > if( this.focusControl != null && !this.focusControl.isInDispose() ) { >- FocusEvent event >- = new FocusEvent( this.focusControl, FocusEvent.FOCUS_LOST ); >+ FocusEvent event = new FocusEvent( this.focusControl, FocusEvent.FOCUS_LOST ); > event.processEvent(); >+ this.focusControl.getShell().updateDefaultButton( this.focusControl, false ); > } > this.focusControl = focusControl; > if( this.focusControl != null ) { >- FocusEvent event >- = new FocusEvent( this.focusControl, FocusEvent.FOCUS_GAINED ); >+ FocusEvent event = new FocusEvent( this.focusControl, FocusEvent.FOCUS_GAINED ); > event.processEvent(); >+ this.focusControl.getShell().updateDefaultButton( this.focusControl, true ); > } > } > } >Index: src/org/eclipse/swt/widgets/Shell.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Shell.java,v >retrieving revision 1.71 >diff -u -r1.71 Shell.java >--- src/org/eclipse/swt/widgets/Shell.java 4 Apr 2011 09:14:07 -0000 1.71 >+++ src/org/eclipse/swt/widgets/Shell.java 4 Apr 2011 15:11:44 -0000 >@@ -842,6 +842,17 @@ > } > } > >+ void updateDefaultButton( Control focusControl, boolean set ) { >+ if( focusControl instanceof Button && ( focusControl.getStyle() & SWT.PUSH ) != 0 ) { >+ Button defaultButton = ( Button )focusControl; >+ if( set ) { >+ focusControl.getShell().setDefaultButton( defaultButton, false ); >+ } else { >+ focusControl.getShell().setDefaultButton( null, false ); >+ } >+ } >+ } >+ > /** > * Returns the receiver's default button if one had > * previously been set, otherwise returns null. >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Shell_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Shell_Test.java,v >retrieving revision 1.33 >diff -u -r1.33 Shell_Test.java >--- src/org/eclipse/swt/widgets/Shell_Test.java 4 Apr 2011 09:14:06 -0000 1.33 >+++ src/org/eclipse/swt/widgets/Shell_Test.java 4 Apr 2011 15:11:45 -0000 >@@ -333,6 +333,38 @@ > assertNull( shell.getDefaultButton() ); > } > >+ public void testSetDefaultButtonOnFocus() { >+ shell.open(); >+ assertNull( shell.getDefaultButton() ); >+ Button button = new Button( shell, SWT.PUSH ); >+ Combo combo = new Combo( shell, SWT.NONE ); >+ button.setFocus(); >+ assertSame( button, shell.getDefaultButton() ); >+ combo.setFocus(); >+ assertNull( shell.getDefaultButton() ); >+ } >+ >+ public void testSetDefaultButtonOnFocus_EventOrder() { >+ final ArrayList log = new ArrayList(); >+ shell.open(); >+ assertNull( shell.getDefaultButton() ); >+ Button button = new Button( shell, SWT.PUSH ); >+ Combo combo = new Combo( shell, SWT.NONE ); >+ button.addFocusListener( new FocusListener() { >+ public void focusGained( FocusEvent e ) { >+ log.add( shell.getDefaultButton() ); >+ } >+ public void focusLost( FocusEvent e ) { >+ log.add( shell.getDefaultButton() ); >+ } >+ } ); >+ button.setFocus(); >+ combo.setFocus(); >+ assertEquals( 2, log.size() ); >+ assertNull( log.get( 0 ) ); >+ assertSame( button, log.get( 1 ) ); >+ } >+ > public void testForceActive() { > Shell secondShell = new Shell( display ); > shell.open();
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 340736
:
191738
| 192469