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 208138 Details for
Bug 365396
IRunnableWithProgress does not correctly reset the focus
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 that fixes the issue
Bug-365396.patch (text/plain), 3.60 KB, created by
Ivan Furnadjiev
on 2011-12-09 03:09:34 EST
(
hide
)
Description:
Patch that fixes the issue
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2011-12-09 03:09:34 EST
Size:
3.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: js/qx/ui/core/Widget.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/js/qx/ui/core/Widget.js,v >retrieving revision 1.9 >diff -u -r1.9 Widget.js >--- js/qx/ui/core/Widget.js 8 Dec 2011 17:18:37 -0000 1.9 >+++ js/qx/ui/core/Widget.js 9 Dec 2011 08:05:43 -0000 >@@ -3201,6 +3201,9 @@ > this.removeState("abandoned"); > this.removeState("pressed"); > } >+ if( this.getFocused() ) { >+ this.setFocused( false ); >+ } > } else { > this.removeState("disabled"); > } >Index: src/org/eclipse/swt/widgets/Control.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Control.java,v >retrieving revision 1.93 >diff -u -r1.93 Control.java >--- src/org/eclipse/swt/widgets/Control.java 19 Nov 2011 12:27:01 -0000 1.93 >+++ src/org/eclipse/swt/widgets/Control.java 9 Dec 2011 08:05:44 -0000 >@@ -329,18 +329,26 @@ > public void setEnabled( boolean enabled ) { > checkWidget(); > /* >- * TODO [rst] handle focus > * Feature in Windows. If the receiver has focus, disabling > * the receiver causes no window to have focus. The fix is > * to assign focus to the first ancestor window that takes > * focus. If no window will take focus, set focus to the > * desktop. > */ >+ Control control = null; >+ boolean fixFocus = false; >+ if( !enabled ) { >+ control = display.getFocusControl(); >+ fixFocus = isFocusAncestor( control ); >+ } > if( enabled ) { > state &= ~DISABLED; > } else { > state |= DISABLED; > } >+ if( fixFocus ) { >+ fixFocus( control ); >+ } > } > > /** >#P org.eclipse.rap.rwt.jstest >Index: js/org/eclipse/rwt/test/tests/WidgetTest.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/WidgetTest.js,v >retrieving revision 1.8 >diff -u -r1.8 WidgetTest.js >--- js/org/eclipse/rwt/test/tests/WidgetTest.js 22 Nov 2011 15:24:54 -0000 1.8 >+++ js/org/eclipse/rwt/test/tests/WidgetTest.js 9 Dec 2011 08:05:44 -0000 >@@ -524,6 +524,15 @@ > } > } ), > >+ testDisableOfFocused : function() { >+ var button = new org.eclipse.rwt.widgets.Button( "push" ); >+ button.addToDocument(); >+ button.setFocused( true ); >+ assertTrue( button.getFocused() ); >+ button.setEnabled( false ); >+ assertFalse( button.getFocused() ); >+ }, >+ > ///////// > // Helper > >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Control_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Control_Test.java,v >retrieving revision 1.49 >diff -u -r1.49 Control_Test.java >--- src/org/eclipse/swt/widgets/Control_Test.java 4 Dec 2011 18:55:34 -0000 1.49 >+++ src/org/eclipse/swt/widgets/Control_Test.java 9 Dec 2011 08:05:45 -0000 >@@ -616,6 +616,16 @@ > assertTrue( noFocusControl.isFocusControl() ); > } > >+ public void testDisableOfFocused() { >+ Control control = new Button( shell, SWT.PUSH ); >+ shell.open(); >+ control.setFocus(); >+ >+ control.setEnabled( false ); >+ >+ assertSame( shell, display.getFocusControl() ); >+ } >+ > public void testDisposeOfFocused() { > Control control1 = new Button( shell, SWT.PUSH ); > Composite composite = new Composite( shell, SWT.NONE );
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 365396
:
207824
| 208138