| Summary: | In OperationMode SWT_COMPATIBILITY a new Shell is not created | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Johannes Eickhold <jeick> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | mpost |
| Version: | 1.5 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
In addition to the described behavior, there seams to be a problem with shell resizing too. in SWT_COMPAT mode resizing the browser windows does not affect the displayed content. Eg: starting with a small browser and maximizing leafs the content in the smaller space the browser offered before. Under JEE_COMPAT the resizing works as expected. All problems are related to the request counter which is *missing* from the JSON meta for some reason. Marked as INVALID as readAndDispatch loop is missing from the snippet. The correct way to handle events in SWT_COMPATIBILITY mode is to add something like the following snippet to the end of the createUI() method:
shell.open();
if( RWT.getLifeCycle() instanceof RWTLifeCycle ) {
while( !shell.isDisposed() ) {
if( !display.readAndDispatch() ) {
display.sleep();
}
}
display.dispose();
}
return 0;
|
The following example code works as expected in JEE_COMPATIBILITY mode but not in JEE_COMPATIBILITY. public class Configurator implements ApplicationConfigurator { public void configure( ApplicationConfiguration configuration ) { configuration.setOperationMode( OperationMode.SWT_COMPATIBILITY ); configuration.addEntryPoint( "/sd", SimpleDialogSandbox.class, null ); } } public class SimpleDialogSandbox implements IEntryPoint { @SuppressWarnings("serial") public int createUI() { final Display display = new Display(); final Shell shell = new Shell( display, SWT.NO_TRIM ); shell.setMaximized( true ); shell.setLayout( new FillLayout() ); final Button openDialog = new Button( shell, SWT.PUSH ); openDialog.setText( "Open Dialog" ); openDialog.addSelectionListener( new SelectionListener() { public void widgetSelected( SelectionEvent e ) { int style = SWT.CLOSE; Shell dialog = new Shell( display, style ); dialog.pack(); dialog.open(); } public void widgetDefaultSelected( SelectionEvent e ) { // not used } } ); shell.open(); return 0; } }