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 211181 Details for
Bug 370139
[Dialog] Modal dialog blocks application upon close
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 patch
Bug-370139.patch (text/plain), 13.59 KB, created by
Ivan Furnadjiev
on 2012-02-17 09:12:46 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2012-02-17 09:12:46 EST
Size:
13.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: js/org/eclipse/swt/widgets/ShellAdapter.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/js/org/eclipse/swt/widgets/ShellAdapter.js,v >retrieving revision 1.25 >diff -u -r1.25 ShellAdapter.js >--- js/org/eclipse/swt/widgets/ShellAdapter.js 1 Feb 2012 12:16:02 -0000 1.25 >+++ js/org/eclipse/swt/widgets/ShellAdapter.js 17 Feb 2012 14:05:48 -0000 >@@ -22,7 +22,6 @@ > result.setParentShell( parentShell ); > } > result.initialize(); >- result.show(); > } ); > return result; > }, >@@ -40,6 +39,8 @@ > "image", > "text", > "alpha", >+ // Important: Order matters: opened, active, mode >+ "opened", > "active", > "mode", > "hasShellListener", >@@ -71,6 +72,11 @@ > shell.setActiveControl( widget ); > } ); > }, >+ "opened" : function( shell, value ) { >+ if( value ) { >+ shell.open(); >+ } >+ }, > "mode" : function( shell, value ) { > var fullscreen = value === "fullscreen"; > shell.setMode( fullscreen ? "maximized" : value ); >Index: widgetkits/org/eclipse/swt/internal/widgets/shellkit/ShellLCA.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/shellkit/ShellLCA.java,v >retrieving revision 1.4 >diff -u -r1.4 ShellLCA.java >--- widgetkits/org/eclipse/swt/internal/widgets/shellkit/ShellLCA.java 23 Jan 2012 14:28:17 -0000 1.4 >+++ widgetkits/org/eclipse/swt/internal/widgets/shellkit/ShellLCA.java 17 Feb 2012 14:05:48 -0000 >@@ -118,6 +118,7 @@ > renderImage( shell ); > renderText( shell ); > renderAlpha( shell ); >+ renderOpen( shell ); > renderActiveShell( shell ); > // Important: Order matters, write setMode() after open() and before > // setBounds() - see bug 302224 >@@ -169,6 +170,16 @@ > ///////////////////////////////////////////// > // Methods to read and write the active shell > >+ private static void renderOpen( Shell shell ) { >+ Boolean newValue = Boolean.valueOf( shell.getVisible() ); >+ Boolean defValue = Boolean.FALSE; >+ String prop = Props.VISIBLE; >+ if( WidgetLCAUtil.hasChanged( shell, prop, newValue, defValue ) && shell.getVisible() ) { >+ IClientObject clientObject = ClientObjectFactory.getForWidget( shell ); >+ clientObject.set( "opened", true ); >+ } >+ } >+ > private static void renderActiveShell( Shell shell ) { > Shell activeShell = shell.getDisplay().getActiveShell(); > boolean hasChanged = WidgetLCAUtil.hasChanged( shell, PROP_ACTIVE_SHELL, activeShell, null ); >#P org.eclipse.rap.rwt.jstest >Index: js/org/eclipse/rwt/test/fixture/TestUtil.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/fixture/TestUtil.js,v >retrieving revision 1.50 >diff -u -r1.50 TestUtil.js >--- js/org/eclipse/rwt/test/fixture/TestUtil.js 14 Feb 2012 15:57:39 -0000 1.50 >+++ js/org/eclipse/rwt/test/fixture/TestUtil.js 17 Feb 2012 14:05:49 -0000 >@@ -893,7 +893,8 @@ > "action" : "create", > "type" : "rwt.widgets.Shell", > "properties" : { >- "style" : [ "BORDER" ] >+ "style" : [ "BORDER" ], >+ "opened" : true > } > } ); > return org.eclipse.rwt.protocol.ObjectManager.getObject( id ); >Index: js/org/eclipse/rwt/test/tests/ShellProtocolIntegrationTest.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/ShellProtocolIntegrationTest.js,v >retrieving revision 1.20 >diff -u -r1.20 ShellProtocolIntegrationTest.js >--- js/org/eclipse/rwt/test/tests/ShellProtocolIntegrationTest.js 30 Jan 2012 15:19:11 -0000 1.20 >+++ js/org/eclipse/rwt/test/tests/ShellProtocolIntegrationTest.js 17 Feb 2012 14:05:49 -0000 >@@ -42,7 +42,7 @@ > assertTrue( shell._onTop ); > assertTrue( shell._appModal ); > org.eclipse.rwt.test.fixture.TestUtil.flush(); >- assertTrue( shell.isSeeable() ); >+ assertFalse( shell.isSeeable() ); > this._disposeShell(); > }, > >@@ -82,6 +82,14 @@ > this._disposeShell(); > }, > >+ testSetOpened : function() { >+ var shell = this._protocolCreateShell(); >+ this._protocolSet( { "opened" : true } ); >+ org.eclipse.rwt.test.fixture.TestUtil.flush(); >+ assertTrue( shell.isSeeable() ); >+ this._disposeShell(); >+ }, >+ > testSetActive : function() { > var shell = this._protocolCreateShell(); > this._protocolSet( { "active" : true } ); >@@ -225,10 +233,12 @@ > // See Bug 354912 - New Shell opens in background, not visible > testSetParentShellZIndex : function() { > var parent = this._protocolCreateShell( "wParent" ); >+ parent.open(); > parent.setActive( true ); // otherwise it would not be automatically in front >- org.eclipse.rwt.test.fixture.TestUtil.flush(); >+ org.eclipse.rwt.test.fixture.TestUtil.flush(); > > var shell = this._protocolCreateShell( "w3", "wParent" ); >+ shell.open(); > > org.eclipse.rwt.test.fixture.TestUtil.flush(); > assertTrue( shell.getZIndex() > parent.getZIndex() ); >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/internal/widgets/shellkit/ShellLCA_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/internal/widgets/shellkit/ShellLCA_Test.java,v >retrieving revision 1.33 >diff -u -r1.33 ShellLCA_Test.java >--- src/org/eclipse/swt/internal/widgets/shellkit/ShellLCA_Test.java 17 Jan 2012 15:10:34 -0000 1.33 >+++ src/org/eclipse/swt/internal/widgets/shellkit/ShellLCA_Test.java 17 Feb 2012 14:05:50 -0000 >@@ -38,12 +38,14 @@ > > private Display display; > private Shell shell; >+ private ShellLCA lca; > > @Override > protected void setUp() throws Exception { > Fixture.setUp(); > display = new Display(); > shell = new Shell( display ); >+ lca = new ShellLCA(); > Fixture.fakeNewRequest( display ); > } > >@@ -350,7 +352,6 @@ > > public void testAlpha() throws Exception { > shell.open(); >- ShellLCA lca = new ShellLCA(); > > shell.setAlpha( 23 ); > lca.renderChanges( shell ); >@@ -361,7 +362,6 @@ > > public void testRenderMode() throws Exception { > shell.open(); >- ShellLCA lca = new ShellLCA(); > > shell.setMaximized( true ); > lca.renderChanges( shell ); >@@ -374,7 +374,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > shell.open(); >- ShellLCA lca = new ShellLCA(); > shell.setFullScreen( true ); > Fixture.preserveWidgets(); > >@@ -387,7 +386,6 @@ > > public void testResetFullscreen() throws Exception { > shell.open(); >- ShellLCA lca = new ShellLCA(); > > shell.setFullScreen( true ); > lca.renderChanges( shell ); >@@ -397,8 +395,6 @@ > } > > public void testRenderDefaultButtonIntiallyNull() throws IOException { >- ShellLCA lca = new ShellLCA(); >- > lca.renderChanges( shell ); > > Message message = Fixture.getProtocolMessage(); >@@ -406,7 +402,6 @@ > } > > public void testRenderDefaultButtonInitiallySet() throws Exception { >- ShellLCA lca = new ShellLCA(); > Button button = new Button( shell, SWT.PUSH ); > > shell.setDefaultButton( button ); >@@ -419,7 +414,6 @@ > public void testRenderDefaultButtonUnchanged() throws IOException { > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); >- ShellLCA lca = new ShellLCA(); > shell.setDefaultButton( new Button( shell, SWT.PUSH ) ); > > Fixture.preserveWidgets(); >@@ -432,7 +426,6 @@ > public void testResetDefaultButton() throws IOException { > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); >- ShellLCA lca = new ShellLCA(); > Button button = new Button( shell, SWT.PUSH ); > shell.setDefaultButton( button ); > Fixture.preserveWidgets(); >@@ -445,8 +438,6 @@ > } > > public void testRenderActiveControlIntiallyNull() throws IOException { >- ShellLCA lca = new ShellLCA(); >- > lca.renderChanges( shell ); > > Message message = Fixture.getProtocolMessage(); >@@ -454,7 +445,6 @@ > } > > public void testRenderActiveControlInitiallySet() throws Exception { >- ShellLCA lca = new ShellLCA(); > Button button = new Button( shell, SWT.PUSH ); > IShellAdapter adapter = shell.getAdapter( IShellAdapter.class ); > >@@ -471,7 +461,6 @@ > Button button = new Button( shell, SWT.PUSH ); > IShellAdapter adapter = shell.getAdapter( IShellAdapter.class ); > adapter.setActiveControl( button ); >- ShellLCA lca = new ShellLCA(); > > Fixture.preserveWidgets(); > lca.renderChanges( shell ); >@@ -486,7 +475,6 @@ > Button button = new Button( shell, SWT.PUSH ); > IShellAdapter adapter = shell.getAdapter( IShellAdapter.class ); > adapter.setActiveControl( button ); >- ShellLCA lca = new ShellLCA(); > Fixture.preserveWidgets(); > > adapter.setActiveControl( null ); >@@ -509,7 +497,6 @@ > Fixture.markInitialized( display ); > Fixture.preserveWidgets(); > shell.setMinimumSize( 100, 200 ); >- ShellLCA lca = new ShellLCA(); > > lca.renderChanges( shell ); > >@@ -521,7 +508,6 @@ > Shell shell = new Shell( display , SWT.NO_TRIM ); > Fixture.markInitialized( display ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > lca.renderInitialization( shell ); > >@@ -536,7 +522,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setText( "foo" ); > lca.renderChanges( shell ); >@@ -550,7 +535,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.addShellListener( new ShellAdapter(){ } ); > lca.renderChanges( shell ); >@@ -564,7 +548,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > shell.addShellListener( new ShellAdapter(){ } ); >- ShellLCA lca = new ShellLCA(); > > Fixture.preserveWidgets(); > lca.renderChanges( shell ); >@@ -575,7 +558,6 @@ > > public void testRenderRemoveShellListener() throws Exception { > Shell shell = new Shell( display , SWT.SHELL_TRIM ); >- ShellLCA lca = new ShellLCA(); > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > ShellListener listener = new ShellAdapter(){}; >@@ -594,7 +576,6 @@ > shell.open(); > Fixture.markInitialized( display ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setActive(); > assertTrue( shell.getDisplay().getActiveShell() == shell ); >@@ -610,7 +591,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( parentShell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > lca.renderInitialization( dialogShell ); > >@@ -624,7 +604,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setImage( Graphics.getImage( Fixture.IMAGE1 ) ); > lca.renderChanges( shell ); >@@ -639,7 +618,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setImage( Graphics.getImage( Fixture.IMAGE1 ) ); > lca.renderChanges( shell ); >@@ -653,7 +631,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setImage( Graphics.getImage( Fixture.IMAGE1 ) ); > lca.renderChanges( shell ); >@@ -668,7 +645,6 @@ > Fixture.markInitialized( display ); > Fixture.markInitialized( shell ); > Fixture.preserveWidgets(); >- ShellLCA lca = new ShellLCA(); > > shell.setImages( new Image[] { Graphics.getImage( Fixture.IMAGE1 ) } ); > lca.renderChanges( shell ); >@@ -679,8 +655,6 @@ > } > > public void testRenderVisibilityIntiallyFalse() throws IOException { >- ShellLCA lca = new ShellLCA(); >- > lca.renderChanges( shell ); > > Message message = Fixture.getProtocolMessage(); >@@ -689,8 +663,6 @@ > > public void testRenderVisibilityInitiallyTrue() throws IOException { > // Client shell is initially visible, SWT shell is not >- ShellLCA lca = new ShellLCA(); >- > shell.open(); > lca.renderChanges( shell ); > >@@ -698,6 +670,34 @@ > assertNull( message.findSetOperation( shell, "visibility" ) ); > } > >+ public void testRenderOpenExpanded() throws IOException { >+ lca.render( shell ); >+ >+ Message message = Fixture.getProtocolMessage(); >+ CreateOperation operation = message.findCreateOperation( shell ); >+ assertTrue( operation.getPropertyNames().indexOf( "opened" ) == -1 ); >+ } >+ >+ public void testRenderOpen() throws IOException { >+ shell.open(); >+ lca.renderChanges( shell ); >+ >+ Message message = Fixture.getProtocolMessage(); >+ assertEquals( Boolean.TRUE, message.findSetProperty( shell, "opened" ) ); >+ } >+ >+ public void testRenderOpenUnchanged() throws IOException { >+ Fixture.markInitialized( display ); >+ Fixture.markInitialized( shell ); >+ >+ shell.open(); >+ Fixture.preserveWidgets(); >+ lca.renderChanges( shell ); >+ >+ Message message = Fixture.getProtocolMessage(); >+ assertNull( message.findSetOperation( shell, "opened" ) ); >+ } >+ > private static Control getActiveControl( Shell shell ) { > Object adapter = shell.getAdapter( IShellAdapter.class ); > IShellAdapter shellAdapter = ( IShellAdapter )adapter;
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 370139
:
211104
| 211181