|
Lines 424-430
Link Here
|
| 424 |
assertNull( adapter.getUserForeground() ); |
424 |
assertNull( adapter.getUserForeground() ); |
| 425 |
Color themeColor = control.getForeground(); |
425 |
Color themeColor = control.getForeground(); |
| 426 |
// enabled state: |
426 |
// enabled state: |
| 427 |
control.setForeground( blue ); |
427 |
control.setForeground( blue ); |
| 428 |
assertEquals( blue, adapter.getUserForeground() ); |
428 |
assertEquals( blue, adapter.getUserForeground() ); |
| 429 |
assertEquals( blue, control.getForeground() ); |
429 |
assertEquals( blue, control.getForeground() ); |
| 430 |
// disabled directly |
430 |
// disabled directly |
|
Lines 436-442
Link Here
|
| 436 |
composite.setEnabled( false ); |
436 |
composite.setEnabled( false ); |
| 437 |
assertEquals( null, adapter.getUserForeground() ); |
437 |
assertEquals( null, adapter.getUserForeground() ); |
| 438 |
assertEquals( blue, control.getForeground() ); |
438 |
assertEquals( blue, control.getForeground() ); |
| 439 |
// re-enabled |
439 |
// re-enabled |
| 440 |
composite.setEnabled( true ); |
440 |
composite.setEnabled( true ); |
| 441 |
assertEquals( blue, adapter.getUserForeground() ); |
441 |
assertEquals( blue, adapter.getUserForeground() ); |
| 442 |
assertEquals( blue, control.getForeground() ); |
442 |
assertEquals( blue, control.getForeground() ); |
|
Lines 445-451
Link Here
|
| 445 |
assertEquals( null, adapter.getUserForeground() ); |
445 |
assertEquals( null, adapter.getUserForeground() ); |
| 446 |
assertEquals( themeColor, control.getForeground() ); |
446 |
assertEquals( themeColor, control.getForeground() ); |
| 447 |
} |
447 |
} |
| 448 |
|
448 |
|
| 449 |
public void testVisible() { |
449 |
public void testVisible() { |
| 450 |
Display display = new Display(); |
450 |
Display display = new Display(); |
| 451 |
Shell shell = new Shell( display, SWT.NONE ); |
451 |
Shell shell = new Shell( display, SWT.NONE ); |
|
Lines 679-684
Link Here
|
| 679 |
assertEquals( "", log.toString() ); |
679 |
assertEquals( "", log.toString() ); |
| 680 |
} |
680 |
} |
| 681 |
|
681 |
|
|
|
682 |
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=323570 |
| 683 |
public void testFocusOnBlockedShell() { |
| 684 |
Display display = new Display(); |
| 685 |
Shell shell1 = new Shell( display, SWT.NONE ); |
| 686 |
Control button1 = new Button( shell1, SWT.PUSH ); |
| 687 |
Shell shell2 = new Shell( shell1, SWT.APPLICATION_MODAL ); |
| 688 |
shell1.open(); |
| 689 |
assertEquals( button1, display.getFocusControl() ); |
| 690 |
assertEquals( shell1, display.getActiveShell() ); |
| 691 |
shell2.open(); |
| 692 |
button1.setFocus(); |
| 693 |
assertEquals( shell2, display.getFocusControl() ); |
| 694 |
assertEquals( shell2, display.getActiveShell() ); |
| 695 |
} |
| 696 |
|
| 682 |
public void testToControl() { |
697 |
public void testToControl() { |
| 683 |
Display display = new Display(); |
698 |
Display display = new Display(); |
| 684 |
Shell shell = new Shell( display, SWT.NONE ); |
699 |
Shell shell = new Shell( display, SWT.NONE ); |
|
Lines 824-833
Link Here
|
| 824 |
assertNotNull( monitor ); |
839 |
assertNotNull( monitor ); |
| 825 |
assertEquals( display.getPrimaryMonitor(), monitor ); |
840 |
assertEquals( display.getPrimaryMonitor(), monitor ); |
| 826 |
} |
841 |
} |
| 827 |
|
842 |
|
| 828 |
|
843 |
|
| 829 |
public void testUntypedHelpListener() { |
844 |
public void testUntypedHelpListener() { |
| 830 |
final Event[] untypedHelpEvent = { null }; |
845 |
final Event[] untypedHelpEvent = { null }; |
| 831 |
Fixture.fakePhase( PhaseId.PROCESS_ACTION ); |
846 |
Fixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| 832 |
Display display = new Display(); |
847 |
Display display = new Display(); |
| 833 |
Control control = new Shell( display ); |
848 |
Control control = new Shell( display ); |
|
Lines 839-852
Link Here
|
| 839 |
control.notifyListeners( SWT.Help, new Event() ); |
854 |
control.notifyListeners( SWT.Help, new Event() ); |
| 840 |
assertNotNull( untypedHelpEvent[ 0 ] ); |
855 |
assertNotNull( untypedHelpEvent[ 0 ] ); |
| 841 |
} |
856 |
} |
| 842 |
|
857 |
|
| 843 |
public void testRedraw() { |
858 |
public void testRedraw() { |
| 844 |
Display display = new Display(); |
859 |
Display display = new Display(); |
| 845 |
Composite control = new Shell( display ); |
860 |
Composite control = new Shell( display ); |
| 846 |
control.redraw(); |
861 |
control.redraw(); |
| 847 |
assertTrue( RWTLifeCycle.needsFakeRedraw( control ) ); |
862 |
assertTrue( RWTLifeCycle.needsFakeRedraw( control ) ); |
| 848 |
} |
863 |
} |
| 849 |
|
864 |
|
| 850 |
public void testSetBackground() { |
865 |
public void testSetBackground() { |
| 851 |
Display display = new Display(); |
866 |
Display display = new Display(); |
| 852 |
Composite control = new Shell( display ); |
867 |
Composite control = new Shell( display ); |
|
Lines 866-872
Link Here
|
| 866 |
// Expected Exception |
881 |
// Expected Exception |
| 867 |
} |
882 |
} |
| 868 |
} |
883 |
} |
| 869 |
|
884 |
|
| 870 |
public void testSetBackgroundImage() { |
885 |
public void testSetBackgroundImage() { |
| 871 |
ClassLoader loader = Fixture.class.getClassLoader(); |
886 |
ClassLoader loader = Fixture.class.getClassLoader(); |
| 872 |
InputStream stream = loader.getResourceAsStream( Fixture.IMAGE1 ); |
887 |
InputStream stream = loader.getResourceAsStream( Fixture.IMAGE1 ); |
|
Lines 889-895
Link Here
|
| 889 |
} |
904 |
} |
| 890 |
} |
905 |
} |
| 891 |
} |
906 |
} |
| 892 |
|
907 |
|
| 893 |
public void testSetCursor() { |
908 |
public void testSetCursor() { |
| 894 |
Display display = new Display(); |
909 |
Display display = new Display(); |
| 895 |
Composite control = new Shell( display ); |
910 |
Composite control = new Shell( display ); |
|
Lines 906-912
Link Here
|
| 906 |
// Expected Exception |
921 |
// Expected Exception |
| 907 |
} |
922 |
} |
| 908 |
} |
923 |
} |
| 909 |
|
924 |
|
| 910 |
public void testSetFont() { |
925 |
public void testSetFont() { |
| 911 |
Display display = new Display(); |
926 |
Display display = new Display(); |
| 912 |
Composite control = new Shell( display ); |
927 |
Composite control = new Shell( display ); |
|
Lines 932-938
Link Here
|
| 932 |
// Expected Exception |
947 |
// Expected Exception |
| 933 |
} |
948 |
} |
| 934 |
} |
949 |
} |
| 935 |
|
950 |
|
| 936 |
public void testSetForeground() { |
951 |
public void testSetForeground() { |
| 937 |
Display display = new Display(); |
952 |
Display display = new Display(); |
| 938 |
Composite control = new Shell( display ); |
953 |
Composite control = new Shell( display ); |