|
Lines 31-38
Link Here
|
| 31 |
import org.eclipse.swt.events.SelectionAdapter; |
31 |
import org.eclipse.swt.events.SelectionAdapter; |
| 32 |
import org.eclipse.swt.events.SelectionEvent; |
32 |
import org.eclipse.swt.events.SelectionEvent; |
| 33 |
import org.eclipse.swt.graphics.Rectangle; |
33 |
import org.eclipse.swt.graphics.Rectangle; |
| 34 |
import org.eclipse.swt.internal.widgets.WidgetAdapter; |
34 |
import org.eclipse.swt.internal.widgets.*; |
| 35 |
import org.eclipse.swt.internal.widgets.WidgetAdapterFactory; |
|
|
| 36 |
import org.eclipse.swt.widgets.*; |
35 |
import org.eclipse.swt.widgets.*; |
| 37 |
|
36 |
|
| 38 |
|
37 |
|
|
Lines 271-276
Link Here
|
| 271 |
assertEquals( previousFocusControl, display.getFocusControl() ); |
270 |
assertEquals( previousFocusControl, display.getFocusControl() ); |
| 272 |
} |
271 |
} |
| 273 |
|
272 |
|
|
|
273 |
public void testResizeMaximizedShells() { |
| 274 |
Display display = new Display(); |
| 275 |
Object adapter = display.getAdapter( IDisplayAdapter.class ); |
| 276 |
IDisplayAdapter displayAdapter = ( IDisplayAdapter )adapter; |
| 277 |
displayAdapter.setBounds( new Rectangle( 0, 0, 800, 600 ) ); |
| 278 |
Shell shell1 = new Shell( display, SWT.NONE ); |
| 279 |
shell1.setBounds( 0, 0, 800, 600 ); |
| 280 |
Shell shell2 = new Shell( display, SWT.NONE ); |
| 281 |
shell2.setBounds( 0, 0, 300, 400 ); |
| 282 |
shell2.setMaximized( true ); |
| 283 |
// fake display resize |
| 284 |
IDisplayLifeCycleAdapter lca = DisplayUtil.getLCA( display ); |
| 285 |
String displayId = DisplayUtil.getAdapter( display ).getId(); |
| 286 |
Fixture.fakeRequestParam( RequestParams.UIROOT, displayId ); |
| 287 |
Fixture.fakeRequestParam( displayId + ".bounds.width", "700" ); |
| 288 |
Fixture.fakeRequestParam( displayId + ".bounds.height", "500" ); |
| 289 |
lca.readData( display ); |
| 290 |
// shell1 is not resized although it has the same size as the display |
| 291 |
assertEquals( new Rectangle( 0, 0, 800, 600 ), shell1.getBounds() ); |
| 292 |
// shell2 is resized because it's maximized |
| 293 |
assertEquals( new Rectangle( 0, 0, 700, 500 ), shell2.getBounds() ); |
| 294 |
} |
| 295 |
|
| 274 |
protected void setUp() throws Exception { |
296 |
protected void setUp() throws Exception { |
| 275 |
Fixture.setUp(); |
297 |
Fixture.setUp(); |
| 276 |
System.setProperty( IInitialization.PARAM_LIFE_CYCLE, |
298 |
System.setProperty( IInitialization.PARAM_LIFE_CYCLE, |