Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Appel2008-03-28 11:16:30 -0400
committerFrank Appel2008-03-28 11:16:30 -0400
commit61efd0f61e2a3cda5e62714101cb27702bfe0193 (patch)
treee26d9a6f8f416473f249ed67abbce6f763dc6c18 /tests/org.eclipse.rap.ui.tests.performance
parent62ab78e995affb44daaed2557c276a5a7215367b (diff)
downloadorg.eclipse.rap-61efd0f61e2a3cda5e62714101cb27702bfe0193.tar.gz
org.eclipse.rap-61efd0f61e2a3cda5e62714101cb27702bfe0193.tar.xz
org.eclipse.rap-61efd0f61e2a3cda5e62714101cb27702bfe0193.zip
initial import
Diffstat (limited to 'tests/org.eclipse.rap.ui.tests.performance')
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.classpath7
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.cvsignore1
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.project28
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.core.prefs70
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.ui.prefs5
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.pde.prefs14
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/META-INF/MANIFEST.MF17
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/about.html28
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/build.properties15
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/anything.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/binary_co.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/dynamic.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/editor.gif1
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/anything.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/binary_co.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/dynamic.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/editor.gif1
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart1.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart2.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/view.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart1.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart2.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/icons/view.gifbin0 -> 96 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/plugin.xml77
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ComboViewerRefreshTest.java101
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTableViewerRefreshTest.java83
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTreeTest.java110
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FileImageDescriptorTest.java110
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/JFacePerformanceSuite.java52
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListPopulationTest.java136
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListViewerRefreshTest.java81
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ProgressMonitorDialogPerformanceTest.java108
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestContentProvider.java102
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestTreeContentProvider.java59
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/SWTTreeTest.java109
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ShrinkingTreeTest.java94
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TableViewerRefreshTest.java177
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestElement.java43
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestTreeElement.java62
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeAddTest.java173
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeTest.java134
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeViewerRefreshTest.java67
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ViewerTest.java115
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ActivitiesPerformanceSuite.java40
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/BasicPerformanceTest.java273
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/CommandsPerformanceTest.java474
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ContentDescriberForTestsOnly.java140
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorPerformanceSuite.java78
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java75
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorTestHelper.java166
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/GenerateIdentifiersTest.java51
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionClasses.java164
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionTest.java444
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionsPerformance.java93
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java58
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenClosePerspectiveTest.java120
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseViewTest.java61
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseWindowTest.java56
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java66
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenNavigatorFolderTest.java161
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective1.java29
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective2.java30
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTestRunner.java44
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTester.java153
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerspectiveSwitchTest.java98
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java123
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ResourceTestHelper.java149
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/TestRunnable.java15
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformancePlugin.java66
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSetup.java117
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSuite.java41
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ViewPerformanceSuite.java104
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/WorkbenchPerformanceSuite.java183
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ComputeSizeTest.java100
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ConstantAreaLayout.java69
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/EditorWidgetFactory.java105
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/LayoutTest.java93
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PerspectiveWidgetFactory.java74
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PresentationWidgetFactory.java100
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/RecursiveTrimLayoutWidgetFactory.java120
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ResizeTest.java108
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/TestWidgetFactory.java36
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ViewWidgetFactory.java101
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/marked.txt12
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceEditorPart.java129
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceProblemsView.java28
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceViewPart.java46
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivateTest.java55
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivePartPropertyTest.java66
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationCreateTest.java52
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationInactivePartPropertyTest.java58
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTest.java153
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTestSuite.java127
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationSelectTest.java55
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationTestbed.java164
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective.java36
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective2.java36
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/TestPresentablePart.java223
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/test_ideas.txt42
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/test.xml61
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/defaults_ps.gifbin0 -> 582 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/filter_ps.gifbin0 -> 219 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/tree_mode.gifbin0 -> 98 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/outline_co.gifbin0 -> 152 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/prop_ps.gifbin0 -> 343 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample2.gifbin0 -> 318 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample3.gifbin0 -> 173 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/contact.gifbin0 -> 218 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/info.gifbin0 -> 267 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/internal_browser.gifbin0 -> 587 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/login.gifbin0 -> 336 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/progress_ok.gifbin0 -> 265 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/pview.gifbin0 -> 219 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/register.gifbin0 -> 327 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/search.gifbin0 -> 347 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/status.gifbin0 -> 359 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/ttt.gifbin0 -> 375 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/ejbBinding_obj.gifbin0 -> 1043 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/sessions.gifbin0 -> 359 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/defaultview_misc.gifbin0 -> 351 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/view_menu.gifbin0 -> 853 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/elements_obj.gifbin0 -> 617 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/fldr_obj.gifbin0 -> 216 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/defaultview_misc.gifbin0 -> 351 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/view_menu.gifbin0 -> 853 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/WEB-INF/conf/W4T.xml7
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/jface/action/images/stop.gifbin0 -> 215 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/rwt/widgets/ExternalBrowser-1955133473.js35
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Application-1602013276.js74
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ButtonUtil1975626283.js126
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/CLabelUtil1376009346.js45
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ComboUtil-2084565362.js130
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/EventUtil2075083609.js110
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/FontSizeCalculation1500612024.js61
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LabelUtil-2065462132.js138
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LinkUtil1123992408.js137
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/MenuUtil-1871588199.js174
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Request-1891200396.js383
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TabUtil-322550739.js115
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TextUtil-1782166993.js299
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ToolItemUtil-436206436.js139
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TreeItemUtil-208952825.js83
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetManager-512780408.js369
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetUtil-1981844903.js29
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/browser/Browser733962551.js38
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabFolder-602093123.js425
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabItem1765734906.js170
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/ScrolledComposite900368632.js100
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/AppearancesBase908093218.js1576
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/BordersBase-944351833.js170
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/Custom_1678652262.js160
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/Default-1310613382.js160
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/Dimensions-1925078230.js42
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Combo-2146408237.js300
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/CoolItem94361155.js120
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Group2080848937.js49
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/List-970428462.js272
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/ProgressBar142607379.js164
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Sash-514476566.js185
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Separator713157644.js74
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Shell-677453514.js475
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Spinner-256516370.js99
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Table-570150904.js1101
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/TableColumn1309994261.js252
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/TableItem138535358.js299
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/TableRow-939162931.js58
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/Tree1664857719.js569
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/TreeColumn1075179895.js250
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/widgets/TreeItem1272454607.js331
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/ui/forms/widgets/Hyperlink2003876893.js102
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/ui/forms/widgets/ToggleHyperlink2085708493.js92
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/qx/constant/Core735147594.js67
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/qx/constant/Layout-1788539321.js35
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/qx/constant/Style-906359273.js43
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/qx288395278.js186
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/static/history/historyHelper.html4
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/static/html/blank.html2
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/static/image/blank.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/static/image/dotted_white.gifbin0 -> 44 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/down.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/down_small.gifbin0 -> 46 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/down_tiny.gifbin0 -> 44 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/first.pngbin0 -> 321 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/forward.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/last.pngbin0 -> 333 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/left.pngbin0 -> 299 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/minimize.gifbin0 -> 52 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/next.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/previous.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/rewind.gifbin0 -> 54 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/right.pngbin0 -> 313 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/up.gifbin0 -> 48 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/up_small.gifbin0 -> 46 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/arrows/up_tiny.gifbin0 -> 44 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/chevron.gifbin0 -> 850 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/close.gifbin0 -> 872 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/close_hover.gifbin0 -> 872 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/maximize.gifbin0 -> 859 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/minimize.gifbin0 -> 845 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/ctabfolder/restore.gifbin0 -> 79 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/cursors/alias.gifbin0 -> 104 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/cursors/copy.gifbin0 -> 102 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/cursors/move.gifbin0 -> 67 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/cursors/nodrop.gifbin0 -> 120 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/menu/checkbox.gifbin0 -> 838 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/menu/menu-blank.gifbin0 -> 75 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/menu/radiobutton.gifbin0 -> 830 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/progressbar.bgimagebin0 -> 155 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/progressbar.fgimagebin0 -> 223 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.closebutton.imagebin0 -> 249 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.closebutton.inactive.imagebin0 -> 249 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.closebutton.inactive.over.imagebin0 -> 253 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.closebutton.over.imagebin0 -> 253 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.maxbutton.imagebin0 -> 163 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.maxbutton.inactive.imagebin0 -> 163 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.maxbutton.inactive.over.imagebin0 -> 177 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.maxbutton.over.imagebin0 -> 177 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.minbutton.imagebin0 -> 175 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.minbutton.inactive.imagebin0 -> 175 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.minbutton.inactive.over.imagebin0 -> 178 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.minbutton.over.imagebin0 -> 178 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.restorebutton.imagebin0 -> 176 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.restorebutton.inactive.imagebin0 -> 176 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.restorebutton.inactive.over.imagebin0 -> 179 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.restorebutton.over.imagebin0 -> 179 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.title.active.bgimagebin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/shell.title.inactive.bgimagebin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/check_gray_off.gifbin0 -> 869 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/check_gray_on.gifbin0 -> 870 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/check_white_off.gifbin0 -> 845 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/check_white_on.gifbin0 -> 854 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/column/down.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/table/column/up.gifbin0 -> 56 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/column/down.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/column/up.gifbin0 -> 56 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/cross.gifbin0 -> 67 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/cross_minus.gifbin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/cross_plus.gifbin0 -> 158 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/end.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/end_minus.gifbin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/end_plus.gifbin0 -> 158 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/folder_closed.gifbin0 -> 919 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/folder_open.gifbin0 -> 216 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/line.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/minus.gifbin0 -> 148 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/only_minus.gifbin0 -> 177 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/only_plus.gifbin0 -> 181 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/plus.gifbin0 -> 152 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/start_minus.gifbin0 -> 178 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Custom_1/widgets/tree/start_plus.gifbin0 -> 182 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/down.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/down_small.gifbin0 -> 46 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/down_tiny.gifbin0 -> 44 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/first.pngbin0 -> 321 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/forward.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/last.pngbin0 -> 333 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/left.pngbin0 -> 299 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/minimize.gifbin0 -> 52 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/next.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/previous.gifbin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/rewind.gifbin0 -> 54 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/right.pngbin0 -> 313 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/up.gifbin0 -> 48 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/up_small.gifbin0 -> 46 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/arrows/up_tiny.gifbin0 -> 44 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/chevron.gifbin0 -> 850 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/close.gifbin0 -> 872 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/close_hover.gifbin0 -> 872 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/maximize.gifbin0 -> 859 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/minimize.gifbin0 -> 845 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/ctabfolder/restore.gifbin0 -> 79 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/cursors/alias.gifbin0 -> 104 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/cursors/copy.gifbin0 -> 102 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/cursors/move.gifbin0 -> 67 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/cursors/nodrop.gifbin0 -> 120 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/menu/checkbox.gifbin0 -> 838 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/menu/menu-blank.gifbin0 -> 75 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/menu/radiobutton.gifbin0 -> 830 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/progressbar.bgimagebin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/progressbar.fgimagebin0 -> 49 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.closebutton.imagebin0 -> 213 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.closebutton.inactive.imagebin0 -> 205 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.closebutton.inactive.over.imagebin0 -> 227 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.closebutton.over.imagebin0 -> 190 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.maxbutton.imagebin0 -> 144 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.maxbutton.inactive.imagebin0 -> 181 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.maxbutton.inactive.over.imagebin0 -> 181 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.maxbutton.over.imagebin0 -> 181 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.minbutton.imagebin0 -> 131 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.minbutton.inactive.imagebin0 -> 150 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.minbutton.inactive.over.imagebin0 -> 168 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.minbutton.over.imagebin0 -> 168 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.restorebutton.imagebin0 -> 159 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.restorebutton.inactive.imagebin0 -> 195 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.restorebutton.inactive.over.imagebin0 -> 195 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.restorebutton.over.imagebin0 -> 195 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.title.active.bgimagebin0 -> 85 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/shell.title.inactive.bgimagebin0 -> 85 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/check_gray_off.gifbin0 -> 869 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/check_gray_on.gifbin0 -> 870 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/check_white_off.gifbin0 -> 845 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/check_white_on.gifbin0 -> 854 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/column/down.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/table/column/up.gifbin0 -> 56 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/column/down.gifbin0 -> 55 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/column/up.gifbin0 -> 56 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/cross.gifbin0 -> 67 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/cross_minus.gifbin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/cross_plus.gifbin0 -> 158 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/end.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/end_minus.gifbin0 -> 154 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/end_plus.gifbin0 -> 158 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/folder_closed.gifbin0 -> 919 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/folder_open.gifbin0 -> 216 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/line.gifbin0 -> 64 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/minus.gifbin0 -> 148 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/only_minus.gifbin0 -> 177 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/only_plus.gifbin0 -> 181 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/plus.gifbin0 -> 152 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/start_minus.gifbin0 -> 178 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/themes/Default/widgets/tree/start_plus.gifbin0 -> 182 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/widget/rap/coolitem/chevron.gifbin0 -> 58 bytes
-rw-r--r--tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/resource/widget/rap/display/bg.gifbin0 -> 953 bytes
324 files changed, 18525 insertions, 0 deletions
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.classpath b/tests/org.eclipse.rap.ui.tests.performance/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.cvsignore b/tests/org.eclipse.rap.ui.tests.performance/.cvsignore
new file mode 100644
index 0000000000..ba077a4031
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.project b/tests/org.eclipse.rap.ui.tests.performance/.project
new file mode 100644
index 0000000000..52f6c741e2
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.rap.ui.tests.performance</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..141bae8ca1
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,70 @@
+#Fri Mar 03 16:41:54 EST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=disabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..61158fad62
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,5 @@
+#Tue Sep 12 09:00:30 EDT 2006
+eclipse.preferences.version=1
+internal.default.compliance=user
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @since 3.3\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template></templates>
diff --git a/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.pde.prefs b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..883666b4d6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,14 @@
+#Mon Feb 21 14:17:36 EST 2005
+compilers.p.deprecated=2
+compilers.p.illegal-att-value=0
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/tests/org.eclipse.rap.ui.tests.performance/META-INF/MANIFEST.MF b/tests/org.eclipse.rap.ui.tests.performance/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0ac95cd02f
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Performance Plug-in
+Bundle-ClassPath: uiperformance.jar
+Bundle-SymbolicName: org.eclipse.rap.ui.tests.performance;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: org.eclipse.ui.tests.performance.UIPerformancePlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.tests.harness,
+ org.junit,
+ org.eclipse.test.performance,
+ org.eclipse.core.resources,
+ org.eclipse.rap.ui,
+ org.eclipse.rap.ui.tests.harness,
+ org.eclipse.rap.ui.views
+Eclipse-LazyStart: true
diff --git a/tests/org.eclipse.rap.ui.tests.performance/about.html b/tests/org.eclipse.rap.ui.tests.performance/about.html
new file mode 100644
index 0000000000..460233046e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 2, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/tests/org.eclipse.rap.ui.tests.performance/build.properties b/tests/org.eclipse.rap.ui.tests.performance/build.properties
new file mode 100644
index 0000000000..63d086f46b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2005, 2006 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.uiperformance.jar = src/
+bin.includes = META-INF/,\
+ *.xml,\
+ icons/,\
+ uiperformance.jar
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/anything.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/anything.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/anything.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/binary_co.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/binary_co.gif
new file mode 100644
index 0000000000..23a508e10c
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/binary_co.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/dynamic.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/dynamic.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/dynamic.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/editor.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/editor.gif
new file mode 100644
index 0000000000..9bd92bfce9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/editor.gif
@@ -0,0 +1 @@
+GIF89a
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/anything.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/anything.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/anything.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/binary_co.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/binary_co.gif
new file mode 100644
index 0000000000..23a508e10c
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/binary_co.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/dynamic.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/dynamic.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/dynamic.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/editor.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/editor.gif
new file mode 100644
index 0000000000..9bd92bfce9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/editor.gif
@@ -0,0 +1 @@
+GIF89a
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart1.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart1.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart1.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart2.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart2.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/mockeditorpart2.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/view.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/view.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/imagetests/view.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart1.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart1.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart1.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart2.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart2.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/mockeditorpart2.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/icons/view.gif b/tests/org.eclipse.rap.ui.tests.performance/icons/view.gif
new file mode 100644
index 0000000000..efc77a7f75
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/icons/view.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/plugin.xml b/tests/org.eclipse.rap.ui.tests.performance/plugin.xml
new file mode 100644
index 0000000000..0a69f053d6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/plugin.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ icon="icons/anything.gif"
+ class="org.eclipse.ui.tests.performance.parts.PerformanceEditorPart"
+ default="true"
+ name="Basic Performance Editor"
+ id="org.eclipse.ui.tests.perf_basic"
+ extensions="perf_basic"/>
+
+ <editor
+ icon="icons/anything.gif"
+ class="org.eclipse.ui.tests.performance.parts.PerformanceEditorPart:outline"
+ default="true"
+ name="Editor w/Outline"
+ id="org.eclipse.ui.tests.perf_outline"
+ extensions="perf_outline"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="org.eclipse.ui.tests.performance.PerformancePerspective1"
+ name="Performance Test Perspective1"
+ id="org.eclipse.ui.tests.performancePerspective1"/>
+ <perspective
+ class="org.eclipse.ui.tests.performance.PerformancePerspective2"
+ name="Performance Test Perspective"
+ id="org.eclipse.ui.tests.performancePerspective2"/>
+ <perspective
+ name="UI Test Standalone View Perspective"
+ class="org.eclipse.ui.tests.performance.presentations.StandaloneViewPerspective"
+ id="org.eclipse.ui.tests.presentations.StandaloneViewPerspective">
+ </perspective>
+ <perspective
+ name="UI Test Standalone View Perspective 2 "
+ class="org.eclipse.ui.tests.performance.presentations.StandaloneViewPerspective2"
+ id="org.eclipse.ui.tests.presentations.StandaloneViewPerspective2">
+ </perspective>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ icon="icons/anything.gif"
+ class="org.eclipse.ui.tests.performance.parts.PerformanceViewPart"
+ name="Basic Performance View"
+ id="org.eclipse.ui.tests.perf_basic"/>
+ </extension>
+ <!--
+ this content type was added to provide
+ "regression test" for bug 107121. See OpenNavigatorFolderTest
+ for more details.
+ -->
+ <extension point="org.eclipse.core.runtime.contentTypes">
+ <content-type
+ file-extensions="htmltestonly"
+ priority="high"
+ name="Content Type for Test Only"
+ id="testOnlyContentType"
+ base-type="org.eclipse.core.runtime.text">
+ <describer
+ class="org.eclipse.ui.tests.performance.ContentDescriberForTestsOnly" />
+ </content-type>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ class="org.eclipse.ui.tests.performance.parts.PerformanceProblemsView"
+ id="org.eclipse.ui.tests.performance.problemsView"
+ name="Performance Problems View"/>
+ </extension>
+
+
+</plugin>
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ComboViewerRefreshTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ComboViewerRefreshTest.java
new file mode 100644
index 0000000000..6b85bb257d
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ComboViewerRefreshTest.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * ComboViewerRefreshTest is a test of refreshes of difference size in the combo
+ * viewer.
+ */
+public class ComboViewerRefreshTest extends ViewerTest {
+
+ ComboViewer viewer;
+
+ private RefreshTestContentProvider contentProvider;
+
+ private static int ELEMENT_COUNT;
+
+ public ComboViewerRefreshTest(String testName, int tagging) {
+ super(testName, tagging);
+
+ }
+
+ public ComboViewerRefreshTest(String testName) {
+ super(testName);
+
+ }
+
+ protected StructuredViewer createViewer(Shell shell) {
+
+ viewer = new ComboViewer(shell);
+ contentProvider = new RefreshTestContentProvider(ELEMENT_COUNT);
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(getLabelProvider());
+ return viewer;
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefresh() throws Throwable {
+
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=98265>See Bug 98265</a> ");
+ ELEMENT_COUNT = 1000;
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, ITERATIONS, JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefreshSmall() throws Throwable {
+
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=98265>See Bug 98265</a> ");
+
+ ELEMENT_COUNT = 50;
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ for (int i = 0; i < 1000; i++) {
+ viewer.refresh();
+ }
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(), JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTableViewerRefreshTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTableViewerRefreshTest.java
new file mode 100644
index 0000000000..017ff6a87d
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTableViewerRefreshTest.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+public class FastTableViewerRefreshTest extends TableViewerRefreshTest {
+
+ public FastTableViewerRefreshTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public FastTableViewerRefreshTest(String testName) {
+ super(testName);
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefreshMultiple() throws Throwable {
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ for (int i = 0; i < 10; i++) {
+ viewer.refresh();
+ processEvents();
+
+ }
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(),
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testUpdateMultiple() throws Throwable {
+ openBrowser();
+
+ exercise(
+ new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ for (int i = 0; i < 10; i++) {
+ TableItem[] items = viewer.getTable().getItems();
+ for (int j = 0; j < items.length; j++) {
+ TableItem item = items[j];
+ Object element = RefreshTestContentProvider.allElements[j];
+ viewer.testUpdateItem(item, element);
+ }
+ processEvents();
+ }
+
+ stopMeasuring();
+
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(),
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTreeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTreeTest.java
new file mode 100644
index 0000000000..63df693dc1
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTreeTest.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+public class FastTreeTest extends TreeAddTest {
+
+
+ public FastTreeTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public FastTreeTest(String testName) {
+ super(testName);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddTenTenTimes() throws CoreException {
+
+ doTestAdd(10, TEST_COUNT, false);
+ }
+
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddFiftyTenTimes() throws CoreException {
+
+ doTestAdd(50, TEST_COUNT, false);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddHundredTenTimes() throws CoreException {
+
+ tagIfNecessary("JFace - Add 10000 items 100 at a time TreeViewer 10 times",
+ Dimension.ELAPSED_PROCESS);
+
+ doTestAdd(100, TEST_COUNT, false);
+ }
+
+ /**
+ * Run the test for one of the fast insertions.
+ *
+ * @param count
+ * @throws CoreException
+ */
+ protected void doTestAdd(final int increment, final int total,final boolean preSort)
+ throws CoreException {
+
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+
+ TestTreeElement input = new TestTreeElement(0, null);
+ viewer.setInput(input);
+ input.createChildren(total);
+ if (preSort)
+ viewer.getSorter().sort(viewer, input.children);
+ Collection batches = new ArrayList();
+ int blocks = input.children.length / increment;
+ for (int j = 0; j < blocks; j = j + increment) {
+ Object[] batch = new Object[increment];
+ System.arraycopy(input.children, j * increment, batch, 0,
+ increment);
+ batches.add(batch);
+ }
+ processEvents();
+ Object[] batchArray = batches.toArray();
+ startMeasuring();
+ for (int i = 0; i < 10; i++) {
+ viewer.remove(input.children);
+ for (int k = 0; k < batchArray.length; k++) {
+ viewer.add(input, (Object[]) batchArray[k]);
+ processEvents();
+ }
+ }
+
+
+ stopMeasuring();
+
+ }
+ }, MIN_ITERATIONS, ITERATIONS, JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FileImageDescriptorTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FileImageDescriptorTest.java
new file mode 100644
index 0000000000..982a51dabd
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/FileImageDescriptorTest.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.TestRunnable;
+import org.eclipse.ui.tests.performance.UIPerformancePlugin;
+import org.osgi.framework.Bundle;
+
+/**
+ * ComboViewerRefreshTest is a test of refreshes of difference size in the combo
+ * viewer.
+ */
+public class FileImageDescriptorTest extends BasicPerformanceTest {
+
+ protected static final String IMAGES_DIRECTORY = "/icons/imagetests";
+
+ public FileImageDescriptorTest(String testName, int tagging) {
+ super(testName, tagging);
+
+ }
+
+ public FileImageDescriptorTest(String testName) {
+ super(testName);
+
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefresh() throws Throwable {
+
+ exercise(new TestRunnable() {
+ public void run() {
+ Class missing = null;
+ ArrayList images = new ArrayList();
+
+ Bundle bundle = UIPerformancePlugin.getDefault().getBundle();
+ Enumeration bundleEntries = bundle
+ .getEntryPaths(IMAGES_DIRECTORY);
+
+
+ while (bundleEntries.hasMoreElements()) {
+ ImageDescriptor descriptor;
+ String localImagePath = (String) bundleEntries
+ .nextElement();
+
+ if(localImagePath.indexOf('.') < 0)
+ continue;
+
+ URL[] files = FileLocator.findEntries(bundle, new Path(
+ localImagePath));
+
+ for (int i = 0; i < files.length; i++) {
+
+ startMeasuring();
+
+ try {
+ descriptor = ImageDescriptor.createFromFile(missing,
+ FileLocator.toFileURL(files[i]).getFile());
+ } catch (IOException e) {
+ fail(e.getLocalizedMessage(),e);
+ continue;
+ }
+
+ for (int j = 0; j < 10; j++) {
+ Image image = descriptor.createImage();
+ images.add(image);
+ }
+
+ processEvents();
+ stopMeasuring();
+
+ }
+
+ }
+
+
+ Iterator imageIterator = images.iterator();
+ while (imageIterator.hasNext()) {
+// ((Image) imageIterator.next()).dispose();
+ }
+ }
+ }, 20, 100, JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/JFacePerformanceSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/JFacePerformanceSuite.java
new file mode 100644
index 0000000000..7c72584939
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/JFacePerformanceSuite.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.UIPerformanceTestSetup;
+
+/**
+ * The JFacePerformanceSuite are the performance tests for JFace.
+ */
+public class JFacePerformanceSuite extends TestSuite {
+
+ //Some of these tests are very slow on 3.0
+ //Specify the minimum number of iterations
+ //and the time to drop down to a lower number
+
+ public static int MAX_TIME = 10000;
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new UIPerformanceTestSetup(new JFacePerformanceSuite());
+ }
+
+ public JFacePerformanceSuite() {
+ super();
+ addTest(new ListViewerRefreshTest("testRefresh"));
+ addTest(new ComboViewerRefreshTest("testRefreshSmall"));
+ addTest(new FastTableViewerRefreshTest("testRefreshMultiple"));
+ addTest(new FastTableViewerRefreshTest("testUpdateMultiple"));
+ addTest(new FastTreeTest("testAddTenTenTimes"));
+ addTest(new FastTreeTest("testAddFiftyTenTimes"));
+ addTest(new TreeAddTest("testAddThousand"));
+ addTest(new FastTreeTest("testAddHundredTenTimes", BasicPerformanceTest.LOCAL));
+ addTest(new TreeAddTest("testAddThousandPreSort", BasicPerformanceTest.GLOBAL));
+ addTest(new ProgressMonitorDialogPerformanceTest("testLongNames"));
+ addTest(new ShrinkingTreeTest("testTreeViewerRefresh"));
+
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListPopulationTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListPopulationTest.java
new file mode 100644
index 0000000000..21da9116a0
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListPopulationTest.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * The ListPopulationTest is the test for simple
+ * SWT lists.
+ *
+ */
+public class ListPopulationTest extends BasicPerformanceTest {
+
+ List list;
+
+ public ListPopulationTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public ListPopulationTest(String testName) {
+ super(testName);
+ }
+
+ protected void openBrowser() {
+ Display fDisplay = Display.getCurrent();
+ if (fDisplay == null) {
+ fDisplay = new Display();
+ }
+ Shell shell = new Shell(fDisplay);
+ shell.setSize(500, 500);
+ shell.setLayout(new FillLayout());
+ list = new List(shell,SWT.NONE);
+ shell.open();
+ // processEvents();
+ }
+
+ public void testSmallAdd() throws Throwable {
+ addBench(100);
+ }
+
+ public void testSmallSetItems() throws Throwable {
+ setItemsBench(100);
+ }
+
+ public void testMediumAdd() throws Throwable {
+ addBench(5000);
+ }
+
+ public void testMediumSetItems() throws Throwable {
+ setItemsBench(5000);
+ }
+
+ public void testLargeAdd() throws Throwable {
+ addBench(50000);
+ }
+
+ public void testLargeSetItems() throws Throwable {
+ setItemsBench(50000);
+ }
+
+ /**
+ * Test the time for adding elements using add.
+ * @throws Throwable
+ */
+ public void addBench(int count) throws Throwable {
+ openBrowser();
+ final String [] items = getItems(count);
+
+ exercise(new TestRunnable() {
+ public void run() {
+ list.removeAll();
+ startMeasuring();
+ for (int j = 0; j < items.length; j++) {
+ list.add(items[j]);
+ }
+ processEvents();
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for adding elements using setItem.
+ * @throws Throwable
+ */
+ public void setItemsBench(int count) throws Throwable {
+ openBrowser();
+ final String [] items = getItems(count);
+ exercise(new TestRunnable() {
+ public void run() {
+ list.removeAll();
+ startMeasuring();
+ list.setItems(items);
+ processEvents();
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Get count number of items.
+ * @param count
+ * @return
+ */
+ private String[] getItems(int count) {
+ String[] items = new String[count];
+ for (int j = 0; j < items.length; j++) {
+ items[j] = "Element " + String.valueOf(j);
+
+ }
+ return items;
+ }
+
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListViewerRefreshTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListViewerRefreshTest.java
new file mode 100644
index 0000000000..9006504692
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListViewerRefreshTest.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * The ListViewerRefreshTest is a test of refreshing the list viewer.
+ *
+ */
+public class ListViewerRefreshTest extends ViewerTest {
+
+ ListViewer viewer;
+
+ private RefreshTestContentProvider contentProvider;
+
+ public ListViewerRefreshTest(String testName, int tagging) {
+ super(testName, tagging);
+
+ }
+
+ public ListViewerRefreshTest(String testName) {
+ super(testName);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.tests.performance.ViewerTest#createViewer(org.eclipse.swt.widgets.Shell)
+ */
+ protected StructuredViewer createViewer(Shell shell) {
+ viewer = new ListViewer(shell);
+ contentProvider = new RefreshTestContentProvider(
+ RefreshTestContentProvider.ELEMENT_COUNT);
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(getLabelProvider());
+ return viewer;
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefresh() throws Throwable {
+
+ tagIfNecessary("JFace - Refresh 100 item ListViewer 10 times",
+ Dimension.ELAPSED_PROCESS);
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=99022>See Bug 99022</a> ");
+
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, ITERATIONS,
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ProgressMonitorDialogPerformanceTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ProgressMonitorDialogPerformanceTest.java
new file mode 100644
index 0000000000..014548100b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ProgressMonitorDialogPerformanceTest.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * @since 3.3
+ *
+ */
+public class ProgressMonitorDialogPerformanceTest extends BasicPerformanceTest {
+
+ /**
+ * @param testName
+ */
+ public ProgressMonitorDialogPerformanceTest(String testName) {
+ super(testName);
+ }
+
+ /**
+ * Create a new instance of the receiver.
+ * @param testName
+ * @param tagging
+ */
+ public ProgressMonitorDialogPerformanceTest(String testName, int tagging) {
+ super(testName, tagging);
+
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testLongNames() throws Throwable {
+
+ tagIfNecessary("JFace - 10000 element task name in progress dialog",
+ Dimension.ELAPSED_PROCESS);
+
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = new Display();
+ }
+
+ ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell(display));
+
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+
+ char[] chars = new char[10000];
+ for (int i = 0; i < chars.length; i++) {
+ chars[i] = 'A';
+ }
+
+ final String taskName = new String(chars);
+ final IProgressMonitor finalMonitor = monitor;
+
+ try {
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ finalMonitor.setTaskName(taskName);
+ processEvents();
+ stopMeasuring();
+ }
+ }, ViewerTest.MIN_ITERATIONS, ViewerTest.ITERATIONS,
+ JFacePerformanceSuite.MAX_TIME);
+ } catch (CoreException e) {
+ fail(e.getMessage(), e);
+ }
+
+
+
+ }
+ };
+
+ try {
+ dialog.run(false, true, runnable);
+ } catch (InvocationTargetException e) {
+ fail(e.getMessage(), e);
+ } catch (InterruptedException e) {
+ fail(e.getMessage(), e);
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestContentProvider.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestContentProvider.java
new file mode 100644
index 0000000000..2c99804656
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestContentProvider.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+/**
+ * The RefreshTestContentProvider is the content
+ * provider for refresh tests.
+ *
+ */
+public class RefreshTestContentProvider implements IStructuredContentProvider {
+
+ static int seed = 1;
+ static TestElement[] allElements;
+ public static int ELEMENT_COUNT = 10000;
+ TestElement[] currentElements;
+
+ static{
+ allElements = new TestElement[ELEMENT_COUNT];
+ for (int i = 0; i < ELEMENT_COUNT; i++) {
+ allElements[i] = new TestElement(i);
+ }
+ }
+
+ void preSortElements(Viewer viewer, ViewerSorter sorter){
+ sorter.sort(viewer,currentElements);
+
+ }
+
+ public RefreshTestContentProvider(int size){
+ Assert.isTrue(size <= ELEMENT_COUNT);
+ setSize(size);
+ }
+
+ /**
+ * Set the size of the amount we are currently displaying
+ * to size.
+ * @param size
+ */
+ public void setSize(int size) {
+
+ currentElements = new TestElement[size];
+ for (int i = 0; i < currentElements.length; i++) {
+ currentElements[i] = allElements[i];
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return currentElements;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ currentElements = null;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ //Do nothing here
+ }
+
+ /**
+ * Restore the elements to thier old poorly sorted
+ * state.
+ *
+ */
+ public void refreshElements() {
+ for (int i = 0; i < ELEMENT_COUNT; i++) {
+ currentElements[i] = new TestElement(i + seed);
+ }
+ seed += 257;
+
+
+ }
+
+ public void cloneElements(){
+ currentElements = (TestElement [] )currentElements.clone();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestTreeContentProvider.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestTreeContentProvider.java
new file mode 100644
index 0000000000..cead70f09b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestTreeContentProvider.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * The RefreshTestTreeContentProvider is the content provider for test trees.
+ */
+public class RefreshTestTreeContentProvider implements ITreeContentProvider {
+
+ static TestTreeElement[] elements;
+ static {
+ elements = new TestTreeElement[RefreshTestContentProvider.ELEMENT_COUNT];
+ for (int i = 0; i < RefreshTestContentProvider.ELEMENT_COUNT; i++) {
+ elements[i] = (new TestTreeElement(i,null));
+
+ }
+
+ }
+
+ public RefreshTestTreeContentProvider() {
+ super();
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ return ((TestTreeElement)parentElement).children;
+ }
+
+ public Object getParent(Object element) {
+ return ((TestTreeElement)element).parent;
+ }
+
+ public boolean hasChildren(Object element) {
+ return ((TestTreeElement)element).children.length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return elements;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/SWTTreeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/SWTTreeTest.java
new file mode 100644
index 0000000000..7164a654e8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/SWTTreeTest.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+public class SWTTreeTest extends BasicPerformanceTest {
+
+ Shell browserShell;
+
+ Tree tree;
+
+ public SWTTreeTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public SWTTreeTest(String testName) {
+ super(testName);
+ }
+
+ protected void openBrowser() {
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = new Display();
+ }
+ browserShell = new Shell(display);
+ browserShell.setSize(500, 500);
+ browserShell.setLayout(new FillLayout());
+ tree = new Tree(browserShell, SWT.NONE);
+ createChildren();
+ browserShell.open();
+ // processEvents();
+ }
+
+ private void createChildren() {
+ for (int i = 0; i < TreeAddTest.TEST_COUNT; i++) {
+ TreeItem item = new TreeItem(tree, SWT.NONE);
+ item.setText("Element " + String.valueOf(i));
+
+ }
+
+ }
+
+ /**
+ * Test the getItems API.
+ *
+ */
+ public void testGetItems() throws CoreException {
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+ processEvents();
+ startMeasuring();
+ for (int j = 0; j < TreeAddTest.TEST_COUNT; j++) {
+ tree.getItems();
+ processEvents();
+ }
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ browserShell.close();
+ }
+
+ /**
+ * @throws CoreException
+ * Test the getItem API.
+ *
+ */
+ public void testGetItemAt() throws CoreException {
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+ processEvents();
+ startMeasuring();
+ for (int j = 0; j < TreeAddTest.TEST_COUNT; j++) {
+ tree.getItem(j);
+ processEvents();
+ }
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ browserShell.close();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ShrinkingTreeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ShrinkingTreeTest.java
new file mode 100644
index 0000000000..8bbe01b13b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ShrinkingTreeTest.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * ShrinkingTreeTest is a test to see how long it takes to refresh a tree that goes
+ * from a large item count to a smaller one.
+ * @since 3.3
+ *
+ */
+public class ShrinkingTreeTest extends TreeTest {
+
+
+ /**
+ * Create a new instance of the receiver.
+ *
+ * @param testName
+ */
+ public ShrinkingTreeTest(String testName) {
+ super(testName);
+ }
+
+ public ShrinkingTreeTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public void testTreeViewerRefresh() throws CoreException {
+
+ tagIfNecessary("JFace - Refresh from 1000 items to 100 items",
+ Dimension.ELAPSED_PROCESS);
+
+ openBrowser();
+// int smallCount = 1;
+// for (int i = 0; i < 3; i++) {
+//
+// int largeCount = smallCount * 10;
+// for (int j = 0; j < 2; j++) {
+// System.out.println("Small " + String.valueOf(smallCount)
+// + "Large " + String.valueOf(largeCount));
+ testRefresh(100, 1000);
+// largeCount *= 10;
+// }
+// smallCount *= 10;
+// }
+ }
+
+ /**
+ * Run the test for one of the fast insertions.
+ *
+ * @param count
+ * @throws CoreException
+ */
+ private void testRefresh(final int smallSize, final int largeSize)
+ throws CoreException {
+
+ exercise(new TestRunnable() {
+ public void run() {
+
+ TestTreeElement input = new TestTreeElement(0, null);
+ viewer.setInput(input);
+ input.createChildren(largeSize);
+
+ processEvents();
+ viewer.refresh();
+ viewer.expandAll();
+ input.createChildren(smallSize);
+ startMeasuring();
+ viewer.refresh();
+
+ stopMeasuring();
+
+ }
+ }, MIN_ITERATIONS, ITERATIONS, JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+
+ }
+
+
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TableViewerRefreshTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TableViewerRefreshTest.java
new file mode 100644
index 0000000000..73ef1e0c41
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TableViewerRefreshTest.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+/**
+ * The TableViewerRefreshTest is a test for refreshing the TableViewer.
+ */
+public class TableViewerRefreshTest extends ViewerTest {
+
+ class TestTableViewer extends TableViewer {
+
+ public TestTableViewer(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public TestTableViewer(Composite parent) {
+ super(parent);
+ }
+
+ public TestTableViewer(Table table) {
+ super(table);
+ }
+
+ public void testUpdateItem(Widget widget, Object element) {
+ updateItem(widget, element);
+ }
+ }
+
+ TestTableViewer viewer;
+
+ private RefreshTestContentProvider contentProvider;
+
+ public TableViewerRefreshTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public TableViewerRefreshTest(String testName) {
+ super(testName);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.tests.performance.ViewerTest#createViewer(org.eclipse.swt.widgets.Shell)
+ */
+ protected StructuredViewer createViewer(Shell shell) {
+ viewer = new TestTableViewer(shell);
+ contentProvider = new RefreshTestContentProvider(
+ RefreshTestContentProvider.ELEMENT_COUNT);
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(getLabelProvider());
+ return viewer;
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefresh() throws Throwable {
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(),
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefreshSorted() throws Throwable {
+ openBrowser();
+ viewer.setSorter(new ViewerSorter());
+
+ exercise(new TestRunnable() {
+ public void run() {
+ startMeasuring();
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(),
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testRefreshPreSorted() throws Throwable {
+ openBrowser();
+ final ViewerSorter sorter = new ViewerSorter();
+ viewer.setSorter(sorter);
+
+ exercise(new TestRunnable() {
+ public void run() {
+ contentProvider.refreshElements();
+ startMeasuring();
+ contentProvider.cloneElements();
+ contentProvider.preSortElements(viewer, sorter);
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+ }, MIN_ITERATIONS, ITERATIONS,
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ *
+ * @throws Throwable
+ */
+ public void testUpdate() throws Throwable {
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+
+ TableItem[] items = viewer.getTable().getItems();
+ startMeasuring();
+ for (int j = 0; j < items.length; j++) {
+ TableItem item = items[j];
+ Object element = RefreshTestContentProvider.allElements[j];
+
+ viewer.testUpdateItem(item, element);
+
+ }
+ processEvents();
+ stopMeasuring();
+
+ }
+ }, MIN_ITERATIONS, slowGTKIterations(),
+ JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestElement.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestElement.java
new file mode 100644
index 0000000000..4ebbb3fd67
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestElement.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+/**
+ * The TestElement is the element used for testing
+ * viewers.
+ *
+ */
+public class TestElement {
+
+ String name;
+
+ /**
+ * Create a new instance of the receiver.
+ *
+ */
+ public TestElement() {
+ super();
+ }
+
+ /**
+ * Create a new instance of the receiver.
+ *
+ * @param index
+ */
+ public TestElement(int index) {
+ name = TestTreeElement.generateFirstEntry() + String.valueOf(index);
+ }
+
+ public String getText() {
+ return name;
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestTreeElement.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestTreeElement.java
new file mode 100644
index 0000000000..faf74726ea
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestTreeElement.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+
+public class TestTreeElement extends TestElement {
+
+ TestTreeElement parent;
+
+ TestTreeElement[] children = new TestTreeElement[0];
+
+ private static int index = 0;
+
+ static String characters = "M1NqBwV2CeXrZ3LtKyJ4HuGiF5DoSpA6PaOsI7UdYfT8RgEhW9Qjk0DlWzMxUcsvfbwnm";
+
+ /**
+ * Create a new instance of the receiver .
+ *
+ * @param index
+ * @param treeParent
+ */
+ public TestTreeElement(int index, TestTreeElement treeParent) {
+ super();
+ this.parent = treeParent;
+ name = generateFirstEntry() + String.valueOf(index);
+ }
+
+ /**
+ * Generate a random string.
+ *
+ * @return String
+ */
+ static String generateFirstEntry() {
+
+ String next = characters.substring(index);
+ index++;
+ if (index > characters.length() - 2)
+ index = 0;
+ return next;
+ }
+
+ /**
+ * Create count number of children in the receiver.
+ *
+ * @param count
+ */
+ public void createChildren(int count) {
+ children = new TestTreeElement[count];
+ for (int i = 0; i < count; i++) {
+ children[i] = new TestTreeElement(i, this);
+ }
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeAddTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeAddTest.java
new file mode 100644
index 0000000000..87f7ef2f88
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeAddTest.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.tests.performance;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.tests.performance.TestRunnable;
+
+public class TreeAddTest extends TreeTest {
+
+ static int TEST_COUNT = 1000;
+
+ public TreeAddTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public TreeAddTest(String testName) {
+ super(testName);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddOneAtATime() {
+ openBrowser();
+
+ for (int i = 0; i < ITERATIONS / 10; i++) {
+ TestTreeElement input = new TestTreeElement(0, null);
+ viewer.setInput(input);
+ input.createChildren(TEST_COUNT);
+ processEvents();
+ startMeasuring();
+ for (int j = 0; j < input.children.length; j++) {
+
+ viewer.add(input, input.children[j]);
+ processEvents();
+
+ }
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddTen() throws CoreException {
+
+ doTestAdd(10, TEST_COUNT, false);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddFifty() throws CoreException {
+
+ doTestAdd(50, TEST_COUNT, false);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddHundred() throws CoreException {
+
+ tagIfNecessary("JFace - Add 1000 items in 10 blocks to TreeViewer",
+ Dimension.ELAPSED_PROCESS);
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=101853>See Bug 101853</a> ");
+
+ doTestAdd(100, TEST_COUNT, false);
+ }
+
+ /**
+ * Run the test for one of the fast insertions.
+ *
+ * @param count
+ * @throws CoreException
+ */
+ protected void doTestAdd(final int increment, final int total,final boolean preSort)
+ throws CoreException {
+
+ openBrowser();
+
+ exercise(new TestRunnable() {
+ public void run() {
+
+ TestTreeElement input = new TestTreeElement(0, null);
+ viewer.setInput(input);
+ input.createChildren(total);
+ if (preSort)
+ viewer.getSorter().sort(viewer, input.children);
+ Collection batches = new ArrayList();
+ int blocks = input.children.length / increment;
+ for (int j = 0; j < blocks; j = j + increment) {
+ Object[] batch = new Object[increment];
+ System.arraycopy(input.children, j * increment, batch, 0,
+ increment);
+ batches.add(batch);
+ }
+ processEvents();
+ Object[] batchArray = batches.toArray();
+ startMeasuring();
+
+ // Measure more than one for the fast cases
+ for (int k = 0; k < batchArray.length; k++) {
+ viewer.add(input, (Object[]) batchArray[k]);
+ processEvents();
+ }
+
+ stopMeasuring();
+
+ }
+ }, MIN_ITERATIONS, ITERATIONS, JFacePerformanceSuite.MAX_TIME);
+
+ commitMeasurements();
+ assertPerformance();
+
+ }
+
+ /**
+ * Test addition to the tree.
+ */
+ public void testAddThousand() throws CoreException {
+ doTestAdd(1000, 2000, false);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree one element at a time.
+ */
+ public void testAddTwoThousand() throws CoreException {
+
+ doTestAdd(2000, 4000, false);
+
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree with the items presorted.
+ */
+ public void testAddHundredPreSort() throws CoreException {
+
+ doTestAdd(100, 1000, true);
+ }
+
+ /**
+ * @throws CoreException
+ * Test addition to the tree with the items presorted.
+ */
+ public void testAddThousandPreSort() throws CoreException {
+ tagIfNecessary("JFace - Add 2000 items in 2 blocks to TreeViewer",
+ Dimension.ELAPSED_PROCESS);
+
+ doTestAdd(1000, 2000, true);
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeTest.java
new file mode 100644
index 0000000000..ab625400e8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeTest.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @since 3.3
+ *
+ */
+public abstract class TreeTest extends ViewerTest {
+
+
+
+ TreeViewer viewer;
+
+ /**
+ * Create a new instance of the receiver.
+ * @param testName
+ * @param tagging
+ */
+ public TreeTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ /**
+ * Create a new instance of the receiver.
+ * @param testName
+ */
+ public TreeTest(String testName) {
+ super(testName);
+ }
+
+
+ protected StructuredViewer createViewer(Shell shell) {
+ viewer = createTreeViewer(shell);
+ viewer.setContentProvider(getContentProvider());
+ viewer.setLabelProvider(getLabelProvider());
+ viewer.setSorter(new ViewerSorter());
+ viewer.setUseHashlookup(true);
+ return viewer;
+ }
+
+ /**
+ * Create the tree viewer
+ * @return
+ */
+ protected TreeViewer createTreeViewer(Shell shell) {
+ return new TreeViewer(shell);
+ }
+
+ protected Object getInitialInput() {
+ return new TestTreeElement(0, null);
+ }
+
+ private IContentProvider getContentProvider() {
+ return new ITreeContentProvider() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object parentElement) {
+ TestTreeElement element = (TestTreeElement) parentElement;
+ return element.children;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ public Object getParent(Object element) {
+ return ((TestTreeElement) element).parent;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element) {
+ return ((TestTreeElement) element).children.length > 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ // Do nothing here
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer localViewer, Object oldInput,
+ Object newInput) {
+ // Do nothing here
+ }
+
+ };
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeViewerRefreshTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeViewerRefreshTest.java
new file mode 100644
index 0000000000..b5ec9767d2
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeViewerRefreshTest.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * The TreeViewerRefreshTest is the refresh test for
+ * tree viewers.
+ *
+ */
+public class TreeViewerRefreshTest extends ViewerTest {
+
+ TreeViewer viewer;
+ private RefreshTestTreeContentProvider contentProvider;
+
+ public TreeViewerRefreshTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public TreeViewerRefreshTest(String testName) {
+ super(testName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.tests.performance.ViewerTest#createViewer(org.eclipse.swt.widgets.Shell)
+ */
+ protected StructuredViewer createViewer(Shell shell) {
+ viewer = new TreeViewer(shell);
+ contentProvider = new RefreshTestTreeContentProvider();
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(getLabelProvider());
+ return viewer;
+ }
+
+ /**
+ * Test the time for doing a refresh.
+ * @throws Throwable
+ */
+ public void testRefresh() throws Throwable {
+ openBrowser();
+
+ for (int i = 0; i < ITERATIONS; i++) {
+ startMeasuring();
+ viewer.refresh();
+ processEvents();
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ }
+
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ViewerTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ViewerTest.java
new file mode 100644
index 0000000000..a409ad184a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/jface/tests/performance/ViewerTest.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jface.tests.performance;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+
+/**
+ * The LinearViewerTest is a test that tests viewers.
+ *
+ */
+public abstract class ViewerTest extends BasicPerformanceTest {
+
+ Shell browserShell;
+
+ public static int ITERATIONS = 100;
+ public static int MIN_ITERATIONS = 20;
+
+ public ViewerTest(String testName, int tagging) {
+ super(testName, tagging);
+ }
+
+ public ViewerTest(String testName) {
+ super(testName);
+ }
+
+ protected void openBrowser() {
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = new Display();
+ }
+ browserShell = new Shell(display);
+ browserShell.setSize(500, 500);
+ browserShell.setLayout(new FillLayout());
+ StructuredViewer viewer = createViewer(browserShell);
+ viewer.setUseHashlookup(true);
+ viewer.setInput(getInitialInput());
+ browserShell.open();
+ // processEvents();
+ }
+
+ /**
+ * Get the initial input for the receiver.
+ * @return
+ */
+ protected Object getInitialInput() {
+ return this;
+ }
+
+ /**
+ * Create the viewer we are testing.
+ * @param aShell
+ * @return
+ */
+ protected abstract StructuredViewer createViewer(Shell shell);
+
+ public ILabelProvider getLabelProvider() {
+ return new LabelProvider() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ return ((TestElement) element).getText();
+ }
+
+ };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.util.UITestCase#doTearDown()
+ */
+ protected void doTearDown() throws Exception {
+ super.doTearDown();
+ if(browserShell!= null){
+ browserShell.close();
+ browserShell = null;
+ }
+ }
+
+ /**
+ * Return the number of iterations for tests that are slow on Linux
+ * @return int
+ */
+ public int slowGTKIterations(){
+// if(SWT.getPlatform().equals("gtk"))
+// return ITERATIONS / 5;
+ return ITERATIONS;
+ }
+
+
+ /**
+ * Return the number of iterations for tests that are slow on Linux
+ * @return int
+ */
+ public int slowWindowsIterations(){
+// if(SWT.getPlatform().equals("win32"))
+// return ITERATIONS / 5;
+ return ITERATIONS;
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ActivitiesPerformanceSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ActivitiesPerformanceSuite.java
new file mode 100644
index 0000000000..fc21369cd7
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ActivitiesPerformanceSuite.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @since 3.1
+ *
+ */
+public class ActivitiesPerformanceSuite extends TestSuite {
+
+
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new ActivitiesPerformanceSuite();
+ }
+
+ /**
+ *
+ */
+ public ActivitiesPerformanceSuite() {
+ super();
+ addTest(new GenerateIdentifiersTest(10000));
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/BasicPerformanceTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/BasicPerformanceTest.java
new file mode 100644
index 0000000000..5d529b2da6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/BasicPerformanceTest.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.tests.harness.util.UITestCase;
+
+/**
+ * Baseclass for simple performance tests.
+ *
+ * @since 3.1
+ */
+public abstract class BasicPerformanceTest extends UITestCase {
+
+ public static final int NONE = 0;
+
+ public static final int LOCAL = 1;
+
+ public static final int GLOBAL = 2;
+
+ private PerformanceTester tester;
+
+ private IProject testProject;
+
+ final private boolean tagAsGlobalSummary;
+
+ final private boolean tagAsSummary;
+
+ public BasicPerformanceTest(String testName) {
+ this(testName, NONE);
+ }
+
+ /**
+ * @param testName
+ */
+ public BasicPerformanceTest(String testName, int tagging) {
+ super(testName);
+ tagAsGlobalSummary = ((tagging & GLOBAL) != 0);
+ tagAsSummary = ((tagging & LOCAL) != 0);
+ }
+
+ /**
+ * Answers whether this test should be tagged globally.
+ *
+ * @return whether this test should be tagged globally
+ */
+ private boolean shouldGloballyTag() {
+ return tagAsGlobalSummary;
+ }
+
+ /**
+ * Answers whether this test should be tagged locally.
+ *
+ * @return whether this test should be tagged locally
+ */
+ private boolean shouldLocallyTag() {
+ return tagAsSummary;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.tests.util.UITestCase#doSetUp()
+ */
+ protected void doSetUp() throws Exception {
+ super.doSetUp();
+ tester = new PerformanceTester(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.tests.util.UITestCase#doTearDown()
+ */
+ protected void doTearDown() throws Exception {
+ super.doTearDown();
+ tester.dispose();
+ }
+
+ protected IProject getProject() {
+ if (testProject == null) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ testProject = workspace.getRoot().getProject(
+ UIPerformanceTestSetup.PROJECT_NAME);
+ }
+ return testProject;
+ }
+
+ /**
+ * Asserts default properties of the measurements captured for this test
+ * case.
+ *
+ * @throws RuntimeException
+ * if the properties do not hold
+ */
+ public void assertPerformance() {
+ tester.assertPerformance();
+ }
+
+ /**
+ * Asserts that the measurement specified by the given dimension is within a
+ * certain range with respect to some reference value. If the specified
+ * dimension isn't available, the call has no effect.
+ *
+ * @param dim
+ * the Dimension to check
+ * @param lowerPercentage
+ * a negative number indicating the percentage the measured value
+ * is allowed to be smaller than some reference value
+ * @param upperPercentage
+ * a positive number indicating the percentage the measured value
+ * is allowed to be greater than some reference value
+ * @throws RuntimeException
+ * if the properties do not hold
+ */
+ public void assertPerformanceInRelativeBand(Dimension dim,
+ int lowerPercentage, int upperPercentage) {
+ tester.assertPerformanceInRelativeBand(dim, lowerPercentage,
+ upperPercentage);
+ }
+
+ public void commitMeasurements() {
+ tester.commitMeasurements();
+ }
+
+ /**
+ * Called from within a test case immediately before the code to measure is
+ * run. It starts capturing of performance data. Must be followed by a call
+ * to {@link PerformanceTestCase#stopMeasuring()}before subsequent calls to
+ * this method or {@link PerformanceTestCase#commitMeasurements()}.
+ */
+ public void startMeasuring() {
+ tester.startMeasuring();
+ }
+
+ public void stopMeasuring() {
+ tester.stopMeasuring();
+ }
+
+ /**
+ * Mark the scenario of this test case to be included into the global
+ * performance summary. The summary shows the given dimension of the
+ * scenario and labels the scenario with the short name.
+ *
+ * @param shortName
+ * a short (shorter than 40 characters) descritive name of the
+ * scenario
+ * @param dimension
+ * the dimension to show in the summary
+ */
+ private void tagAsGlobalSummary(String shortName, Dimension dimension) {
+ System.out.println("GLOBAL " + shortName);
+ tester.tagAsGlobalSummary(shortName, dimension);
+ }
+
+ private void tagAsSummary(String shortName, Dimension dimension) {
+ System.out.println("LOCAL " + shortName);
+ tester.tagAsSummary(shortName, dimension);
+ }
+
+ public void tagIfNecessary(String shortName, Dimension dimension) {
+ if (shouldGloballyTag()) {
+ tagAsGlobalSummary(shortName, dimension);
+ }
+ if (shouldLocallyTag()) {
+ tagAsSummary(shortName, dimension);
+ }
+ }
+
+ public static void waitForBackgroundJobs() {
+
+ Job backgroundJob = new Job(
+ "This is a test job which sits around being low priority until everything else finishes") {
+ protected IStatus run(IProgressMonitor monitor) {
+ return Status.OK_STATUS;
+ }
+ };
+
+ backgroundJob.setPriority(Job.DECORATE);
+
+ boolean hadEvents = true;
+ Display display = PlatformUI.getWorkbench().getDisplay();
+ if (display != null) {
+ while (hadEvents) {
+ hadEvents = false;
+ // Join a low priority job then spin the event loop
+ backgroundJob.schedule(0);
+ try {
+ backgroundJob.join();
+ } catch (InterruptedException e) {
+ }
+
+ while (display.readAndDispatch()) {
+ hadEvents = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * Runs the given runnable until either 100 iterations or 4s has elapsed.
+ * Runs a minimum of 3 times.
+ *
+ * @param runnable
+ * @since 3.1
+ */
+ public static void exercise(TestRunnable runnable) throws CoreException {
+ exercise(runnable, 3, 100, 4000);
+ }
+
+ /**
+ * Exercises the given runnable until either the given number of iterations
+ * or the given amount of time has elapsed, whatever occurs first.
+ *
+ * @param runnable
+ * @param maxIterations
+ * @param maxTime
+ * @since 3.1
+ */
+ public static void exercise(TestRunnable runnable, int minIterations,
+ int maxIterations, int maxTime) throws CoreException {
+ long startTime = System.currentTimeMillis();
+
+ for (int counter = 0; counter < maxIterations; counter++) {
+
+ try {
+ runnable.run();
+ } catch (Exception e) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ UIPerformancePlugin.getDefault().getBundle()
+ .getSymbolicName(), IStatus.OK,
+ "An exception occurred", e));
+ }
+
+ long curTime = System.currentTimeMillis();
+ if (curTime - startTime > maxTime && counter >= minIterations - 1) {
+ break;
+ }
+ }
+ }
+
+ /**
+ * Set the comment for the receiver to string. Note this is added to the
+ * output as is so you will need to add markup if you need a link.
+ *
+ * @param string
+ * The comment to write out for the test.
+ */
+ public void setDegradationComment(String string) {
+ tester.setDegradationComment(string);
+
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/CommandsPerformanceTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/CommandsPerformanceTest.java
new file mode 100644
index 0000000000..5459daaa87
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/CommandsPerformanceTest.java
@@ -0,0 +1,474 @@
+///*******************************************************************************
+// * Copyright (c) 2000, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import java.util.ArrayList;
+//import java.util.HashSet;
+//import java.util.List;
+//import java.util.Locale;
+//import java.util.Set;
+//
+//import org.eclipse.core.commands.Command;
+//import org.eclipse.core.commands.CommandManager;
+//import org.eclipse.core.commands.ParameterizedCommand;
+//import org.eclipse.core.commands.common.NotDefinedException;
+//import org.eclipse.core.commands.contexts.Context;
+//import org.eclipse.core.commands.contexts.ContextManager;
+//import org.eclipse.jface.bindings.Binding;
+//import org.eclipse.jface.bindings.BindingManager;
+//import org.eclipse.jface.bindings.Scheme;
+//import org.eclipse.jface.bindings.keys.IKeyLookup;
+//import org.eclipse.jface.bindings.keys.KeyBinding;
+//import org.eclipse.jface.bindings.keys.KeyLookupFactory;
+//import org.eclipse.jface.bindings.keys.KeySequence;
+//import org.eclipse.jface.bindings.keys.KeyStroke;
+//import org.eclipse.jface.bindings.keys.ParseException;
+//import org.eclipse.swt.SWT;
+//
+///**
+// * <p>
+// * Responsible for testing the commands, contexts and bindings architecture.
+// * This test does not rely on the existence of the workbench; it operates purely
+// * on JFace code and lower. See the method comments for descriptions of the
+// * currently supported performance tests.
+// * </p>
+// *
+// * @since 3.1
+// */
+//public final class CommandsPerformanceTest extends BasicPerformanceTest {
+//
+// /**
+// * <p>
+// * Constructs a branch of a context tree. This creates a branch of the given
+// * depth -- remembering the identifiers along the way. This method operates
+// * recursively.
+// * </p>
+// * <p>
+// * TODO This should add a bit of breadth to the tree.
+// * </p>
+// *
+// * @param contextManager
+// * The context manager in which the contexts should be defined;
+// * must not be <code>null</code>.
+// * @param parent
+// * The parent context identifier for the context to be created;
+// * may be <code>null</code>.
+// * @param successors
+// * The number of successors to create. The depth of the branch to
+// * be created. If this number is zero, then a context is created,
+// * but no recursive call is made.
+// * @param activeContextIds
+// * The list of active context identifiers; must not be
+// * <code>null</code>.
+// */
+// private static final void createContext(
+// final ContextManager contextManager, final String parent,
+// final int successors, final List activeContextIds) {
+// final int count = activeContextIds.size();
+// final String contextString = "context" + count;
+// final Context context = contextManager.getContext(contextString);
+// context.define(contextString, contextString, parent);
+// activeContextIds.add(contextString);
+//
+// if (successors == 0) {
+// return;
+// }
+//
+// createContext(contextManager, contextString, successors - 1,
+// activeContextIds);
+// }
+//
+// /**
+// * <p>
+// * Constructs a branch of a scheme tree. This creates a branch of the given
+// * depth -- remembering the schemes along the way. This method operates
+// * recursively.
+// * </p>
+// * <p>
+// * TODO This should add a bit of breadth to the tree.
+// * </p>
+// *
+// * @param bindingManager
+// * The binding manager in which the schemes should be defined;
+// * must not be <code>null</code>.
+// * @param parent
+// * The parent scheme identifier for the scheme to be created; may
+// * be <code>null</code>.
+// * @param successors
+// * The number of successors to create. The depth of the branch to
+// * be created. If this number is zero, then a scheme is created,
+// * but no recursive call is made.
+// * @param schemes
+// * The list of created schemes; must not be <code>null</code>.
+// */
+// private static final void createScheme(final BindingManager bindingManager,
+// final String parent, final int successors, final List schemes) {
+// final int count = schemes.size();
+// final String schemeString = "scheme" + count;
+// final Scheme scheme = bindingManager.getScheme(schemeString);
+// scheme.define(schemeString, schemeString, parent);
+// schemes.add(scheme);
+//
+// if (successors == 0) {
+// return;
+// }
+//
+// createScheme(bindingManager, schemeString, successors - 1, schemes);
+// }
+//
+// /**
+// * The binding manager for the currently running test. <code>null</code>
+// * if no test is running.
+// */
+// private BindingManager bindingManager = null;
+//
+// /**
+// * The command manager for the currently running test. <code>null</code>
+// * if no test is running.
+// */
+// private CommandManager commandManager = null;
+//
+// /**
+// * The context manager for the currently running test. <code>null</code>
+// * if no test is running.
+// */
+// private ContextManager contextManager = null;
+//
+// /**
+// * Constructs an instance of <code>CommandsPerformanceTest</code>.
+// *
+// * @param testName
+// * Test's name.
+// */
+// public CommandsPerformanceTest(final String name) {
+// super(name);
+// }
+//
+// /**
+// * <p>
+// * Sets up a sufficiently complex set of bindings.
+// * </p>
+// * <p>
+// * At the time of writing, Eclipse's key binding set contains about five
+// * hundred bindings. Of these, 140 specify platform information, while only
+// * 5 specify locale information. About 40 are deletion markers. The deepest
+// * point in the context tree is four levels. There are two schemes.
+// * </p>
+// * <p>
+// * The test binding set contains five thousand bindings. About 1400 specify
+// * either locale or platform information. Five hundred are deletion markers.
+// * The deepest point in the context tree is 40 levels. There are twenty
+// * schemes.
+// * </p>
+// * <p>
+// * The depth of the locale and platform tree is the same in both real life
+// * and the test case. It is difficult to imagine why the locale list would
+// * ever be anything but four elements, or why the platform list would ever
+// * be anything but three elements.
+// * </p>
+// *
+// * @throws NotDefinedException
+// * If something went wrong initializing the active scheme.
+// */
+// protected final void doSetUp() throws NotDefinedException, Exception {
+// super.doSetUp();
+//
+// /*
+// * The constants to use in creating the various objects. The platform
+// * locale count must be greater than or equal to the number of deletion
+// * markers. Deletion markers are typically created based on the platform
+// * or locale.
+// */
+// final int contextTreeDepth = 40;
+// final int schemeDepth = 20;
+// final int bindingCount = 5000;
+// final int platformLocaleCount = 1400;
+// final int deletionMarkers = 500;
+// final String currentLocale = Locale.getDefault().toString();
+// final String currentPlatform = SWT.getPlatform();
+//
+// // Set-up a table of modifier keys.
+// final IKeyLookup lookup = KeyLookupFactory.getDefault();
+// final int modifierKeys0 = 0;
+// final int modifierKeys1 = lookup.getAlt();
+// final int modifierKeys2 = lookup.getCommand();
+// final int modifierKeys3 = lookup.getCtrl();
+// final int modifierKeys4 = lookup.getShift();
+// final int modifierKeys5 = lookup.getAlt() | lookup.getCommand();
+// final int modifierKeys6 = lookup.getAlt() | lookup.getCtrl();
+// final int modifierKeys7 = lookup.getAlt() | lookup.getShift();
+// final int modifierKeys8 = lookup.getCommand() | lookup.getCtrl();
+// final int modifierKeys9 = lookup.getCommand() | lookup.getShift();
+// final int modifierKeys10 = lookup.getCtrl() | lookup.getShift();
+// final int modifierKeys11 = lookup.getAlt() | lookup.getCommand()
+// | lookup.getCtrl();
+// final int modifierKeys12 = lookup.getAlt() | lookup.getCommand()
+// | lookup.getShift();
+// final int modifierKeys13 = lookup.getAlt() | lookup.getCtrl()
+// | lookup.getShift();
+// final int modifierKeys14 = lookup.getCommand() | lookup.getCtrl()
+// | lookup.getShift();
+// final int modifierKeys15 = lookup.getAlt() | lookup.getCommand()
+// | lookup.getCtrl() | lookup.getShift();
+// final int[] modifierKeyTable = { modifierKeys0, modifierKeys1,
+// modifierKeys2, modifierKeys3, modifierKeys4, modifierKeys5,
+// modifierKeys6, modifierKeys7, modifierKeys8, modifierKeys9,
+// modifierKeys10, modifierKeys11, modifierKeys12, modifierKeys13,
+// modifierKeys14, modifierKeys15 };
+//
+// // Initialize the command manager.
+// commandManager = new CommandManager();
+//
+// // Initialize the contexts.
+// contextManager = new ContextManager();
+// final List activeContextIds = new ArrayList();
+// createContext(contextManager, null, contextTreeDepth, activeContextIds);
+// contextManager.setActiveContextIds(new HashSet(activeContextIds));
+//
+// // Initialize the schemes.
+// bindingManager = new BindingManager(contextManager, commandManager);
+// final List schemes = new ArrayList();
+// createScheme(bindingManager, null, schemeDepth, schemes);
+// bindingManager
+// .setActiveScheme((Scheme) schemes.get(schemes.size() - 1));
+//
+// // Create the deletion markers.
+// final Binding[] bindings = new Binding[bindingCount];
+// for (int i = 0; i < deletionMarkers; i++) {
+// /*
+// * Set-up the locale and platform. These are based on the numbers
+// * given above.
+// */
+// String locale = null;
+// String platform = null;
+//
+// if (i < platformLocaleCount) {
+// switch (i % 4) {
+// case 0:
+// locale = currentLocale;
+// break;
+// case 1:
+// platform = currentPlatform;
+// break;
+// case 2:
+// locale = "gibberish";
+// break;
+// case 3:
+// platform = "gibberish";
+// break;
+// }
+// }
+//
+// // Build a key sequence.
+// final char character = (char) ('A' + (i % 26));
+// final int modifierKeys = modifierKeyTable[(i / 26)
+// % modifierKeyTable.length];
+// final KeyStroke keyStroke = KeyStroke.getInstance(modifierKeys,
+// character);
+// final KeySequence keySequence = KeySequence.getInstance(keyStroke);
+//
+// // Build the other parameters.
+// final String schemeId = ((Scheme) schemes.get(i % schemes.size()))
+// .getId();
+// final String contextId = (String) activeContextIds.get(i
+// % activeContextIds.size());
+// final int type = (i % 2);
+//
+// // Construct the binding.
+// final Binding binding = new KeyBinding(keySequence, null, schemeId,
+// contextId, locale, platform, null, type);
+// bindings[i] = binding;
+// }
+//
+// /*
+// * Now create the regular bindings. By using the same loop structure and
+// * resetting the index to zero, we ensure that the deletion markers will
+// * actually delete something.
+// */
+// for (int i = 0; i < bindingCount - deletionMarkers; i++) {
+// /*
+// * Set-up the locale and platform for those bindings that will not
+// * be used to match the above deletion markers. These are based on
+// * the numbers given above.
+// */
+// String locale = null;
+// String platform = null;
+//
+// if ((i > deletionMarkers) && (i < platformLocaleCount)) {
+// switch (i % 4) {
+// case 0:
+// locale = currentLocale;
+// break;
+// case 1:
+// platform = currentPlatform;
+// break;
+// case 2:
+// locale = "gibberish";
+// break;
+// case 3:
+// platform = "gibberish";
+// break;
+// }
+// }
+//
+// // Build a key sequence.
+// final char character = (char) ('A' + (i % 26));
+// final int modifierKeys = modifierKeyTable[(i / 26)
+// % modifierKeyTable.length];
+// final KeyStroke keyStroke = KeyStroke.getInstance(modifierKeys,
+// character);
+// final KeySequence keySequence = KeySequence.getInstance(keyStroke);
+//
+// // Build the other parameters.
+// final String commandId = "command" + i;
+// final String schemeId = ((Scheme) schemes.get(i % schemes.size()))
+// .getId();
+// final String contextId = (String) activeContextIds.get(i
+// % activeContextIds.size());
+// final int type = (i % 2);
+//
+// // Construct the binding.
+// final Command command = commandManager.getCommand(commandId);
+// final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(
+// command, null);
+// final Binding binding = new KeyBinding(keySequence,
+// parameterizedCommand, schemeId, contextId, locale,
+// platform, null, type);
+// bindings[i + deletionMarkers] = binding;
+// }
+// bindingManager.setBindings(bindings);
+// }
+//
+// protected final void doTearDown() throws Exception {
+// bindingManager = null;
+// commandManager = null;
+// contextManager = null;
+// super.doTearDown();
+// }
+//
+// /**
+// * <p>
+// * Tests how long it takes to access the cache if no conditions have
+// * changed. It measures how long it takes to look up the computation from
+// * the cache one million times.
+// * </p>
+// *
+// * @throws ParseException
+// * If "CTRL+F" can't be parsed for some strange reason.
+// */
+// public final void testBindingCacheHitHard() throws ParseException {
+// // Constants
+// final int cacheHits = 1000000;
+// final KeySequence keySequence = KeySequence.getInstance("CTRL+F");
+//
+// // Compute once.
+// bindingManager.getPartialMatches(keySequence);
+//
+// // Time how long it takes to access the cache;
+// startMeasuring();
+// for (int i = 0; i < cacheHits; i++) {
+// bindingManager.getPartialMatches(keySequence);
+// }
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// /**
+// * <p>
+// * Tests how long it takes to access the cache if no conditions have
+// * changed. It measures how long it takes to look up the computation from
+// * the cache one million times. In this test, the look-up is done in reverse --
+// * from command identifier to trigger.
+// * </p>
+// *
+// * @throws ParseException
+// * If "CTRL+F" can't be parsed for some strange reason.
+// */
+// public final void testBindingCacheHitHardReverse() throws ParseException {
+// // Constants
+// final int cacheHits = 1000000;
+// final KeySequence keySequence = KeySequence.getInstance("CTRL+F");
+//
+// // Compute once.
+// bindingManager.getPartialMatches(keySequence);
+//
+// // Time how long it takes to access the cache;
+// startMeasuring();
+// for (int i = 0; i < cacheHits; i++) {
+// bindingManager.getActiveBindingsFor((ParameterizedCommand) null);
+// }
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// /**
+// * <p>
+// * Tests how long it takes to access the cache if the conditions have
+// * changed, but the cache contains a matching entry. It measures how long it
+// * takes to look up the computation from the cache forty thousand times.
+// * </p>
+// *
+// * @throws ParseException
+// * If "CTRL+F" can't be parsed for some strange reason.
+// */
+// public final void testBindingCacheHitSoft() throws ParseException {
+// // Constants
+// final int cacheHits = 10000;
+// final KeySequence keySequence = KeySequence.getInstance("CTRL+F");
+//
+// // Compute once for each context set.
+// final Set contextSet1 = contextManager.getActiveContextIds();
+// bindingManager.getPartialMatches(keySequence);
+// final List contextList = new ArrayList(contextSet1);
+// contextList.remove(contextList.size() - 1);
+// final Set contextSet2 = new HashSet(contextList);
+// contextManager.setActiveContextIds(contextSet2);
+// bindingManager.getPartialMatches(keySequence);
+//
+// // Time how long it takes to access the cache;
+// startMeasuring();
+// for (int i = 0; i < cacheHits; i++) {
+// if ((i % 2) == 0) {
+// contextManager.setActiveContextIds(contextSet1);
+// } else {
+// contextManager.setActiveContextIds(contextSet2);
+// }
+// bindingManager.getPartialMatches(keySequence);
+// }
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// /**
+// * <p>
+// * Tests how long it takes to do a full computation (i.e., a cache miss) on
+// * an exceptionally large set of bindings. The binding set tries to mimick
+// * some of the same properties of a "real" binding set.
+// * </p>
+// *
+// * @throws ParseException
+// * If "CTRL+F" can't be parsed for some strange reason.
+// */
+// public final void testBindingCacheMissLarge() throws ParseException {
+// // Constants
+// final KeySequence keySequence = KeySequence.getInstance("CTRL+F");
+//
+// // Time how long it takes to solve the binding set.
+// startMeasuring();
+// bindingManager.getPartialMatches(keySequence);
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ContentDescriberForTestsOnly.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ContentDescriberForTestsOnly.java
new file mode 100644
index 0000000000..001769dc15
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ContentDescriberForTestsOnly.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescriber;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.ITextContentDescriber;
+
+/**
+ * This test ContentDescriber added specifically for OpenNavigatorFolderTest.
+ *
+ */
+
+public final class ContentDescriberForTestsOnly implements ITextContentDescriber {
+
+ /*
+ * this "simulated time" represents how long a content describer might
+ * take parsing a file. Offhand (i.e. just guessing) 2000 msecs would be "bad case" examples.
+ * 20 msecs would be near a good, optimistic case.
+ * I've picked 75 msecs for this test, to represent "normal" case
+ * (such as the HTML parser that gave rise to the original bug :)
+ *
+ * Note: unlike a "real" ContentDescriber, this one only effects "elapsed
+ * time", not "CPU Time", since all it is doing is sleeping.
+ */
+ private static final int SIMULATED_CALCULATION_TIME = 75;
+ private static final QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK};
+
+ public int describe(InputStream contents, IContentDescription description) throws IOException {
+ int result = IContentDescriber.INDETERMINATE;
+
+ if (description == null) {
+ result = computeValidity(contents);
+ }
+ else {
+ calculateSupportedOptions(contents, description);
+ // assummming we should return same 'validity' value we did
+ // when called before. (technically, could be a performance issue
+ // in future, so might want to check if any 'ol value would
+ // be ok here.
+ result = computeValidity(contents);
+ }
+
+ return result;
+ }
+
+ public int describe(Reader contents, IContentDescription description) throws IOException {
+ int result = IContentDescriber.INDETERMINATE;
+
+ if (description == null) {
+ result = computeValidity(contents);
+ }
+ else {
+ calculateSupportedOptions(contents, description);
+ // assummming we should return same 'validity' value we did
+ // when called before. (technically, could be a performance issue
+ // in future, so might want to check if hard coded 'valid' would
+ // be ok here.
+ result = computeValidity(contents);
+ }
+
+ return result;
+ }
+
+ public QualifiedName[] getSupportedOptions() {
+
+ return SUPPORTED_OPTIONS;
+ }
+
+ private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
+ if (isRelevent(description)) {
+ makeBusy();
+ }
+ }
+
+ private void makeBusy() {
+ // for this test "content type", we don't
+ // really calculate anything. We just
+ // just take a long time doing nothing.
+ try {
+ Thread.sleep(SIMULATED_CALCULATION_TIME);
+ }
+ catch (InterruptedException e) {
+ // never expected
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param contents
+ * @param description
+ * @throws IOException
+ */
+ private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
+ if (isRelevent(description)) {
+ makeBusy();
+ }
+ }
+
+ private int computeValidity(InputStream inputStream) {
+ // currently no contents specific check for valid HTML contents
+ // (this may change once we add XHTML content type)
+ return IContentDescriber.INDETERMINATE;
+ }
+
+ private int computeValidity(Reader reader) {
+ // no contents specific check for valid HTML contents
+ // (this may change once we add XHTML content type)
+ return IContentDescriber.INDETERMINATE;
+ }
+
+ /**
+ * @param description
+ * @return
+ */
+ private boolean isRelevent(IContentDescription description) {
+ boolean result = false;
+ if (description == null)
+ result = false;
+ else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
+ result = true;
+ else if (description.isRequested(IContentDescription.CHARSET))
+ result = true;
+ return result;
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorPerformanceSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorPerformanceSuite.java
new file mode 100644
index 0000000000..d285ae4f4e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorPerformanceSuite.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @since 3.1
+ */
+public class EditorPerformanceSuite extends TestSuite {
+
+ public static final String [] EDITOR_FILE_EXTENSIONS = {"perf_basic", "perf_outline", "java"};
+ public static final String [][] EDITOR_SWITCH_PAIRS = {
+ {"perf_outline", "java"},
+ {"perf_basic", "perf_outline"}};
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new EditorPerformanceSuite();
+ }
+
+ public EditorPerformanceSuite() {
+ addOpenCloseScenarios();
+ addSwitchScenarios();
+ addOpenMultipleScenarios(true);
+ addOpenMultipleScenarios(false);
+ }
+
+ // Commented out: these tests don't seem to be working
+// /**
+// *
+// * @since 3.1
+// */
+// private void addResizeScenarios() {
+// for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
+// addTest(new ResizeTest(new EditorWidgetFactory("1." + EDITOR_FILE_EXTENSIONS[i])));
+// }
+// }
+
+ /**
+ *
+ */
+ private void addSwitchScenarios() {
+// for (int i = 0; i < EDITOR_SWITCH_PAIRS.length; i++) {
+// addTest(new EditorSwitchTest(EDITOR_SWITCH_PAIRS[i]));
+// }
+ }
+
+ /**
+ *
+ */
+ private void addOpenMultipleScenarios(boolean closeAll) {
+// for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
+// addTest(new OpenMultipleEditorTest(EDITOR_FILE_EXTENSIONS[i], closeAll, BasicPerformanceTest.NONE));
+// }
+ }
+
+ /**
+ *
+ */
+ private void addOpenCloseScenarios() {
+// for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
+// addTest(new OpenCloseEditorTest(EDITOR_FILE_EXTENSIONS[i], i == 3 ? BasicPerformanceTest.LOCAL : BasicPerformanceTest.NONE));
+// }
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java
new file mode 100644
index 0000000000..f71c09b777
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java
@@ -0,0 +1,75 @@
+///*******************************************************************************
+// * Copyright (c) 2000, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchWindow;
+//import org.eclipse.ui.ide.IDE;
+//
+///**
+// * Test editor switching.
+// */
+//public class EditorSwitchTest extends BasicPerformanceTest {
+//
+// private String extension1;
+//
+// private String extension2;
+//
+// /**
+// * Constructor.
+// *
+// * @param testName
+// * Test's name.
+// */
+// public EditorSwitchTest(String[] pair) {
+// super("testEditorSwitch:" + pair[0] + "," + pair[1]);
+// extension1 = pair[0];
+// extension2 = pair[1];
+// }
+//
+// /**
+// * Test editor opening performance. This test always fails.
+// */
+// protected void runTest() throws CoreException {
+//
+// // Open both files outside the loop so as not to include
+// // the initial time to open, just switching.
+// IWorkbenchWindow window = openTestWindow(UIPerformanceTestSetup.PERSPECTIVE1);
+// final IWorkbenchPage activePage = window.getActivePage();
+// final IFile file1 = getProject().getFile("1." + extension1);
+// assertTrue(file1.exists());
+// final IFile file2 = getProject().getFile("1." + extension2);
+// assertTrue(file2.exists());
+// IDE.openEditor(activePage, file1, true);
+// IDE.openEditor(activePage, file2, true);
+// processEvents();
+// EditorTestHelper.calmDown(500, 30000, 500);
+// waitForBackgroundJobs();
+//
+// for (int j = 0; j < 100; j++) {
+//
+// startMeasuring();
+// for (int i = 0; i < 12; i++) {
+// IDE.openEditor(activePage, file1, true);
+// processEvents();
+// IDE.openEditor(activePage, file2, true);
+// processEvents();
+// }
+// stopMeasuring();
+// EditorTestHelper.calmDown(500, 30000, 100);
+// }
+//
+// commitMeasurements();
+// assertPerformance();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorTestHelper.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorTestHelper.java
new file mode 100644
index 0000000000..b97dbb48a0
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorTestHelper.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.*;
+
+
+/**
+ * @since 3.1
+ */
+public class EditorTestHelper {
+
+// public static IEditorPart openInEditor(IFile file, boolean runEventLoop) throws PartInitException {
+// IEditorPart part= IDE.openEditor(getActivePage(), file);
+// if (runEventLoop)
+// runEventQueue(part);
+// return part;
+// }
+//
+// public static IEditorPart openInEditor(IFile file, String editorId, boolean runEventLoop) throws PartInitException {
+// IEditorPart part= IDE.openEditor(getActivePage(), file, editorId);
+// if (runEventLoop)
+// runEventQueue(part);
+// return part;
+// }
+//
+// public static IDocument getDocument(ITextEditor editor) {
+// IDocumentProvider provider= editor.getDocumentProvider();
+// IEditorInput input= editor.getEditorInput();
+// return provider.getDocument(input);
+// }
+//
+// public static void revertEditor(ITextEditor editor, boolean runEventQueue) {
+// editor.doRevertToSaved();
+// if (runEventQueue)
+// runEventQueue(editor);
+// }
+
+ public static void closeAllEditors() {
+ IWorkbenchPage page= getActivePage();
+ if (page != null)
+ page.closeAllEditors(false);
+ }
+
+ public static void runEventQueue() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ if (window != null)
+ runEventQueue(window.getShell());
+ }
+
+ public static void runEventQueue(IWorkbenchPart part) {
+ runEventQueue(part.getSite().getShell());
+ }
+
+ public static void runEventQueue(Shell shell) {
+ while (shell.getDisplay().readAndDispatch());
+ }
+
+ public static void runEventQueue(long minTime) {
+ long nextCheck= System.currentTimeMillis() + minTime;
+ while (System.currentTimeMillis() < nextCheck) {
+ runEventQueue();
+ sleep(1);
+ }
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ return window != null ? window.getActivePage() : null;
+ }
+
+ public static Display getActiveDisplay() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ return window != null ? window.getShell().getDisplay() : null;
+ }
+
+ public static boolean calmDown(long minTime, long maxTime, long intervalTime) {
+ long startTime= System.currentTimeMillis() + minTime;
+ runEventQueue();
+ while (System.currentTimeMillis() < startTime)
+ runEventQueue(intervalTime);
+
+ long endTime= maxTime > 0 ? System.currentTimeMillis() + maxTime : Long.MAX_VALUE;
+ boolean calm= isCalm();
+ while (!calm && System.currentTimeMillis() < endTime) {
+ runEventQueue(intervalTime);
+ calm= isCalm();
+ }
+// System.out.println("--------------------------------------------------");
+ return calm;
+ }
+
+ public static void sleep(int intervalTime) {
+ try {
+ Thread.sleep(intervalTime);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static boolean isCalm() {
+ IJobManager jobManager= Platform.getJobManager();
+ Job[] jobs= jobManager.find(null);
+ for (int i= 0; i < jobs.length; i++) {
+ Job job= jobs[i];
+ int state= job.getState();
+// System.out.println(job.getName() + ": " + getStateName(state));
+ if (state == Job.RUNNING || state == Job.WAITING) {
+// System.out.println();
+ return false;
+ }
+ }
+// System.out.println();
+ return true;
+ }
+
+// private static String getStateName(int state) {
+// switch (state) {
+// case Job.RUNNING: return "RUNNING";
+// case Job.WAITING: return "WAITING";
+// case Job.SLEEPING: return "SLEEPING";
+// case Job.NONE: return "NONE";
+// default: return "unknown " + state;
+// }
+// }
+
+ public static boolean showView(String viewId) throws PartInitException {
+ IWorkbenchPage activePage= getActivePage();
+ IViewReference view= activePage.findViewReference(viewId);
+ boolean notShown= view == null;
+ if (notShown)
+ activePage.showView(viewId);
+ return notShown;
+ }
+
+ public static boolean hideView(String viewId) {
+ IWorkbenchPage activePage= getActivePage();
+ IViewReference view= activePage.findViewReference(viewId);
+ boolean shown= view != null;
+ if (shown)
+ activePage.hideView(view);
+ return shown;
+ }
+
+ public static void bringToTop() {
+// getActiveWorkbenchWindow().getShell().forceActive();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/GenerateIdentifiersTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/GenerateIdentifiersTest.java
new file mode 100644
index 0000000000..320fb105ec
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/GenerateIdentifiersTest.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.ui.activities.IActivityManager;
+
+/**
+ * @since 3.1
+ *
+ */
+public class GenerateIdentifiersTest extends BasicPerformanceTest {
+
+ private int count;
+
+ public GenerateIdentifiersTest(int numberOfIdentifiers) {
+ super("Generate " + numberOfIdentifiers + " identifiers");
+ this.count = numberOfIdentifiers;
+ }
+
+ protected void runTest() throws Throwable {
+ final IActivityManager activityManager = fWorkbench.getActivitySupport().getActivityManager();
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+ // construct the Identifiers to test
+ final String [] ids = new String[count];
+ for (int i = 0; i < ids.length; i++) {
+ long timestamp = System.currentTimeMillis();
+ ids[i] = "org.eclipse.jdt.ui/" + i + timestamp;
+ }
+
+ startMeasuring();
+ for(int i = 0; i < ids.length; i++) {
+ activityManager.getIdentifier(ids[i]);
+ }
+ stopMeasuring();
+ }
+ });
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionClasses.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionClasses.java
new file mode 100644
index 0000000000..df4220e920
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionClasses.java
@@ -0,0 +1,164 @@
+///*******************************************************************************
+// * Copyright (c) 2000, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.resources.IProject;
+//import org.eclipse.core.resources.IResource;
+//import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.resources.mapping.*;
+//import org.eclipse.core.runtime.IAdaptable;
+//import org.eclipse.core.runtime.IAdapterFactory;
+//import org.eclipse.core.runtime.IProgressMonitor;
+//import org.eclipse.core.runtime.PlatformObject;
+//import org.eclipse.ui.IContributorResourceAdapter;
+//import org.eclipse.ui.ide.IContributorResourceAdapter2;
+//
+//public class ObjectContributionClasses implements IAdapterFactory {
+//
+// public static final String PROJECT_NAME = "testContributorResourceAdapter";
+//
+// public static interface ICommon {
+// }
+//
+// public static class Common implements ICommon {
+// }
+//
+// public static interface IA {
+// }
+//
+// public static class A implements IA {
+// }
+//
+// public static class A1 extends A {
+// }
+//
+// public static class A11 extends A1 {
+// }
+//
+// public static interface IB {
+// }
+//
+// public static class B implements IB {
+// }
+//
+// public static class B2 implements IB {
+// }
+//
+// public static class D extends Common implements IA {
+// }
+//
+// public static class C implements ICommon {
+// }
+//
+// public static class CResource implements IAdaptable {
+// public Object getAdapter(Class adapter) {
+// if(adapter == IContributorResourceAdapter.class) {
+// return new ResourceAdapter();
+// }
+// return null;
+// }
+// }
+//
+// public static class CFile implements IAdaptable {
+// public Object getAdapter(Class adapter) {
+// if(adapter == IContributorResourceAdapter.class) {
+// return new ResourceAdapter();
+// }
+// return null;
+// }
+// }
+//
+// // Returns a contribution adapter that doesn't handle ResourceMappings
+// public static class CResourceOnly implements IAdaptable {
+// public Object getAdapter(Class adapter) {
+// if(adapter == IContributorResourceAdapter.class) {
+// return new ResourceOnlyAdapter();
+// }
+// return null;
+// }
+// }
+//
+// public interface IModelElement {
+// }
+//
+// public static class ModelElement extends PlatformObject implements IModelElement {
+// }
+//
+// // Default contributor adapter
+//
+// public static class ResourceAdapter implements IContributorResourceAdapter2 {
+// public IResource getAdaptedResource(IAdaptable adaptable) {
+// if(adaptable instanceof CResource) {
+// return ResourcesPlugin.getWorkspace().getRoot();
+// }
+// if(adaptable instanceof CFile) {
+// return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME).getFile("dummy");
+// }
+// return null;
+// }
+// public ResourceMapping getAdaptedResourceMapping(IAdaptable adaptable) {
+// return (ResourceMapping)getAdaptedResource(adaptable).getAdapter(ResourceMapping.class);
+// }
+// }
+//
+// // Contributor adapter that doesn't handle resource mappings
+//
+// public static class ResourceOnlyAdapter implements IContributorResourceAdapter {
+// public IResource getAdaptedResource(IAdaptable adaptable) {
+// if(adaptable instanceof CResourceOnly) {
+// return ResourcesPlugin.getWorkspace().getRoot();
+// }
+// return null;
+// }
+// }
+//
+// // Adapter methods
+//
+// public Object getAdapter(final Object adaptableObject, Class adapterType) {
+// if(adapterType == IContributorResourceAdapter.class) {
+// return new ResourceAdapter();
+// }
+// if(adaptableObject instanceof IA && adapterType == IA.class) {
+// return new A();
+// }
+// if(adapterType == IResource.class) {
+// return ResourcesPlugin.getWorkspace().getRoot();
+// }
+// if(adapterType == ICommon.class) {
+// return new Common();
+// }
+// if(adapterType == ResourceMapping.class) {
+// return new ResourceMapping() {
+// public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) {
+// return new ResourceTraversal[] {
+// new ResourceTraversal(new IResource[] {ResourcesPlugin.getWorkspace().getRoot()}, IResource.DEPTH_INFINITE, IResource.NONE)
+// };
+// }
+// public IProject[] getProjects() {
+// return ResourcesPlugin.getWorkspace().getRoot().getProjects();
+// }
+// public Object getModelObject() {
+// return adaptableObject;
+// }
+// public String getModelProviderId() {
+// return ModelProvider.RESOURCE_MODEL_PROVIDER_ID;
+// }
+// };
+// }
+//
+// return null;
+// }
+//
+// public Class[] getAdapterList() {
+// return new Class[] { ICommon.class, IResource.class, IFile.class, IContributorResourceAdapter.class, ResourceMapping.class};
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionTest.java
new file mode 100644
index 0000000000..3a452e5046
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionTest.java
@@ -0,0 +1,444 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import java.io.ByteArrayInputStream;
+//import java.util.ArrayList;
+//import java.util.Arrays;
+//import java.util.HashSet;
+//import java.util.Iterator;
+//import java.util.List;
+//import java.util.Set;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.resources.IProject;
+//import org.eclipse.core.resources.IResource;
+//import org.eclipse.core.resources.IWorkspace;
+//import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.resources.mapping.ResourceMapping;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.jface.action.GroupMarker;
+//import org.eclipse.jface.action.IContributionItem;
+//import org.eclipse.jface.action.MenuManager;
+//import org.eclipse.jface.action.SubContributionItem;
+//import org.eclipse.jface.viewers.ISelection;
+//import org.eclipse.jface.viewers.ISelectionChangedListener;
+//import org.eclipse.jface.viewers.ISelectionProvider;
+//import org.eclipse.jface.viewers.IStructuredSelection;
+//import org.eclipse.jface.viewers.StructuredSelection;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchPart;
+//import org.eclipse.ui.PlatformUI;
+//import org.eclipse.ui.internal.PluginActionContributionItem;
+//import org.eclipse.ui.internal.PopupMenuExtender;
+//import org.eclipse.ui.internal.WorkbenchWindow;
+//import org.eclipse.ui.tests.harness.util.UITestCase;
+//import org.eclipse.ui.tests.performance.ObjectContributionClasses.ICommon;
+///**
+// * Tests that object contributions are enabled and shown correctly in pop-up
+// * menus depending on the state of the workbench. This test relies on the
+// * <code>plugin.xml</code> file containing certain values. Please see the
+// * appropriate section in that file for more information about the initial
+// * set-up.
+// *
+// * @since 3.0
+// */
+//public final class ObjectContributionTest extends UITestCase {
+//
+// /**
+// * Constructs a new instance of <code>ObjectContributionTest</code> with
+// * the name of the test.
+// *
+// * @param name
+// * The name of the test; may be <code>null</code>.
+// */
+// public ObjectContributionTest(final String name) {
+// super(name);
+// }
+//
+// /**
+// * Tests whether the content-type object contribution works. This is testing
+// * a use care familiar to Ant UI. The content-type scans an XML file to see
+// * if its root element is <code>&lt;project&gt;</code>.
+// *
+// * @throws CoreException
+// * If a problem occurs when creating the project or file, or if
+// * the project can't be opened.
+// */
+// public final void testObjectStateContentType() throws CoreException {
+// // Create an XML file with <project> as its root element.
+// final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// final IProject testProject = workspace.getRoot().getProject(
+// "ObjectContributionTestProject");
+// testProject.create(null);
+// testProject.open(null);
+// final IFile xmlFile = testProject.getFile("ObjectContributionTest.xml");
+// final String contents = "<testObjectStateContentTypeElement></testObjectStateContentTypeElement>";
+// final ByteArrayInputStream inputStream = new ByteArrayInputStream(
+// contents.getBytes());
+// xmlFile.create(inputStream, true, null);
+// final ISelection selection = new StructuredSelection(xmlFile);
+// assertPopupMenus("1", new String[] {"org.eclipse.ui.tests.testObjectStateContentType"}, selection, null, true);
+// }
+//
+// /**
+// * This tests backwards compatibility support for adaptable IResource objectContributions. This
+// * allows IResource adaptable contributions without an adapter factory and using
+// * the IContributorResourceAdapter factory. In addition, test the ResourceMapping adaptations.
+// *
+// * @since 3.1
+// */
+// public final void testContributorResourceAdapter() throws CoreException {
+//
+// final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// final IProject testProject = workspace.getRoot().getProject(ObjectContributionClasses.PROJECT_NAME);
+// if(! testProject.exists()) {
+// testProject.create(null);
+// }
+// if(! testProject.isOpen()) {
+// testProject.open(null);
+// }
+//
+// assertPopupMenus("1",
+// new String[] {"IResource.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CResource()}),
+// IResource.class,
+// true
+// );
+// assertPopupMenus("2",
+// new String[] {"IProject.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CFile()}),
+// null,
+// false
+// );
+// assertPopupMenus("3",
+// new String[] {"IFile.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CFile()}),
+// IFile.class,
+// true
+// );
+// assertPopupMenus("4",
+// new String[] {"IResource.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CFile(), new ObjectContributionClasses.CResource()}),
+// IResource.class,
+// true
+// );
+// assertPopupMenus("5",
+// new String[] {"IFile.1", "IProject.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CFile(), new ObjectContributionClasses.CResource()}),
+// IResource.class,
+// false
+// );
+// assertPopupMenus("6",
+// new String[] {"ResourceMapping.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CFile(), new ObjectContributionClasses.CResource()}),
+// ResourceMapping.class,
+// true
+// );
+// assertPopupMenus("7",
+// new String[] {"ResourceMapping.1", "IResource.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.ModelElement()}),
+// ResourceMapping.class,
+// true
+// );
+// // Ensure that the case where an object uses a contribution adapter that doesn't handle mappings
+// // will still show the menus for resource mappings
+// assertPopupMenus("8",
+// new String[] {"ResourceMapping.1", "IResource.1"},
+// new StructuredSelection(new Object[] {new ObjectContributionClasses.CResourceOnly()}),
+// ResourceMapping.class,
+// true
+// );
+// }
+//
+// /**
+// * This tests adaptable contributions that are not IResource.
+// *
+// * @since 3.1
+// */
+// public final void testAdaptables() {
+// assertPopupMenus("1",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.A()}),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("2",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.A(),
+// new ObjectContributionClasses.B()}),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("3",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.A(),
+// new ObjectContributionClasses.B(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.Common()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("4",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.Common(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.B(),
+// new ObjectContributionClasses.A()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("5",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.Common(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.B(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.A(),
+// new ObjectContributionClasses.Common()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("6",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.Common()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("7",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new Object()
+// }),
+// ICommon.class,
+// false
+// );
+// assertPopupMenus("8",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.C(),
+// new Object()
+// }),
+// ICommon.class,
+// false
+// );
+// assertPopupMenus("9",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.A(),
+// new Object()
+// }),
+// ICommon.class,
+// false
+// );
+// }
+//
+// /**
+// * Ensure that there are no duplicate contributions.
+// *
+// * @since 3.1
+// */
+// public final void testDuplicateAdaptables() {
+// assertPopupMenus("1",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D()}),
+// ICommon.class,
+// true
+// );
+// // repeat test on purpose to ensure no double call duplicates.
+// assertPopupMenus("1",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D()}),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("2",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D(),
+// new ObjectContributionClasses.A()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("3",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.A(),
+// new ObjectContributionClasses.D()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("4",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.Common(),
+// new ObjectContributionClasses.D()
+// }),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("5",
+// new String[] {"ICommon.1"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D(),
+// new ObjectContributionClasses.Common()
+// }),
+// ICommon.class,
+// true
+// );
+// }
+//
+// /**
+// * Test non-adaptable contributions
+// *
+// * @since 3.1
+// */
+// public final void testNonAdaptableContributions() {
+// assertPopupMenus("1",
+// new String[] {"ICommon.2"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.A(),
+// new ObjectContributionClasses.B()}),
+// ICommon.class,
+// false
+// );
+// assertPopupMenus("2",
+// new String[] {"ICommon.2"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.Common()}),
+// ICommon.class,
+// true
+// );
+// assertPopupMenus("3",
+// new String[] {"Common.2"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.D(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.A()}),
+// ICommon.class,
+// false
+// );
+// assertPopupMenus("4",
+// new String[] {"Common.2"},
+// new StructuredSelection(new Object[] {
+// new ObjectContributionClasses.B(),
+// new ObjectContributionClasses.C(),
+// new ObjectContributionClasses.A()}),
+// ICommon.class,
+// false
+// );
+// }
+//
+// /**
+// * Helper class that will create a popup menu based on the given selection and
+// * then ensure that the provided commandIds are added to the menu.
+// *
+// * @param commandIds the command ids that should appear in the menu
+// * @param selection the selection on which to contribute object contributions
+// */
+// public void assertPopupMenus(String name, String[] commandIds, final ISelection selection, Class selectionType, boolean existance) {
+// ISelectionProvider selectionProvider = new ISelectionProvider() {
+// public void addSelectionChangedListener(ISelectionChangedListener listener) {
+// }
+// public ISelection getSelection() {
+// return selection;
+// }
+// public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+// }
+// public void setSelection(ISelection selection) {
+// }
+// };
+//
+// // The popup extender needs a part to notify actions of the active part
+// final WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+// final IWorkbenchPage page = window.getActivePage();
+// IWorkbenchPart part = page.getActivePartReference().getPart(true);
+//
+// // Create a fake PopupMenuExtender so we can get some data back.
+// final MenuManager fakeMenuManager = new MenuManager();
+// fakeMenuManager.add(new GroupMarker(
+// org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS));
+// final PopupMenuExtender extender = new PopupMenuExtender(null,
+// fakeMenuManager, selectionProvider, part);
+//
+//
+//
+// /*
+// * Pretend to show the pop-up menu -- looking to motivate the extender
+// * to fill the menu based on the selection provider.
+// *
+// * TODO This causes a big delay (in the order of a minute or more) while
+// * trying to fill this menu. It seems to be loading a bunch of plug-ins,
+// * and doing class loading.
+// */
+// extender.menuAboutToShow(fakeMenuManager);
+//
+// extender.dispose();
+//
+// // Check to see if the appropriate object contributions are present.
+// final IContributionItem[] items = fakeMenuManager.getItems();
+// Set seenCommands = new HashSet(Arrays.asList(commandIds));
+// List commands = new ArrayList(Arrays.asList(commandIds));
+// for (int i = 0; i < items.length; i++) {
+// IContributionItem contributionItem = items[i];
+// // Step 1: test the selection
+// if (selectionType != null) {
+// IContributionItem item = contributionItem;
+// if (item instanceof SubContributionItem) {
+// item = ((SubContributionItem) contributionItem).getInnerItem();
+// }
+// if (item instanceof PluginActionContributionItem) {
+// // Verify that the selection passed to the action has been
+// // converted
+// ISelection s = null;
+// if (s instanceof IStructuredSelection) {
+// for (Iterator it = ((IStructuredSelection) s).iterator(); it.hasNext();) {
+// Object element = it.next();
+// assertTrue(name + " selection not converted", selectionType.isInstance(element));
+// }
+// }
+// }
+// }
+// // Step 2: remember that we saw this element
+// String id = contributionItem.getId();
+// if(existance) {
+// boolean removed = commands.remove(id);
+// if(seenCommands.contains(id) && ! removed) {
+// fail(name + " item duplicated in the context menu: " + id);
+// }
+// } else {
+// assertTrue(name + " item should not be in the context menu", ! commands.contains(id));
+// }
+// }
+//
+// if(existance && ! commands.isEmpty()) {
+// fail(name + " Missing " + commands.toString() + " from context menu.");
+// }
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionsPerformance.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionsPerformance.java
new file mode 100644
index 0000000000..6d5cdd6037
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionsPerformance.java
@@ -0,0 +1,93 @@
+///*******************************************************************************
+// * Copyright (c) 2000, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//import java.util.Random;
+//
+//import junit.framework.Test;
+//import junit.framework.TestSuite;
+//
+//import org.eclipse.jface.viewers.IStructuredSelection;
+//import org.eclipse.jface.viewers.StructuredSelection;
+//import org.eclipse.test.performance.Dimension;
+//
+//public class ObjectContributionsPerformance extends BasicPerformanceTest {
+//
+// public static final int SEED = 1001001;
+// private IStructuredSelection selection;
+//
+// public static Test suite() {
+// TestSuite suite = new TestSuite("Object contribution performance");
+// suite.addTest(new ObjectContributionsPerformance(
+// "large selection, limited contributors",
+// generateAdaptableSelection(SEED, 5000),
+// BasicPerformanceTest.NONE));
+// suite
+// .addTest(new ObjectContributionsPerformance(
+// "limited selection, limited contributors",
+// generateAdaptableSelection(SEED, 50),
+// BasicPerformanceTest.NONE));
+// return suite;
+// }
+//
+// public ObjectContributionsPerformance(String label, IStructuredSelection selection, int tagging) {
+// super("testObjectContributions:" + label, tagging);
+// this.selection = selection;
+// }
+//
+// protected void runTest() {
+// ObjectContributionTest tests = new ObjectContributionTest(
+// "testObjectContributions");
+// tagIfNecessary("UI - " + selection.size() + " contribution(s)",
+// Dimension.ELAPSED_PROCESS);
+// setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=88274>See Bug 88274</a> ");
+// startMeasuring();
+// for (int i = 0; i < 5000; i++) {
+// tests.assertPopupMenus("1", new String[] { "bogus" }, selection,
+// null, false);
+// }
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// protected static IStructuredSelection generateAdaptableSelection(int seed, int size) {
+// Random rand = new Random(seed);
+// List selection = new ArrayList();
+// for (int i = 0; i < size; i++) {
+// switch ((int) Math.round(rand.nextDouble() * 5)) {
+// case 0 :
+// selection.add(new ObjectContributionClasses.A());
+// break;
+// case 1 :
+// selection.add(new ObjectContributionClasses.B());
+// break;
+// case 2 :
+// selection.add(new ObjectContributionClasses.C());
+// break;
+// case 3 :
+// selection.add(new ObjectContributionClasses.Common());
+// break;
+// case 4 :
+// selection.add(new ObjectContributionClasses.D());
+// break;
+// case 5 :
+// selection.add(new ObjectContributionClasses.A1());
+// break;
+// default :
+// selection.add(new Object());
+// }
+// }
+// return new StructuredSelection(selection);
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java
new file mode 100644
index 0000000000..8f2c736f6e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java
@@ -0,0 +1,58 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.IEditorPart;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchWindow;
+//import org.eclipse.ui.ide.IDE;
+//
+///**
+// * @since 3.1
+// */
+//public class OpenCloseEditorTest extends BasicPerformanceTest {
+//
+// private String extension;
+//
+// public OpenCloseEditorTest(String extension, int tagging) {
+// super("testOpenAndCloseEditors:" + extension, tagging);
+// this.extension = extension;
+// }
+//
+// protected void runTest() throws Throwable {
+// final IFile file = getProject().getFile("1." + extension);
+// assertTrue(file.exists());
+//
+// IWorkbenchWindow window = openTestWindow(UIPerformanceTestSetup.PERSPECTIVE1);
+// final IWorkbenchPage activePage = window.getActivePage();
+//
+// exercise(new TestRunnable() {
+// public void run() throws Exception {
+// startMeasuring();
+// for (int j = 0; j < 10; j++) {
+// IEditorPart part = IDE.openEditor(activePage, file, true);
+// processEvents();
+// activePage.closeEditor(part, false);
+// processEvents();
+//
+// }
+// stopMeasuring();
+// }
+// });
+//
+// tagIfNecessary("UI - Open/Close Editor", Dimension.ELAPSED_PROCESS);
+// commitMeasurements();
+// assertPerformance();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenClosePerspectiveTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenClosePerspectiveTest.java
new file mode 100644
index 0000000000..b51c096cae
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenClosePerspectiveTest.java
@@ -0,0 +1,120 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance;
+//
+//import java.util.HashMap;
+//
+//import org.eclipse.core.commands.Command;
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.*;
+//import org.eclipse.ui.commands.ICommandService;
+//import org.eclipse.ui.internal.WorkbenchPlugin;
+//
+///**
+// * @since 3.1
+// */
+//public class OpenClosePerspectiveTest extends BasicPerformanceTest {
+//
+// private String id;
+//
+// /**
+// * @param tagging
+// * @param testName
+// */
+// public OpenClosePerspectiveTest(String id, int tagging) {
+// super("testOpenClosePerspectives:" + id, tagging);
+// this.id = id;
+// }
+//
+// protected void runTest() throws Throwable {
+// // Get the two perspectives to switch between.
+// final IPerspectiveRegistry registry = WorkbenchPlugin.getDefault()
+// .getPerspectiveRegistry();
+// final IPerspectiveDescriptor perspective1 = registry
+// .findPerspectiveWithId(id);
+//
+// // Don't fail if we reference an unknown perspective ID. This can be
+// // a normal occurrance since the test suites reference JDT perspectives, which
+// // might not exist.
+// if (perspective1 == null) {
+// System.out.println("Unknown perspective id: " + id);
+// return;
+// }
+//
+// // create a nice clean window.
+// IWorkbenchWindow window = openTestWindow();
+// final IWorkbenchPage activePage = window.getActivePage();
+//
+// //causes creation of all views
+// activePage.setPerspective(perspective1);
+// IViewReference [] refs = activePage.getViewReferences();
+// //get the IDs now - after we close hte perspective the view refs will be partiall disposed and their IDs will be null
+// String [] ids = new String[refs.length];
+// for (int i = 0; i < refs.length; i++) {
+// ids[i] = refs[i].getId();
+// }
+// closePerspective(activePage);
+// //populate the empty perspective with all view that will be shown in the test view
+// for (int i = 0; i < ids.length; i++) {
+// activePage.showView(ids[i]);
+// }
+//
+// tagIfNecessary("UI - Open/Close " + perspective1.getLabel() + " Perspective", Dimension.ELAPSED_PROCESS);
+//
+// exercise(new TestRunnable() {
+// public void run() throws Exception {
+// processEvents();
+// EditorTestHelper.calmDown(500, 30000, 500);
+//
+// startMeasuring();
+// activePage.setPerspective(perspective1);
+// processEvents();
+// closePerspective(activePage);
+// processEvents();
+// stopMeasuring();
+// }
+// });
+//
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// /**
+// * @param activePage
+// */
+// private void closePerspective(IWorkbenchPage activePage) {
+// IPerspectiveDescriptor persp = activePage.getPerspective();
+//
+// ICommandService commandService = (ICommandService) fWorkbench
+// .getService(ICommandService.class);
+// Command command = commandService
+// .getCommand("org.eclipse.ui.window.closePerspective");
+//
+// HashMap parameters = new HashMap();
+// parameters.put("org.eclipse.ui.window.closePerspective.perspectiveId",
+// persp.getId());
+//
+// ParameterizedCommand pCommand = ParameterizedCommand.generateCommand(
+// command, parameters);
+//
+// IHandlerService handlerService = (IHandlerService) fWorkbench
+// .getService(IHandlerService.class);
+// try {
+// handlerService.executeCommand(pCommand, null);
+// } catch (ExecutionException e1) {
+// } catch (NotDefinedException e1) {
+// } catch (NotEnabledException e1) {
+// } catch (NotHandledException e1) {
+// }
+//
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseViewTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseViewTest.java
new file mode 100644
index 0000000000..7472211c8a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseViewTest.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Performance tests for showing views.
+ * There are separate tests for showing a simple view (MockViewPart)
+ * and a more complex view (Resource Navigator).
+ * The views are shown in an empty perspective.
+ */
+public class OpenCloseViewTest extends BasicPerformanceTest {
+
+ private String viewId;
+
+ public OpenCloseViewTest(String viewId, int tagging) {
+ super("showView:" + viewId, tagging);
+ this.viewId = viewId;
+ }
+
+ protected void runTest() throws Throwable {
+ IWorkbenchWindow window = openTestWindow();
+ final IWorkbenchPage page = window.getActivePage();
+
+ // prime it
+ IViewPart view1 = page.showView(viewId);
+ page.hideView(view1);
+ waitForBackgroundJobs();
+ processEvents();
+
+ tagIfNecessary("UI - Open/Close " + view1.getTitle(), Dimension.ELAPSED_PROCESS);
+
+ for (int j = 0; j < 100; j++) {
+
+ startMeasuring();
+ for (int i = 0; i < 5; i++) {
+ IViewPart view = page.showView(viewId);
+ processEvents();
+
+ page.hideView(view);
+ processEvents();
+ }
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseWindowTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseWindowTest.java
new file mode 100644
index 0000000000..06d58e79ac
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseWindowTest.java
@@ -0,0 +1,56 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.IWorkbenchWindow;
+//
+///**
+// * @since 3.1
+// */
+//public class OpenCloseWindowTest extends BasicPerformanceTest {
+//
+// private String id;
+//
+// /**
+// * @param tagging
+// * @param testName
+// */
+// public OpenCloseWindowTest(String id, int tagging) {
+// super("testOpenCloseWindows:" + id, tagging);
+// this.id = id;
+// }
+//
+// protected void runTest() throws Throwable {
+//
+// tagIfNecessary("UI - Open/Close Window", Dimension.ELAPSED_PROCESS);
+//
+// setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=179725>See Bug 179725</a> ");
+//
+// exercise(new TestRunnable() {
+// public void run() throws Exception {
+// processEvents();
+// EditorTestHelper.calmDown(500, 30000, 500);
+//
+// startMeasuring();
+// IWorkbenchWindow window = openTestWindow(id);
+// processEvents();
+// window.close();
+// processEvents();
+// stopMeasuring();
+// }
+// });
+//
+// commitMeasurements();
+// assertPerformance();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java
new file mode 100644
index 0000000000..407a497a15
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java
@@ -0,0 +1,66 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.IEditorPart;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchWindow;
+//import org.eclipse.ui.ide.IDE;
+//
+///**
+// * @since 3.1
+// */
+//public class OpenMultipleEditorTest extends BasicPerformanceTest {
+//
+// private String extension;
+// private boolean closeAll;
+//
+// /**
+// * @param testName
+// */
+// public OpenMultipleEditorTest(String extension, boolean closeAll, int tagging) {
+// super ("testOpenMultipleEditors:" + extension + (closeAll ? "[closeAll]" : "[closeEach]"), tagging);
+// this.extension = extension;
+// this.closeAll = closeAll;
+// setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=179578>See Bug 179578</a>");
+// }
+//
+// protected void runTest() throws Throwable {
+// IWorkbenchWindow window = openTestWindow(UIPerformanceTestSetup.PERSPECTIVE1);
+// IWorkbenchPage activePage = window.getActivePage();
+//
+// tagIfNecessary("UI - Open Multiple Editors",Dimension.ELAPSED_PROCESS);
+//
+// startMeasuring();
+//
+// for (int i = 0; i < 100; i++) {
+// IFile file = getProject().getFile(i + "." + extension);
+// IDE.openEditor(activePage, file, true);
+// processEvents();
+// }
+// if (closeAll) {
+// activePage.closeAllEditors(false);
+// }
+// else {
+// IEditorPart [] parts = activePage.getEditors();
+// for (int i = 0; i < parts.length; i++) {
+// activePage.closeEditor(parts[i], false);
+// }
+// }
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenNavigatorFolderTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenNavigatorFolderTest.java
new file mode 100644
index 0000000000..22a055ad94
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenNavigatorFolderTest.java
@@ -0,0 +1,161 @@
+///*******************************************************************************
+// * Copyright (c) 2005, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import java.io.ByteArrayInputStream;
+//import java.io.ByteArrayOutputStream;
+//import java.io.IOException;
+//import java.net.URL;
+//import java.util.zip.ZipEntry;
+//import java.util.zip.ZipInputStream;
+//import junit.framework.Assert;
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.resources.IProject;
+//import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.core.runtime.NullProgressMonitor;
+//import org.eclipse.core.runtime.Platform;
+//import org.eclipse.test.performance.PerformanceTestCase;
+//import org.eclipse.ui.IViewPart;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.PartInitException;
+//import org.eclipse.ui.PlatformUI;
+//import org.eclipse.ui.views.navigator.ResourceNavigator;
+//import org.osgi.framework.Bundle;
+//
+///**
+// * This class/test was originally written for WTP bug 106158, and adapted to a
+// * generic "platform" test case, since some of the problem was due to bug
+// * 107121
+// *
+// * Thanks for Jeffrey Liu (jeffliu@ca.ibm.com) who wrote the test for WTP.
+// *
+// * And, thanks to Eric Glass <ericglass@maximus.com> for opening bug 106158
+// * (100% CPU for over 3 minutes opening a directory in the Navigator view with
+// * over 2000 HTML files) https://bugs.eclipse.org/bugs/show_bug.cgi?id=106158
+// * and for providing 2500 "generic" HTML files for the original test case in
+// * WTP.
+// *
+// * modified by David Williams for platform level test that does not depend on
+// * WTP or, for that matter, any meaningful content type. The content type
+// * assumed there is designed simply to "take a while" to complete, if asked
+// * for its properties.
+// *
+// * Note, since this test companion "ContentDescriberForTestsOnly", simply uses
+// * "sleep" to simulate computations, it only effects Elapsed Time (not CPU
+// * Time).
+// *
+// */
+//public class OpenNavigatorFolderTest extends PerformanceTestCase {
+// /*
+// * performance testcase for bug 106158
+// * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106158
+// */
+// public void testOpenNavigatorFolder() {
+// IProject project = createProject("testViewAndContentTypeProject");
+// Bundle bundle = Platform.getBundle("org.eclipse.ui.tests");
+// URL url = bundle.getEntry("data/testContentType.zip");
+// ZipInputStream zis = null;
+// try {
+// zis = new ZipInputStream(url.openStream());
+// ZipEntry entry = zis.getNextEntry();
+// while (entry != null) {
+// ByteArrayOutputStream baos = new ByteArrayOutputStream();
+// try {
+// byte[] b = new byte[2048];
+// int read = zis.read(b);
+// while (read != -1) {
+// baos.write(b, 0, read);
+// read = zis.read(b);
+// }
+// }
+// catch (IOException e) {
+// Assert.fail(e.getMessage());
+// }
+// finally {
+// try {
+// baos.close();
+// }
+// catch (IOException e) {
+// Assert.fail(e.getMessage());
+// }
+// }
+// IFile file = project.getFile(entry.getName());
+// ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+// try {
+// if (!file.exists())
+// file.create(bais, true, new NullProgressMonitor());
+// else
+// file.setContents(bais, true, false, new NullProgressMonitor());
+// }
+// catch (CoreException e) {
+// Assert.fail(e.getMessage());
+// }
+// finally {
+// try {
+// bais.close();
+// }
+// catch (IOException e) {
+// Assert.fail(e.getMessage());
+// }
+// }
+// entry = zis.getNextEntry();
+// }
+// }
+// catch (IOException e) {
+// Assert.fail(e.getMessage());
+// }
+// finally {
+// try {
+// if (zis != null) {
+// zis.close();
+// }
+// }
+// catch (IOException e) {
+// Assert.fail(e.getMessage());
+// }
+// }
+// startMeasuring();
+// IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+// IViewPart view = null;
+// try {
+// view = activePage.showView("org.eclipse.ui.views.ResourceNavigator");
+// }
+// catch (PartInitException e) {
+// Assert.fail(e.getMessage());
+// }
+// ResourceNavigator navigatorView = null;
+// try {
+// navigatorView = (ResourceNavigator) view;
+// }
+// catch (ClassCastException e) {
+// Assert.fail(e.getMessage());
+// }
+// navigatorView.getTreeViewer().expandAll();
+// stopMeasuring();
+// commitMeasurements();
+// assertPerformance();
+// }
+//
+// private IProject createProject(String name) {
+// IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+// if (!project.exists()) {
+// try {
+// project.create(new NullProgressMonitor());
+// project.open(new NullProgressMonitor());
+// }
+// catch (CoreException e) {
+// Assert.fail(e.getMessage());
+// }
+// }
+// return project;
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective1.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective1.java
new file mode 100644
index 0000000000..686c165af0
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective1.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/**
+ * @since 3.1
+ */
+public class PerformancePerspective1 implements IPerspectiveFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA);
+ layout.addView(IPageLayout.ID_PROP_SHEET, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective2.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective2.java
new file mode 100644
index 0000000000..c9843673b8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective2.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/**
+ * @since 3.1
+ */
+public class PerformancePerspective2 implements IPerspectiveFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ layout.setEditorAreaVisible(false);
+ layout.addView(IPageLayout.ID_TASK_LIST, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA);
+ layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTestRunner.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTestRunner.java
new file mode 100644
index 0000000000..64d913277f
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTestRunner.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Runs a test specified by the org.eclipse.ui.performance.test property.
+ * This test is prepped via the UIPerformanceTestSetup test setup.
+ *
+ * @since 3.1
+ */
+public class PerformanceTestRunner extends TestSuite {
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new UIPerformanceTestSetup(new PerformanceTestRunner());
+ }
+
+ public PerformanceTestRunner() {
+ String className = System.getProperty("org.eclipse.ui.performance.test");
+ try {
+ Class clazz = Class.forName(className);
+ if (TestSuite.class.isAssignableFrom(clazz))
+ addTest((Test) clazz.newInstance());
+ else
+ addTestSuite(clazz);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTester.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTester.java
new file mode 100644
index 0000000000..14ea021959
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTester.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+import junit.framework.TestCase;
+
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.test.performance.Performance;
+import org.eclipse.test.performance.PerformanceMeter;
+
+/**
+ * @since 3.1
+ */
+final class PerformanceTester {
+
+ protected PerformanceMeter fPerformanceMeter;
+
+ /**
+ * @param testCase
+ */
+ public PerformanceTester(TestCase testCase) {
+ Performance performance= Performance.getDefault();
+ fPerformanceMeter= performance.createPerformanceMeter(performance.getDefaultScenarioId(testCase));
+ }
+
+ /**
+ * Asserts default properties of the measurements captured for this test
+ * case.
+ *
+ * @throws RuntimeException if the properties do not hold
+ */
+ public void assertPerformance() {
+ Performance.getDefault().assertPerformance(fPerformanceMeter);
+ }
+
+ /**
+ * Asserts that the measurement specified by the given dimension is within a
+ * certain range with respect to some reference value. If the specified
+ * dimension isn't available, the call has no effect.
+ *
+ * @param dim
+ * the Dimension to check
+ * @param lowerPercentage
+ * a negative number indicating the percentage the measured value
+ * is allowed to be smaller than some reference value
+ * @param upperPercentage
+ * a positive number indicating the percentage the measured value
+ * is allowed to be greater than some reference value
+ * @throws RuntimeException
+ * if the properties do not hold
+ */
+ public void assertPerformanceInRelativeBand(Dimension dim, int lowerPercentage, int upperPercentage) {
+ Performance.getDefault().assertPerformanceInRelativeBand(fPerformanceMeter, dim, lowerPercentage, upperPercentage);
+ }
+
+ public void commitMeasurements() {
+ fPerformanceMeter.commit();
+ }
+
+ public void dispose() {
+ fPerformanceMeter.dispose();
+ }
+
+ /**
+ * Called from within a test case immediately before the code to measure is
+ * run. It starts capturing of performance data. Must be followed by a call
+ * to {@link PerformanceTestCase#stopMeasuring()}before subsequent calls to
+ * this method or {@link PerformanceTestCase#commitMeasurements()}.
+ */
+ public void startMeasuring() {
+ fPerformanceMeter.start();
+ }
+
+ public void stopMeasuring() {
+ fPerformanceMeter.stop();
+ }
+
+ /**
+ * Mark the scenario of this test case to be included both into the global
+ * and the local (component) performance summary. The summary shows the given dimension of the
+ * scenario and labels the scenario with the short name.
+ *
+ * @param shortName
+ * a short (shorter than 40 characters) descritive name of the scenario
+ * @param dimension
+ * the dimension to show in the summary
+ */
+ public void tagAsGlobalSummary(String shortName, Dimension dimension) {
+ Performance.getDefault().tagAsGlobalSummary(fPerformanceMeter, shortName, new Dimension[] { dimension });
+ }
+
+ /**
+ * Mark the scenario represented by the given PerformanceMeter to be
+ * included into the global and the local (component) performance summary. The summary shows the given
+ * dimensions of the scenario and labels the scenario with the short name.
+ *
+ * @param shortName
+ * a short (shorter than 40 characters) descritive name of the scenario
+ * @param dimensions
+ * an array of dimensions to show in the summary
+ */
+ public void tagAsGlobalSummary(String shortName, Dimension[] dimensions) {
+ Performance.getDefault().tagAsGlobalSummary(fPerformanceMeter, shortName, dimensions);
+ }
+
+ /**
+ * Mark the scenario of this test case to be included into the local (component)
+ * performance summary. The summary shows the given dimension of the
+ * scenario and labels the scenario with the short name.
+ *
+ * @param shortName
+ * a short (shorter than 40 characters) descriptive name of the scenario
+ * @param dimension
+ * the dimension to show in the summary
+ */
+ public void tagAsSummary(String shortName, Dimension dimension) {
+ Performance.getDefault().tagAsSummary(fPerformanceMeter, shortName, new Dimension[] { dimension });
+ }
+
+ /**
+ * Mark the scenario represented by the given PerformanceMeter to be
+ * included into the local (component) performance summary. The summary shows the given
+ * dimensions of the scenario and labels the scenario with the short name.
+ *
+ * @param shortName
+ * a short (shorter than 40 characters) descriptive name of the scenario
+ * @param dimensions
+ * an array of dimensions to show in the summary
+ */
+ public void tagAsSummary(String shortName, Dimension[] dimensions) {
+ Performance.getDefault().tagAsSummary(fPerformanceMeter, shortName, dimensions);
+ }
+
+ /**
+ * Set a degradation comment for the current meter.
+ * @param string
+ */
+ public void setDegradationComment(String string) {
+ Performance.getDefault().setComment(
+ fPerformanceMeter,
+ Performance.EXPLAINS_DEGRADATION_COMMENT,
+ string);
+
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerspectiveSwitchTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerspectiveSwitchTest.java
new file mode 100644
index 0000000000..2cc86b2c96
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerspectiveSwitchTest.java
@@ -0,0 +1,98 @@
+///*******************************************************************************
+// * Copyright (c) 2000, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.*;
+//import org.eclipse.ui.internal.WorkbenchPlugin;
+//
+///**
+// * Test perspective switching.
+// */
+//public class PerspectiveSwitchTest extends BasicPerformanceTest {
+//
+// private String id1;
+// private String id2;
+// private String activeEditor;
+//
+// /**
+// * Constructor.
+// *
+// * @param id
+// */
+// public PerspectiveSwitchTest(String [] ids, int tagging) {
+// super("testPerspectiveSwitch:" + ids[0] + "," + ids[1] + ",editor " + ids[2], tagging);
+// this.id1 = ids[0];
+// this.id2 = ids[1];
+// this.activeEditor = ids[2];
+// setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=179581>See Bug 179581</a>");
+// }
+//
+// /**
+// * Test perspective switching performance.
+// */
+// protected void runTest() throws CoreException, WorkbenchException {
+// // Get the two perspectives to switch between.
+// final IPerspectiveRegistry registry = WorkbenchPlugin.getDefault()
+// .getPerspectiveRegistry();
+// final IPerspectiveDescriptor perspective1 = registry
+// .findPerspectiveWithId(id1);
+// final IPerspectiveDescriptor perspective2 = registry
+// .findPerspectiveWithId(id2);
+//
+// // Don't fail if we reference an unknown perspective ID. This can be
+// // a normal occurrance since the test suites reference JDT perspectives, which
+// // might not exist. Just skip the test.
+// if (perspective1 == null) {
+// System.out.println("Unknown perspective ID: " + id1);
+// return;
+// }
+//
+// if (perspective2 == null) {
+// System.out.println("Unknown perspective ID: " + id2);
+// return;
+// }
+//
+// // Open the two perspectives and the file, in a new window.
+// // Do this outside the loop so as not to include
+// // the initial time to open, just switching.
+// IWorkbenchWindow window = openTestWindow(id1);
+// final IWorkbenchPage page = window.getActivePage();
+// assertNotNull(page);
+// page.setPerspective(perspective2);
+//
+// //IFile aFile = getProject().getFile("1." + EditorPerformanceSuite.EDITOR_FILE_EXTENSIONS[0]);
+// IFile aFile = getProject().getFile(activeEditor);
+// assertTrue(aFile.exists());
+//
+// IDE.openEditor(page, aFile, true);
+//
+// tagIfNecessary("UI - Perspective Switch", Dimension.ELAPSED_PROCESS);
+//
+// exercise(new TestRunnable() {
+// public void run() throws Exception {
+// processEvents();
+//
+// startMeasuring();
+// page.setPerspective(perspective1);
+// processEvents();
+// page.setPerspective(perspective2);
+// processEvents();
+// stopMeasuring();
+// }
+// });
+//
+// commitMeasurements();
+// assertPerformance();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java
new file mode 100644
index 0000000000..2f3dda23df
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java
@@ -0,0 +1,123 @@
+///*******************************************************************************
+// * Copyright (c) 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// ******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance;
+//
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//import org.eclipse.core.resources.*;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.test.performance.Dimension;
+//import org.eclipse.ui.*;
+//
+///**
+// * The ProblemsViewPerformanceTest is a test of population of the problems view.
+// *
+// * @since 3.2
+// *
+// */
+//public class ProblemsViewPerformanceTest extends BasicPerformanceTest {
+//
+// private String EMPTY_PERSPECTIVE_ID = "org.eclipse.ui.tests.harness.util.EmptyPerspective";
+//
+// private String PROBLEMS_VIEW_ID = "org.eclipse.ui.tests.performance.problemsView";
+//
+// /**
+// * Create a new instance of the receiver.
+// *
+// * @param testName
+// */
+// public ProblemsViewPerformanceTest(String testName) {
+// super(testName);
+// }
+//
+// /**
+// * Test the population of the problems view.
+// */
+// public void testPopulation() {
+// IWorkbenchWindow window = openTestWindow(EMPTY_PERSPECTIVE_ID);
+// final IWorkbenchPage page = window.getActivePage();
+//
+// PerformanceProblemsView view;
+//
+// try {
+// view = (PerformanceProblemsView) page.showView(PROBLEMS_VIEW_ID);
+// } catch (PartInitException e) {
+// e.printStackTrace();
+// fail();
+// return;
+// }
+//
+// tagIfNecessary("UI - Problems View population",
+// Dimension.ELAPSED_PROCESS);
+//
+// for (int i = 0; i < 100; i++) {
+// createMarkers();
+// processEvents();
+// startMeasuring();
+// while (view.getTreeWidget().getItemCount() == 0)
+// processEvents();
+// stopMeasuring();
+// removeMarkers();
+// while (view.getTreeWidget().getItemCount() > 0)
+// processEvents();
+// }
+// commitMeasurements();
+// assertPerformance();
+//
+// }
+//
+// /**
+// * Remove the created markers
+// */
+// private void removeMarkers() {
+//
+// try {
+// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+//
+// IMarker[] markers = root.findMarkers(IMarker.PROBLEM, false,
+// IResource.DEPTH_ZERO);
+//
+// for (int i = 0; i < markers.length; i++) {
+// String message = (String) markers[i]
+// .getAttribute(IMarker.MESSAGE);
+//
+// if (message != null && message.startsWith("this is a test")) {
+// markers[i].delete();
+// }
+// }
+// } catch (CoreException e) {
+// e.printStackTrace();
+// }
+//
+// }
+//
+// /**
+// * Create the markers for the receiver.
+// */
+// private void createMarkers() {
+// try {
+// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+// Map attribs = new HashMap();
+// for (int i = 0; i < 1000; i++) {
+// attribs.put(IMarker.SEVERITY, new Integer(
+// IMarker.SEVERITY_ERROR));
+// attribs.put(IMarker.MESSAGE, "this is a test " + i);
+// MarkerUtilities.createMarker(root, attribs, IMarker.PROBLEM);
+// }
+// } catch (CoreException e) {
+// e.printStackTrace();
+// }
+//
+// }
+//
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ResourceTestHelper.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ResourceTestHelper.java
new file mode 100644
index 0000000000..b1b9cf353e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ResourceTestHelper.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.tests.harness.util.FileTool;
+
+public class ResourceTestHelper {
+
+ public static void replicate(String src, String destPrefix, String destSuffix, int n) throws CoreException {
+ for (int i= 0; i < n; i++)
+ copy(src, destPrefix + i + destSuffix);
+ }
+
+ public static void copy(String src, String dest) throws CoreException {
+ IFile file= getRoot().getFile(new Path(src));
+ file.copy(new Path(dest), true, null);
+ }
+
+ public static void delete(String file) throws CoreException {
+ getRoot().getFile(new Path(file)).delete(true, null);
+ }
+
+ public static IFile findFile(String path) {
+ return getRoot().getFile(new Path(path));
+ }
+
+ public static IFile[] findFiles(String prefix, String suffix, int i, int n) {
+ IWorkspaceRoot root= getRoot();
+ List files= new ArrayList(n - i);
+ for (int j= i; j < i + n; j++) {
+ String path= root.getLocation().toString() + "/" + prefix + j + suffix;
+ files.add(findFile(path));
+ }
+ return (IFile[]) files.toArray(new IFile[files.size()]);
+ }
+
+ public static StringBuffer read(String src) throws IOException, CoreException {
+ return FileTool.read(new InputStreamReader(getRoot().getFile(new Path(src)).getContents()));
+ }
+
+ public static void write(String dest, final String content) throws IOException, CoreException {
+ InputStream stream= new InputStream() {
+ private Reader fReader= new StringReader(content);
+ public int read() throws IOException {
+ return fReader.read();
+ }
+ };
+ getRoot().getFile(new Path(dest)).create(stream, true, null);
+ }
+
+
+ public static void replicate(String src, String destPrefix, String destSuffix, int n, String srcName, String destNamePrefix) throws IOException, CoreException {
+
+ StringBuffer s= read(src);
+
+ List positions= identifierPositions(s, srcName);
+
+ for (int j= 0; j < n; j++) {
+ StringBuffer c= new StringBuffer(s.toString());
+ replacePositions(c, srcName.length(), destNamePrefix + j, positions);
+ write(destPrefix + j + destSuffix, c.toString());
+ }
+ }
+
+ public static void copy(String src, String dest, String srcName, String destName) throws IOException, CoreException {
+ StringBuffer buf= read(src);
+ List positions= identifierPositions(buf, srcName);
+ replacePositions(buf, srcName.length(), destName, positions);
+ write(dest, buf.toString());
+ }
+
+ private static void replacePositions(StringBuffer c, int origLength, String string, List positions) {
+ int offset= 0;
+ for (Iterator iter= positions.iterator(); iter.hasNext();) {
+ int position= ((Integer) iter.next()).intValue();
+ c.replace(offset + position, offset + position + origLength, string);
+ offset += string.length() - origLength;
+ }
+ }
+
+ private static List identifierPositions(StringBuffer buffer, String identifier) {
+ List positions= new ArrayList();
+ int i= -1;
+ while (true) {
+ i= buffer.indexOf(identifier, i + 1);
+ if (i == -1)
+ break;
+ if (i > 0 && Character.isJavaIdentifierPart(buffer.charAt(i - 1)))
+ continue;
+ if (i < buffer.length() - 1 && Character.isJavaIdentifierPart(buffer.charAt(i + identifier.length())))
+ continue;
+ positions.add(new Integer(i));
+ }
+ return positions;
+ }
+
+ private static IWorkspaceRoot getRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ public static boolean enableAutoBuilding() {
+ IWorkspaceDescription description= ResourcesPlugin.getWorkspace().getDescription();
+ boolean wasOff= !description.isAutoBuilding();
+ if (wasOff)
+ description.setAutoBuilding(true);
+ return wasOff;
+ }
+
+ public static void incrementalBuild() throws CoreException {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ }
+
+ public static void fullBuild() throws CoreException {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ }
+
+ public static boolean disableAutoBuilding() {
+ IWorkspaceDescription description= ResourcesPlugin.getWorkspace().getDescription();
+ boolean wasOn= description.isAutoBuilding();
+ if (wasOn)
+ description.setAutoBuilding(false);
+ return wasOn;
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/TestRunnable.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/TestRunnable.java
new file mode 100644
index 0000000000..a677bca089
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/TestRunnable.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+public abstract class TestRunnable {
+ public abstract void run() throws Exception;
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformancePlugin.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformancePlugin.java
new file mode 100644
index 0000000000..789c978731
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformancePlugin.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class UIPerformancePlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static UIPerformancePlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public UIPerformancePlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance.
+ */
+ public static UIPerformancePlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.ui.tests.performance", path);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSetup.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSetup.java
new file mode 100644
index 0000000000..3cfec1b239
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSetup.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import java.io.ByteArrayInputStream;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public class UIPerformanceTestSetup extends TestSetup {
+
+ public static final String PERSPECTIVE1= "org.eclipse.ui.tests.performancePerspective1";
+ public static final String PERSPECTIVE2= "org.eclipse.ui.tests.performancePerspective2";
+
+ public static final String PROJECT_NAME = "Performance Project";
+
+ private static final String INTRO_VIEW= "org.eclipse.ui.internal.introview";
+
+ private IProject testProject;
+
+ public UIPerformanceTestSetup(Test test) {
+ super(test);
+ }
+
+ /*
+ * @see junit.extensions.TestSetup#setUp()
+ */
+ protected void setUp() throws Exception {
+ IWorkbench workbench= PlatformUI.getWorkbench();
+ IWorkbenchWindow activeWindow= workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage activePage= activeWindow.getActivePage();
+
+ activePage.hideView(activePage.findViewReference(INTRO_VIEW));
+
+ workbench.showPerspective(PERSPECTIVE1, activeWindow);
+
+ boolean wasAutobuilding= ResourceTestHelper.disableAutoBuilding();
+ setUpProject();
+ ResourceTestHelper.fullBuild();
+ if (wasAutobuilding) {
+ ResourceTestHelper.enableAutoBuilding();
+ EditorTestHelper.calmDown(2000, 30000, 1000);
+ }
+ }
+
+ /*
+ * @see junit.extensions.TestSetup#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // do nothing, the set up workspace will be used by the open editor tests
+
+ /*
+ * ensure the workbench state gets saved when running with the Automated Testing Framework
+ * TODO: remove when https://bugs.eclipse.org/bugs/show_bug.cgi?id=71362 is fixed
+ */
+ StackTraceElement[] elements= new Throwable().getStackTrace();
+ for (int i= 0; i < elements.length; i++) {
+ StackTraceElement element= elements[i];
+ if (element.getClassName().equals("org.eclipse.test.EclipseTestRunner")) {
+ PlatformUI.getWorkbench().close();
+ break;
+ }
+ }
+ }
+
+ private void setUpProject() throws CoreException {
+
+ // Create a java project.
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ testProject = workspace.getRoot().getProject(PROJECT_NAME);
+ testProject.create(null);
+ testProject.open(null);
+ /*IProjectDescription projectDescription = testProject.getDescription();
+ String[] natureIds = { "org.eclipse.jdt.core.javanature" };
+ projectDescription.setNatureIds(natureIds);*/
+ /*ICommand buildCommand = new BuildCommand();
+ buildCommand.setBuilderName("org.eclipse.jdt.core.javabuilder");
+ projectDescription.setBuildSpec(new ICommand[] { buildCommand });
+ testProject.setDescription(projectDescription, null);*/
+
+ for (int i = 0; i < EditorPerformanceSuite.EDITOR_FILE_EXTENSIONS.length; i++) {
+ createFiles(EditorPerformanceSuite.EDITOR_FILE_EXTENSIONS[i]);
+ }
+ }
+
+
+ /**
+ * @param ext
+ * @throws CoreException
+ */
+ private void createFiles(String ext) throws CoreException {
+ for (int i = 0; i < 100; i++) {
+ String fileName = i + "." + ext;
+ IFile iFile = testProject.getFile(fileName);
+ iFile.create(new ByteArrayInputStream(new byte[] { '\n' }), true, null);
+ }
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSuite.java
new file mode 100644
index 0000000000..e5714ea1a1
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSuite.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ui.tests.performance.presentations.PresentationPerformanceTestSuite;
+
+/**
+ * Test all areas of the UI API.
+ */
+public class UIPerformanceTestSuite extends TestSuite {
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new UIPerformanceTestSetup(new UIPerformanceTestSuite());
+ }
+
+ /**
+ * Construct the test suite.
+ */
+ public UIPerformanceTestSuite() {
+ addTest(new ActivitiesPerformanceSuite());
+ addTest(new PresentationPerformanceTestSuite());
+ addTest(new WorkbenchPerformanceSuite());
+ addTest(new ViewPerformanceSuite());
+ addTest(new EditorPerformanceSuite());
+// addTest(new TestSuite(CommandsPerformanceTest.class));
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ViewPerformanceSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ViewPerformanceSuite.java
new file mode 100644
index 0000000000..c8603fd3e5
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/ViewPerformanceSuite.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import java.util.HashSet;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.tests.performance.layout.ResizeTest;
+import org.eclipse.ui.tests.performance.layout.ViewWidgetFactory;
+import org.eclipse.ui.views.IViewDescriptor;
+
+/**
+ * @since 3.1
+ */
+public class ViewPerformanceSuite extends TestSuite {
+
+ public static final String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer";
+
+ public static final String BASIC_PATH = "org.eclipse.ui";
+
+ public static final String VIEWS_PATTERN = "org.eclipse.ui.views";
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new ViewPerformanceSuite();
+ }
+
+ /**
+ *
+ */
+ public ViewPerformanceSuite() {
+ addOpenCloseTests();
+ addResizeTests();
+// addTestSuite(OpenNavigatorFolderTest.class);
+ }
+
+ /**
+ *
+ */
+ private void addOpenCloseTests() {
+ String[] ids = getAllTestableViewIds();
+
+ for (int i = 0; i < ids.length; i++) {
+ String id = ids[i];
+
+ addTest(new OpenCloseViewTest(id,
+ id.equals(PROJECT_EXPLORER) ? BasicPerformanceTest.GLOBAL
+ : BasicPerformanceTest.NONE));
+ }
+ }
+
+ private void addResizeTests() {
+ String[] ids = getAllTestableViewIds();
+
+ for (int i = 0; i < ids.length; i++) {
+ String id = ids[i];
+
+ addTest(new ResizeTest(new ViewWidgetFactory(id)));
+ }
+
+ }
+
+ public static String[] getAllTestableViewIds() {
+ HashSet result = new HashSet();
+
+ IViewDescriptor[] descriptors = Workbench.getInstance()
+ .getViewRegistry().getViews();
+ for (int i = 0; i < descriptors.length; i++) {
+ IViewDescriptor descriptor = descriptors[i];
+
+ String[] categoryPath = descriptor.getCategoryPath();
+
+ if (categoryPath == null)
+ continue;
+
+ for (int j = 0; j < categoryPath.length; j++) {
+ // Only test basic views
+ if (categoryPath[j].equals(BASIC_PATH)) {
+ if (descriptor.getId().indexOf(VIEWS_PATTERN) >= 0
+ || descriptor.getId().equals(PROJECT_EXPLORER)) {
+ result.add(descriptor.getId());
+ }
+ }
+ }
+
+ }
+
+ return (String[]) result.toArray(new String[result.size()]);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/WorkbenchPerformanceSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/WorkbenchPerformanceSuite.java
new file mode 100644
index 0000000000..e229c5cc95
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/WorkbenchPerformanceSuite.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance;
+
+import java.util.ArrayList;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.tests.harness.util.EmptyPerspective;
+import org.eclipse.ui.tests.performance.layout.ComputeSizeTest;
+import org.eclipse.ui.tests.performance.layout.LayoutTest;
+import org.eclipse.ui.tests.performance.layout.PerspectiveWidgetFactory;
+import org.eclipse.ui.tests.performance.layout.RecursiveTrimLayoutWidgetFactory;
+import org.eclipse.ui.tests.performance.layout.ResizeTest;
+import org.eclipse.ui.tests.performance.layout.TestWidgetFactory;
+
+/**
+ * @since 3.1
+ */
+public class WorkbenchPerformanceSuite extends TestSuite {
+
+ private static String RESOURCE_PERSPID = "org.eclipse.ui.resourcePerspective";
+ // Note: to test perspective switching properly, we need perspectives with lots of
+ // associated actions.
+ // NOTE - do not change the order of the IDs below. the PerspectiveSwitchTest has a
+ // fingerprint test for performance that releys on this not changing.
+ public static final String [] PERSPECTIVE_IDS = {
+ EmptyPerspective.PERSP_ID2,
+ UIPerformanceTestSetup.PERSPECTIVE1,
+ RESOURCE_PERSPID,
+ "org.eclipse.jdt.ui.JavaPerspective",
+ "org.eclipse.debug.ui.DebugPerspective"};
+
+ // Perspective ID to use for the resize window fingerprint test
+ public static String resizeFingerprintTest = RESOURCE_PERSPID;
+
+ public static final String [][] PERSPECTIVE_SWITCH_PAIRS = {
+ // Test switching between the two most commonly used perspectives in the SDK (this is the most important
+ // perspective switch test, but it is easily affected by changes in JDT, etc.)
+ {"org.eclipse.jdt.ui.JavaPerspective", "org.eclipse.debug.ui.DebugPerspective", "1.java"},
+
+ {UIPerformanceTestSetup.PERSPECTIVE1, UIPerformanceTestSetup.PERSPECTIVE2, "1.perf_basic"},
+
+ {"org.eclipse.ui.tests.dnd.dragdrop", "org.eclipse.ui.tests.fastview_perspective", "1.perf_basic"},
+
+ // Test switching between a perspective with lots of actions and a perspective with none
+ {"org.eclipse.jdt.ui.JavaPerspective", "org.eclipse.ui.tests.util.EmptyPerspective", "1.perf_basic"},
+
+ {RESOURCE_PERSPID, "org.eclipse.jdt.ui.JavaPerspective", "1.java"}
+ };
+
+ public static final String[] VIEW_IDS = {
+ "org.eclipse.ui.views.ProblemView",
+ "org.eclipse.ui.views.ResourceNavigator"
+ };
+ public static final int ITERATIONS = 25;
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new WorkbenchPerformanceSuite();
+ }
+
+ /**
+ *
+ */
+ public WorkbenchPerformanceSuite() {
+ addLayoutScenarios();
+ addResizeScenarios();
+ addPerspectiveSwitchScenarios();
+ addPerspectiveOpenCloseScenarios();
+ addWindowOpenCloseScenarios();
+ addContributionScenarios();
+ }
+
+ /**
+ *
+ */
+ private void addContributionScenarios() {
+// addTest(new ObjectContributionsPerformance(
+// "large selection, limited contributors",
+// ObjectContributionsPerformance.generateAdaptableSelection(
+// ObjectContributionsPerformance.SEED, 5000),
+// BasicPerformanceTest.NONE));
+// addTest(new ObjectContributionsPerformance(
+// "limited selection, limited contributors",
+// ObjectContributionsPerformance.generateAdaptableSelection(
+// ObjectContributionsPerformance.SEED, 50),
+// BasicPerformanceTest.NONE));
+ }
+
+ /**
+ *
+ */
+ private void addWindowOpenCloseScenarios() {
+// for (int i = 0; i < PERSPECTIVE_IDS.length; i++) {
+// addTest(new OpenCloseWindowTest(PERSPECTIVE_IDS[i], BasicPerformanceTest.NONE));
+// }
+ }
+
+ /**
+ *
+ *
+ */
+ private void addPerspectiveOpenCloseScenarios() {
+// for (int i = 0; i < PERSPECTIVE_IDS.length; i++) {
+// addTest(new OpenClosePerspectiveTest(PERSPECTIVE_IDS[i], i == 1 ? BasicPerformanceTest.LOCAL : BasicPerformanceTest.NONE));
+// }
+ }
+
+ /**
+ *
+ */
+ private void addPerspectiveSwitchScenarios() {
+// for (int i = 0; i < PERSPECTIVE_SWITCH_PAIRS.length; i++) {
+// addTest(new PerspectiveSwitchTest(PERSPECTIVE_SWITCH_PAIRS[i], BasicPerformanceTest.NONE));
+// }
+ }
+
+ /**
+ * Add performance tests for the layout of the given widget
+ *
+ * @param factory
+ * @since 3.1
+ */
+ private void addLayoutScenarios(TestWidgetFactory factory) {
+
+ // Determine the effect of flushing the cache
+ addTest(new ComputeSizeTest(factory));
+
+ // Test layout(false)
+ addTest(new LayoutTest(factory, false));
+
+ // Test layout(true)
+ addTest(new LayoutTest(factory, true));
+
+ // Test resizing
+ addTest(new ResizeTest(factory));
+ }
+
+ private void addLayoutScenarios() {
+ addLayoutScenarios(new RecursiveTrimLayoutWidgetFactory());
+ }
+
+ public static String[] getAllPerspectiveIds() {
+ ArrayList result = new ArrayList();
+ IPerspectiveDescriptor[] perspectives = Workbench.getInstance().getPerspectiveRegistry().getPerspectives();
+
+ for (int i = 0; i < perspectives.length; i++) {
+ IPerspectiveDescriptor descriptor = perspectives[i];
+ String id = descriptor.getId();
+ result.add(id);
+ }
+
+ return (String[]) result.toArray(new String[result.size()]);
+ }
+
+ /**
+ *
+ */
+ private void addResizeScenarios() {
+ String[] perspectiveIds = getAllPerspectiveIds();
+ for (int i = 0; i < perspectiveIds.length; i++) {
+ String id = perspectiveIds[i];
+ addTest(new ResizeTest(new PerspectiveWidgetFactory(id),
+ id.equals(resizeFingerprintTest) ? BasicPerformanceTest.LOCAL : BasicPerformanceTest.NONE,
+ "UI - Workbench Window Resize"));
+ }
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ComputeSizeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ComputeSizeTest.java
new file mode 100644
index 0000000000..ea00221bb6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ComputeSizeTest.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+
+/**
+ * Measures the performance of a widget's computeSize method
+ *
+ * @since 3.1
+ */
+public class ComputeSizeTest extends BasicPerformanceTest {
+
+ private TestWidgetFactory widgetFactory;
+ private int xIterations = 10;
+ private int yIterations = 10;
+
+ /**
+ * @param testName
+ */
+ public ComputeSizeTest(TestWidgetFactory widgetFactory) {
+ super(widgetFactory.getName() + " computeSize");
+
+ this.widgetFactory = widgetFactory;
+ }
+
+ /**
+ * Run the test
+ */
+ protected void runTest() throws CoreException, WorkbenchException {
+
+ widgetFactory.init();
+ final Composite widget = widgetFactory.getControl();
+ //Rectangle initialBounds = widget.getBounds();
+ final Point maxSize = widgetFactory.getMaxSize();
+
+ // Iteration counter. We increment this each pass through the loop in order to
+ // generate slightly different test data each time
+ final int[] counter = new int[] {0};
+
+ for (int j = 0; j < 100; j++) {
+ // This counter determines whether we're computing a width,
+ // height, or fixed
+ // size and whether or not we flush the cache.
+
+ // We do things this way to avoid calling computeSize with the same (or
+ // similar) values
+ // twice in a row, which would be too easy to cache.
+ int count = counter[0];
+
+ startMeasuring();
+ for (int i = 0; i < 200; i++) {
+
+ for (int xIteration = 0; xIteration < xIterations; xIteration++) {
+
+ for (int yIteration = 0; yIteration < yIterations; yIteration++) {
+ // Avoid giving the same x value twice in a row in order to make it hard to cache
+ int xSize = maxSize.x * ((xIteration + yIteration) % xIterations) / xIterations;
+ int ySize = maxSize.y * yIteration / yIterations;
+
+ // Alternate between flushing and not flushing the cache
+ boolean flushState = (count % 2) != 0;
+
+ // Alternate between width, height, and fixed, and default size queries
+ // (note: we need to alternate in order to make the result hard to cache)
+ switch(count % 4) {
+ case 0: widget.computeSize(xSize, SWT.DEFAULT, flushState); break;
+ case 1: widget.computeSize(SWT.DEFAULT, ySize, flushState); break;
+ case 2: widget.computeSize(xSize, ySize, flushState); break;
+ case 3: widget.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushState); break;
+ }
+
+ count++;
+ }
+ }
+
+ }
+ stopMeasuring();
+ processEvents();
+ counter[0]++;
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ widgetFactory.done();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ConstantAreaLayout.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ConstantAreaLayout.java
new file mode 100644
index 0000000000..ce3f360d11
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ConstantAreaLayout.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Layout;
+
+/**
+ * A very efficient (but useless) layout with complicated preferred size behavior.
+ * Its preferred size attempts to maintain a constant area. This can be used for
+ * performance testing other layouts (by attaching this to child Composites in the
+ * layout being tested). It will give a good estimate as to how the layout will
+ * handle wrapping widgets.
+ *
+ * @since 3.1
+ */
+public class ConstantAreaLayout extends Layout {
+
+ private int area;
+ private int preferredWidth;
+
+ public ConstantAreaLayout(int area, int preferredWidth) {
+ this.area = area;
+ this.preferredWidth = preferredWidth;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int, boolean)
+ */
+ protected Point computeSize(Composite composite, int wHint, int hHint,
+ boolean flushCache) {
+
+ if (wHint == 0 || hHint == 0) {
+ return new Point(1,1);
+ }
+
+ if (wHint == SWT.DEFAULT) {
+ if (hHint == SWT.DEFAULT) {
+ wHint = preferredWidth;
+ } else {
+ wHint = area / hHint;
+ }
+ }
+
+ if (hHint == SWT.DEFAULT) {
+ hHint = area / wHint;
+ }
+
+ return new Point(wHint, hHint);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
+ */
+ protected void layout(Composite composite, boolean flushCache) {
+
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/EditorWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/EditorWidgetFactory.java
new file mode 100644
index 0000000000..0f759b26ae
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/EditorWidgetFactory.java
@@ -0,0 +1,105 @@
+///*******************************************************************************
+// * Copyright (c) 2004, 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// *******************************************************************************/
+//package org.eclipse.ui.tests.performance.layout;
+//
+//import junit.framework.Assert;
+//
+//import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.resources.IProject;
+//import org.eclipse.core.resources.IWorkspace;
+//import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.swt.widgets.Composite;
+//import org.eclipse.ui.IEditorPart;
+//import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchWindow;
+//import org.eclipse.ui.PlatformUI;
+//import org.eclipse.ui.WorkbenchException;
+//import org.eclipse.ui.ide.IDE;
+//import org.eclipse.ui.internal.EditorSite;
+//import org.eclipse.ui.internal.PartPane;
+//import org.eclipse.ui.tests.harness.util.EmptyPerspective;
+//import org.eclipse.ui.tests.harness.util.UITestCase;
+//import org.eclipse.ui.tests.performance.UIPerformanceTestSetup;
+//
+///**
+// * @since 3.1
+// */
+//public class EditorWidgetFactory extends TestWidgetFactory {
+//
+// private String editorId;
+// private String filename;
+// private IWorkbenchWindow window;
+// private Composite ctrl;
+//
+// public EditorWidgetFactory(String filename) {
+// this.filename = filename;
+// this.editorId = null;
+// }
+//
+// public EditorWidgetFactory(String filename, String editorId) {
+// this.filename = filename;
+// this.editorId = editorId;
+// }
+//
+// public static Composite getControl(IEditorPart part) {
+// EditorSite site = (EditorSite)part.getSite();
+//
+// PartPane pane = site.getPane();
+//
+// return (Composite)pane.getControl();
+// }
+//
+// /* (non-Javadoc)
+// * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#getName()
+// */
+// public String getName() {
+// return "editor " + filename + (editorId != null ? editorId : "");
+// }
+//
+// /* (non-Javadoc)
+// * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#init()
+// */
+// public void init() throws CoreException, WorkbenchException {
+//
+// // Open an editor in a new window.
+// window = PlatformUI.getWorkbench().openWorkbenchWindow(EmptyPerspective.PERSP_ID, UITestCase.getPageInput());
+// IWorkbenchPage activePage = window.getActivePage();
+// Assert.assertNotNull(activePage);
+//
+// IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// IProject testProject = workspace.getRoot().getProject(UIPerformanceTestSetup.PROJECT_NAME);
+// IFile file = testProject.getFile(filename);
+//
+// if (editorId == null) {
+// editorId = IDE.getEditorDescriptor(file).getId();
+// }
+//
+// IEditorPart part = IDE.openEditor(activePage, file, editorId, true);
+// ctrl = getControl(part);
+// }
+//
+// /* (non-Javadoc)
+// * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#getControl()
+// */
+// public Composite getControl() throws CoreException, WorkbenchException {
+// return ctrl;
+// }
+//
+// /* (non-Javadoc)
+// * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#done()
+// */
+// public void done() throws CoreException, WorkbenchException {
+// window.close();
+// super.done();
+// }
+//
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/LayoutTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/LayoutTest.java
new file mode 100644
index 0000000000..bf1f3f1d2e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/LayoutTest.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.util.Geometry;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+
+/**
+ * Measures the time required to layout the widget 10 times. Does not include
+ * the time required for any deferred repaints.
+ *
+ * @since 3.1
+ */
+public class LayoutTest extends BasicPerformanceTest {
+
+ private TestWidgetFactory widgetFactory;
+
+ private int xIterations = 100;
+
+ private int yIterations = 10;
+
+ private boolean flushState;
+
+ /**
+ * @param testName
+ */
+ public LayoutTest(TestWidgetFactory widgetFactory, boolean flushState) {
+ super(widgetFactory.getName() + " layout("
+ + (flushState ? "true" : "false") + ")");
+
+ this.widgetFactory = widgetFactory;
+ this.flushState = flushState;
+ }
+
+ /**
+ * Run the test
+ */
+ protected void runTest() throws CoreException, WorkbenchException {
+
+ widgetFactory.init();
+ final Composite widget = widgetFactory.getControl();
+ final Point maxSize = widgetFactory.getMaxSize();
+ Rectangle initialBounds = widget.getBounds();
+ final Rectangle newBounds = Geometry.copy(initialBounds);
+
+ // This test is different now duw to trim API changes so 'gray' it...
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=129001>See Bug 129001</a> ");
+
+ for (int xIteration = 0; xIteration < xIterations; xIteration++) {
+
+ processEvents();
+
+ startMeasuring();
+
+ for (int yIteration = 0; yIteration < yIterations; yIteration++) {
+ // Avoid giving the same x value twice in a row in order to make
+ // it hard to cache
+ int xSize = maxSize.x
+ * ((xIteration + yIteration) % xIterations)
+ / xIterations;
+ int ySize = maxSize.y * yIteration / yIterations;
+
+ newBounds.width = xSize;
+ newBounds.height = ySize;
+
+ widget.setBounds(newBounds);
+ widget.layout(flushState);
+ }
+
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+
+ widget.setBounds(initialBounds);
+ widgetFactory.done();
+ }
+}
+
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PerspectiveWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PerspectiveWidgetFactory.java
new file mode 100644
index 0000000000..143fdfcc62
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PerspectiveWidgetFactory.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.tests.harness.util.UITestCase;
+
+/**
+ * @since 3.1
+ */
+public class PerspectiveWidgetFactory extends TestWidgetFactory {
+
+ private String perspectiveId;
+ private IWorkbenchWindow window;
+
+ public PerspectiveWidgetFactory(String initialPerspective) {
+ perspectiveId = initialPerspective;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getMaxSize()
+ */
+ public Point getMaxSize() {
+ return new Point(1024, 768);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#init()
+ */
+ public void init() throws WorkbenchException {
+ // open the perspective in a new window
+ window = PlatformUI.getWorkbench().openWorkbenchWindow(perspectiveId, UITestCase.getPageInput());
+ IWorkbenchPage page = window.getActivePage();
+ Assert.assertNotNull(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getName()
+ */
+ public String getName() {
+ return "Perspective " + perspectiveId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getControl()
+ */
+ public Composite getControl() {
+ return window.getShell();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#done()
+ */
+ public void done() throws CoreException, WorkbenchException {
+ window.close();
+ super.done();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PresentationWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PresentationWidgetFactory.java
new file mode 100644
index 0000000000..4446d51e37
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PresentationWidgetFactory.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.internal.presentations.PresentationFactoryUtil;
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.UIPerformancePlugin;
+import org.eclipse.ui.tests.performance.presentations.PresentationTestbed;
+import org.eclipse.ui.tests.performance.presentations.TestPresentablePart;
+
+public class PresentationWidgetFactory extends TestWidgetFactory {
+
+ private AbstractPresentationFactory factory;
+ private int type;
+ private Shell shell;
+ private Image img;
+ private Control ctrl;
+ private int numParts;
+
+ public PresentationWidgetFactory(AbstractPresentationFactory factory, int type, int numParts) {
+ this.factory = factory;
+ this.type = type;
+ this.numParts = numParts;
+ }
+
+ public void init() throws CoreException, WorkbenchException {
+ super.init();
+
+ img = UIPerformancePlugin.getImageDescriptor("icons/anything.gif").createImage();
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+
+ shell = new Shell(display);
+
+ TestPresentablePart selection = null;
+ PresentationTestbed testBed = new PresentationTestbed(shell, factory, type);
+ for(int partCount = 0; partCount < numParts; partCount++) {
+ TestPresentablePart part = new TestPresentablePart(shell, img);
+ part.setName("Some part");
+ part.setContentDescription("Description");
+ part.setTitle("Some title");
+ part.setDirty(partCount % 2 == 0);
+ part.setTooltip("This is a tooltip");
+ testBed.add(part);
+ selection = part;
+ }
+
+ testBed.setSelection(selection);
+
+ ctrl = testBed.getControl();
+ shell.setBounds(0,0,1024,768);
+ ctrl.setBounds(shell.getClientArea());
+ shell.setVisible(true);
+ }
+
+ public void done() throws CoreException, WorkbenchException {
+ shell.dispose();
+// img.dispose();
+
+ super.done();
+ }
+
+ public static String describePresentation(AbstractPresentationFactory factory, int type) {
+ String typeDesc = "unknown";
+
+ switch(type) {
+ case PresentationFactoryUtil.ROLE_EDITOR: typeDesc = "editor"; break;
+ case PresentationFactoryUtil.ROLE_STANDALONE: typeDesc = "standalone with title"; break;
+ case PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE: typeDesc = "standalone without title"; break;
+ case PresentationFactoryUtil.ROLE_VIEW: typeDesc = "view"; break;
+ }
+
+ return "Presentation " + factory.getId() + " " + typeDesc;
+
+ }
+
+ public String getName() {
+ return describePresentation(factory, type);
+ }
+
+ public Composite getControl() throws CoreException, WorkbenchException {
+ return (Composite)ctrl;
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/RecursiveTrimLayoutWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/RecursiveTrimLayoutWidgetFactory.java
new file mode 100644
index 0000000000..2084a7e6d6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/RecursiveTrimLayoutWidgetFactory.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.internal.WindowTrimProxy;
+import org.eclipse.ui.internal.layout.TrimLayout;
+
+/**
+ * @since 3.1
+ */
+public class RecursiveTrimLayoutWidgetFactory extends TestWidgetFactory {
+
+ private Shell shell;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#getName()
+ */
+ public String getName() {
+ return "Massively Recursive TrimLayout";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#done()
+ */
+ public void done() throws CoreException, WorkbenchException {
+ super.done();
+
+ shell.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#init()
+ */
+ public void init() throws CoreException, WorkbenchException {
+ super.init();
+
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+
+ shell = new Shell(display);
+
+ createTrimLayout(shell, 10, SWT.TOP);
+
+ shell.setBounds(0,0,1024,768);
+ shell.setVisible(true);
+ }
+
+
+ /**
+ * Create a set of recursive trim layouts with the given depth. That is, the
+ * trim controls themselves are also trim layouts. This ensures that TrimLayout
+ * can handle
+ * Note that this
+ * will create O(2^depth) children.
+ *
+ * @param composite
+ * @param depth
+ * @param side
+ * @since 3.1
+ */
+ public void createTrimLayout(Composite composite, int depth, int side) {
+ if (depth == 0) {
+ composite.setLayout(new ConstantAreaLayout(5000, 300));
+ } else {
+ TrimLayout layout = new TrimLayout();
+
+ composite.setLayout(layout);
+
+ int nextSide = SWT.TOP;
+
+ switch (side) {
+ case SWT.TOP : nextSide = SWT.RIGHT; break;
+ case SWT.RIGHT : nextSide = SWT.BOTTOM; break;
+ case SWT.BOTTOM : nextSide = SWT.LEFT; break;
+ case SWT.LEFT : nextSide = SWT.TOP; break;
+ }
+
+ // Add a resizable child
+ Composite child = new Composite(composite, SWT.NONE);
+ WindowTrimProxy proxy = new WindowTrimProxy(child,
+ "child1." + side + "." + depth, "Resizable Child", SWT.NONE, true);
+ layout.addTrim(side, proxy);
+ createTrimLayout(child, depth - 1, nextSide);
+
+ // Add a non-resizable child
+ child = new Composite(composite, SWT.NONE);
+ proxy = new WindowTrimProxy(child,
+ "child2." + side + "." + depth, "Non-Resizable Child", SWT.NONE, false);
+ layout.addTrim(side, proxy);
+ createTrimLayout(child, depth - 1, nextSide);
+
+ // Fill the client area
+ child = new Composite(composite, SWT.NONE);
+ layout.setCenterControl(child);
+ child.setLayout(new ConstantAreaLayout(3000, 150));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#getControl()
+ */
+ public Composite getControl() throws CoreException, WorkbenchException {
+ return shell;
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ResizeTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ResizeTest.java
new file mode 100644
index 0000000000..5eb3ab55de
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ResizeTest.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+
+/**
+ * Measures the time to resize the widget 10 times, including the time required
+ * to redraw.
+ *
+ * @since 3.1
+ */
+public class ResizeTest extends BasicPerformanceTest {
+
+ private TestWidgetFactory widgetFactory;
+
+ private int xIterations = 5;
+
+ private int yIterations = 5;
+
+ private String tagString;
+
+
+
+ /**
+ * Create a new instance of the receiver.
+ * @param factory
+ */
+ public ResizeTest(TestWidgetFactory factory) {
+ this(factory, NONE, factory.getName() + " setSize");
+ }
+
+
+
+ /**
+ * Create a new instance of the receiver.
+ * @param factory
+ * @param tagging
+ * @param tag
+ */
+ public ResizeTest(TestWidgetFactory factory, int tagging,
+ String tag) {
+ super(factory.getName() + " setSize", tagging);
+ this.tagString = tag;
+ this.widgetFactory = factory;
+ }
+
+ /**
+ * Run the test
+ */
+ protected void runTest() throws CoreException, WorkbenchException {
+
+ tagIfNecessary(tagString, Dimension.ELAPSED_PROCESS);
+
+ widgetFactory.init();
+ final Composite widget = widgetFactory.getControl();
+ Rectangle initialBounds = widget.getBounds();
+ final Point maxSize = widgetFactory.getMaxSize();
+
+ waitForBackgroundJobs();
+ processEvents();
+ for (int j = 0; j < 50; j++) {
+
+ startMeasuring();
+ for (int i = 0; i < 2; i++) {
+
+ for (int xIteration = 0; xIteration < xIterations; xIteration += 5) {
+
+ for (int yIteration = 0; yIteration < yIterations; yIteration++) {
+ // Avoid giving the same x value twice in a row in order
+ // to make it hard to cache
+ int xSize = maxSize.x
+ * ((xIteration + yIteration) % xIterations)
+ / xIterations;
+ int ySize = maxSize.y * yIteration / yIterations;
+
+ widget.setSize(xSize, ySize);
+
+ processEvents();
+ }
+
+ }
+
+ }
+ stopMeasuring();
+ }
+ commitMeasurements();
+ assertPerformance();
+
+ widget.setBounds(initialBounds);
+ widgetFactory.done();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/TestWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/TestWidgetFactory.java
new file mode 100644
index 0000000000..c7b4f725a6
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/TestWidgetFactory.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.util.Geometry;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.WorkbenchException;
+
+/**
+ * @since 3.1
+ */
+public abstract class TestWidgetFactory {
+ public Point getMaxSize() throws CoreException, WorkbenchException {
+ Composite control = getControl();
+ Composite parent = control.getParent();
+
+ if (parent == null) {
+ return new Point(800, 600);
+ }
+ return Geometry.getSize(parent.getClientArea());
+ }
+ public void init() throws CoreException, WorkbenchException {}
+ public void done() throws CoreException, WorkbenchException {}
+ public abstract String getName();
+ public abstract Composite getControl() throws CoreException, WorkbenchException;
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ViewWidgetFactory.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ViewWidgetFactory.java
new file mode 100644
index 0000000000..5d7784cdce
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ViewWidgetFactory.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.layout;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.internal.PartPane;
+import org.eclipse.ui.internal.ViewSite;
+import org.eclipse.ui.tests.harness.util.EmptyPerspective;
+import org.eclipse.ui.tests.harness.util.UITestCase;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+
+/**
+ * @since 3.1
+ */
+public class ViewWidgetFactory extends TestWidgetFactory {
+
+ private String viewId;
+ private Control ctrl;
+ private IWorkbenchWindow window;
+
+ public ViewWidgetFactory(String viewId) {
+ this.viewId = viewId;
+ Assert.assertNotNull(viewId);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getMaxSize()
+ */
+ public Point getMaxSize() {
+ return new Point(1024, 768);
+ }
+
+ public static Composite getControl(IViewPart part) {
+ ViewSite site = (ViewSite)part.getSite();
+
+ PartPane pane = site.getPane();
+
+ return (Composite)pane.getControl();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#init()
+ */
+ public void init() throws CoreException, WorkbenchException {
+ // open the view in a new window
+ window = PlatformUI.getWorkbench().openWorkbenchWindow(EmptyPerspective.PERSP_ID, UITestCase.getPageInput());
+ IWorkbenchPage page = window.getActivePage();
+ Assert.assertNotNull(page);
+
+ IViewPart part = page.showView(viewId, null, IWorkbenchPage.VIEW_ACTIVATE);
+
+ BasicPerformanceTest.waitForBackgroundJobs();
+
+ ctrl = getControl(part);
+
+ Point size = getMaxSize();
+ ctrl.setBounds(0,0,size.x, size.y);
+ window.getShell().setSize(size);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getName()
+ */
+ public String getName() {
+ return "View " + viewId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.TestWidgetFactory#getControl()
+ */
+ public Composite getControl() throws CoreException, WorkbenchException {
+ return (Composite)ctrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.tests.performance.layout.TestWidgetFactory#done()
+ */
+ public void done() throws CoreException, WorkbenchException {
+ window.close();
+ super.done();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/marked.txt b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/marked.txt
new file mode 100644
index 0000000000..1c63f0cc5a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/marked.txt
@@ -0,0 +1,12 @@
+window resizing
+perf1/perf2 perspective switching
+
+ V basic view open/close
+ V empty perspective open/close
+ V perf_basic editor open/close
+ V perf_basic closeAll
+ V perf1 open/close window
+
+* ask Stefan for one interesting test
+
+view to editor switching \ No newline at end of file
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceEditorPart.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceEditorPart.java
new file mode 100644
index 0000000000..a6ca32a3fb
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceEditorPart.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance.parts;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+/**
+ * @since 3.1
+ */
+public class PerformanceEditorPart extends EditorPart {
+
+ private static final String PARAM_OUTLINE = "outline";
+
+ private boolean dirty;
+ private Label control;
+ private boolean useOutline = false;
+
+ /**
+ *
+ */
+ public PerformanceEditorPart() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void doSave(IProgressMonitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISaveablePart#doSaveAs()
+ */
+ public void doSaveAs() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ super.setSite(site);
+ super.setInput(input);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISaveablePart#isDirty()
+ */
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public void setDirty(boolean dirty) {
+ this.dirty = dirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
+ */
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ control = new Label(parent, SWT.NONE);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ control.setFocus();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ public void setInitializationData(IConfigurationElement cfig,
+ String propertyName, Object data) {
+ super.setInitializationData(cfig, propertyName, data);
+
+ if (data instanceof String) {
+ for (StringTokenizer toker = new StringTokenizer((String) data, ","); toker.hasMoreTokens(); ) {
+ String token = toker.nextToken();
+ if (token.equals(PARAM_OUTLINE))
+ useOutline = true;
+ }
+
+ }
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ Object object = null;
+ if (useOutline && adapter.equals(IContentOutlinePage.class)) {
+ object = new ContentOutlinePage() {
+ };
+ }
+ if (object != null)
+ return object;
+ return super.getAdapter(adapter);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceProblemsView.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceProblemsView.java
new file mode 100644
index 0000000000..bf88aca301
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceProblemsView.java
@@ -0,0 +1,28 @@
+///*******************************************************************************
+// * Copyright (c) 2006 IBM Corporation and others.
+// * All rights reserved. This program and the accompanying materials
+// * are made available under the terms of the Eclipse Public License v1.0
+// * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+// *
+// * Contributors:
+// * IBM Corporation - initial API and implementation
+// ******************************************************************************/
+//
+//package org.eclipse.ui.tests.performance.parts;
+//
+//import org.eclipse.swt.widgets.Tree;
+//import org.eclipse.ui.views.markers.internal.ProblemView;
+//
+///**
+// * PerformanceProblemsView is a problems view created
+// * for the performance tests.
+// * @since 3.2
+// *
+// */
+//public class PerformanceProblemsView extends ProblemView {
+//
+// public Tree getTreeWidget(){
+// return getTree();
+// }
+//}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceViewPart.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceViewPart.java
new file mode 100644
index 0000000000..a683a72ae7
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceViewPart.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.parts;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * @since 3.1
+ */
+public class PerformanceViewPart extends ViewPart {
+
+ private Label control;
+
+ /**
+ *
+ */
+ public PerformanceViewPart() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ control = new Label(parent, SWT.NONE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ control.setFocus();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivateTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivateTest.java
new file mode 100644
index 0000000000..59596d7931
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivateTest.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.presentations.StackPresentation;
+import org.eclipse.ui.tests.performance.TestRunnable;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+
+public class PresentationActivateTest extends PresentationPerformanceTest {
+
+ private int type;
+ private int number;
+ private AbstractPresentationFactory factory;
+
+ public PresentationActivateTest(AbstractPresentationFactory factory, int type, int number) {
+ super(PresentationWidgetFactory.describePresentation(factory, type) + " activation");
+ this.type = type;
+ this.number = number;
+ this.factory = factory;
+ }
+
+ protected void runTest() throws Throwable {
+ final PresentationTestbed testbed = createPresentation(factory, type, number);
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+
+ startMeasuring();
+
+ for (int i = 0; i < 100; i++) {
+ testbed.setActive(StackPresentation.AS_ACTIVE_FOCUS);
+ processEvents();
+ testbed.setActive(StackPresentation.AS_ACTIVE_NOFOCUS);
+ processEvents();
+ testbed.setActive(StackPresentation.AS_INACTIVE);
+ processEvents();
+ }
+
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivePartPropertyTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivePartPropertyTest.java
new file mode 100644
index 0000000000..af600f2ab9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivePartPropertyTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+
+public class PresentationActivePartPropertyTest extends PresentationPerformanceTest {
+
+ private int type;
+ private int number;
+ private int iterations;
+ private boolean fastTest;
+ private AbstractPresentationFactory factory;
+
+ public PresentationActivePartPropertyTest(AbstractPresentationFactory factory, int type, int number, boolean fastTest) {
+ super(PresentationWidgetFactory.describePresentation(factory, type) + " active part properties");
+ this.type = type;
+ this.number = number;
+ this.factory = factory;
+ this.fastTest = fastTest;
+
+ }
+
+ protected void runTest() throws Throwable {
+
+ setDegradationComment("<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=101072>See Bug 101072</a> ");
+
+ final PresentationTestbed testbed = createPresentation(factory, type, number);
+
+ final TestPresentablePart part = (TestPresentablePart)testbed.getSelection();
+
+ if(fastTest)
+ iterations = 300;
+ else
+ iterations = 5;
+
+ for (int j = 0; j < 50; j++) {
+
+ startMeasuring();
+ for (int i = 0; i < iterations; i++) {
+
+ twiddleProperty(DESCRIPTION, part);
+ twiddleProperty(DIRTY, part);
+ twiddleProperty(IMAGE, part);
+ twiddleProperty(NAME, part);
+ twiddleProperty(TITLE, part);
+ twiddleProperty(TOOLBAR, part);
+ twiddleProperty(TOOLTIP, part);
+
+ }
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationCreateTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationCreateTest.java
new file mode 100644
index 0000000000..9401767990
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationCreateTest.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.TestRunnable;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+
+public class PresentationCreateTest extends PresentationPerformanceTest {
+
+ private int type;
+ private int number;
+ private AbstractPresentationFactory factory;
+
+ public PresentationCreateTest(AbstractPresentationFactory factory, int type, int number) {
+ this(factory, type, number, "creation");
+ }
+
+ public PresentationCreateTest(AbstractPresentationFactory factory, int type, int number, String message) {
+ super(PresentationWidgetFactory.describePresentation(factory, type) + " " + message);
+ this.type = type;
+ this.number = number;
+ this.factory = factory;
+ }
+
+ protected void runTest() throws Throwable {
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+
+ startMeasuring();
+
+ PresentationTestbed testbed = createPresentation(factory, type, number);
+ processEvents();
+ testbed.getControl().dispose();
+ processEvents();
+
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationInactivePartPropertyTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationInactivePartPropertyTest.java
new file mode 100644
index 0000000000..f5df0dc936
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationInactivePartPropertyTest.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.TestRunnable;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+
+public class PresentationInactivePartPropertyTest extends PresentationPerformanceTest {
+
+ private int type;
+ private int number;
+ private AbstractPresentationFactory factory;
+
+ public PresentationInactivePartPropertyTest(AbstractPresentationFactory factory, int type, int number) {
+ super(PresentationWidgetFactory.describePresentation(factory, type) + " inactive part properties");
+ this.type = type;
+ this.number = number;
+ this.factory = factory;
+ }
+
+ protected void runTest() throws Throwable {
+ final PresentationTestbed testbed = createPresentation(factory, type, number);
+
+ final TestPresentablePart part = new TestPresentablePart(theShell, img);
+ testbed.add(part);
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+
+ startMeasuring();
+
+ for (int counter = 0; counter < 5; counter++) {
+ twiddleProperty(DESCRIPTION, part);
+ twiddleProperty(DIRTY, part);
+ twiddleProperty(IMAGE, part);
+ twiddleProperty(NAME, part);
+ twiddleProperty(TITLE, part);
+ twiddleProperty(TOOLBAR, part);
+ twiddleProperty(TOOLTIP, part);
+ }
+
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTest.java
new file mode 100644
index 0000000000..19fff57d6e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTest.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.BasicPerformanceTest;
+import org.eclipse.ui.tests.performance.UIPerformancePlugin;
+
+public class PresentationPerformanceTest extends BasicPerformanceTest {
+
+ protected Shell theShell;
+
+ protected Image img;
+
+ protected Image img2;
+
+ protected static final int NAME = 0;
+
+ protected static final int TITLE = 1;
+
+ protected static final int DIRTY = 2;
+
+ protected static final int DESCRIPTION = 3;
+
+ protected static final int TOOLTIP = 4;
+
+ protected static final int IMAGE = 5;
+
+ protected static final int TOOLBAR = 6;
+
+ public PresentationPerformanceTest(String testName) {
+ super(testName);
+ }
+
+ protected void doSetUp() throws Exception {
+ super.doSetUp();
+ theShell = new Shell(Display.getCurrent(), SWT.NONE);
+ theShell.setBounds(0, 0, 1024, 768);
+ theShell.setVisible(true);
+ img = UIPerformancePlugin.getImageDescriptor(
+ "icons/anything.gif").createImage();
+ img2 = UIPerformancePlugin.getImageDescriptor("icons/view.gif")
+ .createImage();
+ }
+
+ protected void doTearDown() throws Exception {
+ theShell.dispose();
+ theShell = null;
+// img.dispose();
+// img2.dispose();
+ super.doTearDown();
+ }
+
+ protected PresentationTestbed createPresentation(
+ AbstractPresentationFactory factory, int type, int numParts) {
+ TestPresentablePart selection = null;
+ PresentationTestbed testBed = new PresentationTestbed(theShell,
+ factory, type);
+ for (int partCount = 0; partCount < numParts; partCount++) {
+ TestPresentablePart part = new TestPresentablePart(theShell, img);
+ part.setName("Some part");
+ part.setContentDescription("Description");
+ part.setTitle("Some title");
+ part.setDirty(partCount % 2 == 0);
+ part.setTooltip("This is a tooltip");
+ testBed.add(part);
+ selection = part;
+ }
+
+ testBed.setSelection(selection);
+
+ Control ctrl = testBed.getControl();
+ ctrl.setBounds(theShell.getClientArea());
+ return testBed;
+ }
+
+ protected void twiddleProperty(int property, TestPresentablePart part) {
+ switch (property) {
+ case NAME: {
+ String originalName = part.getName();
+ part.setName("Some new name");
+ processEvents();
+ part.setName(originalName);
+ processEvents();
+ break;
+ }
+ case TITLE: {
+ String originalTitle = part.getTitle();
+ part.setTitle("Some new title");
+ processEvents();
+ part.setTitle(originalTitle);
+ processEvents();
+ break;
+ }
+ case DIRTY: {
+ boolean originalDirty = part.isDirty();
+ part.setDirty(!originalDirty);
+ processEvents();
+ part.setDirty(originalDirty);
+ processEvents();
+ break;
+ }
+ case DESCRIPTION: {
+ String originalDescription = part.getTitleStatus();
+ part.setContentDescription("Some new description");
+ processEvents();
+ part.setContentDescription(originalDescription);
+ processEvents();
+ break;
+ }
+ case TOOLTIP: {
+ String originalTooltip = part.getTitleToolTip();
+ part.setTooltip("Some new tooltip");
+ processEvents();
+ part.setTooltip(originalTooltip);
+ processEvents();
+ break;
+ }
+ case IMAGE: {
+ Image originalImage = part.getTitleImage();
+
+ part.setImage(img2);
+ processEvents();
+ part.setImage(originalImage);
+ processEvents();
+ break;
+ }
+ case TOOLBAR: {
+ ToolItem newItem = part.addToToolbar(img2);
+
+ processEvents();
+ part.removeFromToolbar(newItem);
+ processEvents();
+ break;
+ }
+ }
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTestSuite.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTestSuite.java
new file mode 100644
index 0000000000..e180108eb5
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTestSuite.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.tests.performance.presentations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.internal.IWorkbenchConstants;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.presentations.PresentationFactoryUtil;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+import org.eclipse.ui.tests.performance.layout.ResizeTest;
+
+/**
+ * @since 3.1
+ */
+public class PresentationPerformanceTestSuite extends TestSuite {
+
+
+ /**
+ * Returns the suite. This is required to use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new PresentationPerformanceTestSuite();
+ }
+
+ /**
+ *
+ */
+ public PresentationPerformanceTestSuite() {
+ String[] ids = getPresentationIds();
+
+ for (int i = 0; i < ids.length; i++) {
+ String string = ids[i];
+
+ addTests(string);
+ }
+ }
+
+ private void addTests(String presentationId) {
+ AbstractPresentationFactory factory = WorkbenchPlugin.getDefault().getPresentationFactory(presentationId);
+
+ addTest(new PresentationInactivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 5));
+ addTest(new PresentationInactivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_VIEW, 5));
+
+ addTest(new PresentationActivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 5, false));
+ addTest(new PresentationActivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_VIEW, 5, false));
+ addTest(new PresentationActivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_STANDALONE, 1, false));
+ if(presentationId.equals(IWorkbenchConstants.DEFAULT_PRESENTATION_ID))
+ addTest(new PresentationActivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE, 1, true));
+ else
+ addTest(new PresentationActivePartPropertyTest(factory, PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE, 1, false));
+
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 100, "large folder creation"));
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_VIEW, 100, "large folder creation"));
+
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 5));
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_VIEW, 5));
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_STANDALONE, 1));
+ addTest(new PresentationCreateTest(factory, PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE, 1));
+
+ addTest(new PresentationSelectTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 100));
+ addTest(new PresentationSelectTest(factory, PresentationFactoryUtil.ROLE_VIEW, 100));
+
+ addTest(new PresentationActivateTest(factory, PresentationFactoryUtil.ROLE_EDITOR, 5));
+ addTest(new PresentationActivateTest(factory, PresentationFactoryUtil.ROLE_VIEW, 5));
+ addTest(new PresentationActivateTest(factory, PresentationFactoryUtil.ROLE_STANDALONE, 1));
+ addTest(new PresentationActivateTest(factory, PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE, 1));
+
+ addTest(new ResizeTest(new PresentationWidgetFactory(factory, PresentationFactoryUtil.ROLE_EDITOR, 5)));
+ addTest(new ResizeTest(new PresentationWidgetFactory(factory, PresentationFactoryUtil.ROLE_VIEW, 5)));
+ addTest(new ResizeTest(new PresentationWidgetFactory(factory, PresentationFactoryUtil.ROLE_STANDALONE, 1)));
+ addTest(new ResizeTest(new PresentationWidgetFactory(factory, PresentationFactoryUtil.ROLE_STANDALONE_NOTITLE, 1)));
+
+ }
+
+ private static String[] getPresentationIds() {
+ return listIds(IWorkbenchRegistryConstants.PL_PRESENTATION_FACTORIES,
+ "factory");
+ }
+
+ private static String[] listIds(String extensionPointId, String elementName) {
+
+ List result = new ArrayList();
+
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
+ .getExtensionPoint(WorkbenchPlugin.PI_WORKBENCH, extensionPointId);
+ if (extensionPoint == null) {
+ WorkbenchPlugin
+ .log("Unable to find extension. Extension point: " + extensionPointId + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
+ return null;
+ }
+
+ // Loop through the config elements.
+ IConfigurationElement[] elements = extensionPoint
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ IConfigurationElement element = elements[j];
+ if (elementName == null || elementName.equals(element.getName())) {
+ String strID = element.getAttribute("id"); //$NON-NLS-1$
+ if (strID != null) {
+ result.add(strID);
+ }
+ }
+ }
+
+ return (String[]) result.toArray(new String[result.size()]);
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationSelectTest.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationSelectTest.java
new file mode 100644
index 0000000000..bdbc1125d3
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationSelectTest.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.presentations.IPresentablePart;
+import org.eclipse.ui.tests.performance.TestRunnable;
+import org.eclipse.ui.tests.performance.layout.PresentationWidgetFactory;
+
+public class PresentationSelectTest extends PresentationPerformanceTest {
+
+ private int type;
+ private int number;
+ private AbstractPresentationFactory factory;
+
+ public PresentationSelectTest(AbstractPresentationFactory factory, int type, int number) {
+ super(PresentationWidgetFactory.describePresentation(factory, type) + " selection change");
+ this.type = type;
+ this.number = number;
+ this.factory = factory;
+ }
+
+ protected void runTest() throws Throwable {
+ final PresentationTestbed testbed = createPresentation(factory, type, number);
+
+ final IPresentablePart[] parts = testbed.getPartList();
+
+ exercise(new TestRunnable() {
+ public void run() throws Exception {
+
+ startMeasuring();
+
+ for (int i = 0; i < parts.length; i++) {
+ IPresentablePart part = parts[i];
+
+ testbed.setSelection(part);
+ processEvents();
+ }
+
+ stopMeasuring();
+ }
+ });
+
+ commitMeasurements();
+ assertPerformance();
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationTestbed.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationTestbed.java
new file mode 100644
index 0000000000..4724bf0220
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationTestbed.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Chris Gross chris.gross@us.ibm.com Bug 107443
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.ui.ISizeProvider;
+import org.eclipse.ui.internal.DefaultStackPresentationSite;
+import org.eclipse.ui.internal.presentations.PresentationFactoryUtil;
+import org.eclipse.ui.presentations.AbstractPresentationFactory;
+import org.eclipse.ui.presentations.IPresentablePart;
+import org.eclipse.ui.presentations.IStackPresentationSite;
+import org.eclipse.ui.presentations.StackPresentation;
+
+public class PresentationTestbed {
+
+ private StackPresentation presentation;
+ private List partList = new ArrayList();
+ private IPresentablePart selectedPart;
+ private Composite control;
+
+ private DefaultStackPresentationSite site = new DefaultStackPresentationSite() {
+ public void close(IPresentablePart[] toClose) {}
+ public void flushLayout() {}
+ public IPresentablePart[] getPartList() {
+ return (IPresentablePart[]) partList.toArray(new IPresentablePart[partList.size()]);
+ }
+ public IPresentablePart getSelectedPart() {
+ return selectedPart;
+ }
+ public boolean isPartMoveable(IPresentablePart toMove) {
+ return true;
+ }
+ public boolean isStackMoveable() {
+ return true;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.presentations.IStackPresentationSite#getProperty(java.lang.String)
+ */
+ public String getProperty(String id) {
+ return null;
+ }
+ };
+
+ public PresentationTestbed(Composite parentComposite, AbstractPresentationFactory factory, int type) {
+ presentation = PresentationFactoryUtil.createPresentation(factory, type, parentComposite, site, null, null);
+ site.setPresentation(presentation);
+ control = new Composite(parentComposite, SWT.NONE);
+ control.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent e) {
+ updatePresentationBounds();
+ }
+ public void controlResized(ControlEvent e) {
+ updatePresentationBounds();
+ }
+ });
+
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ site.dispose();
+ }
+ });
+
+ control.setLayout(new Layout() {
+ protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
+ int widthHint = wHint == SWT.DEFAULT ? ISizeProvider.INFINITE : wHint;
+ int heightHint = hHint == SWT.DEFAULT ? ISizeProvider.INFINITE : hHint;
+
+ int width = 200;
+ int height = 200;
+ StackPresentation presentation = site.getPresentation();
+ if (presentation != null) {
+ width = presentation.computePreferredSize(true, widthHint, heightHint, widthHint);
+ height = presentation.computePreferredSize(false, heightHint, widthHint, heightHint);
+ }
+
+ if (width == ISizeProvider.INFINITE) {
+ width = 200;
+ }
+
+ if (height == ISizeProvider.INFINITE) {
+ height = 200;
+ }
+
+ return new Point(width, height);
+ }
+
+ protected void layout(Composite composite, boolean flushCache) {
+ }
+ });
+
+ control.setVisible(false);
+ site.setActive(StackPresentation.AS_ACTIVE_FOCUS);
+ site.setState(IStackPresentationSite.STATE_RESTORED);
+ }
+
+ public Control getControl() {
+ return control;
+ }
+
+ public void add(IPresentablePart part) {
+ partList.add(part);
+ site.getPresentation().addPart(part, null);
+ }
+
+ public void remove(IPresentablePart part) {
+ Assert.assertTrue(part != selectedPart);
+ partList.remove(part);
+ site.getPresentation().removePart(part);
+ }
+
+ public void setSelection(IPresentablePart newSelection) {
+ Assert.assertTrue(partList.contains(newSelection));
+
+ selectedPart = newSelection;
+ if (selectedPart != null) {
+ site.selectPart(newSelection);
+ }
+ }
+
+ public void setState(int newState) {
+ site.setPresentationState(newState);
+ }
+
+ public void setActive(int activeState) {
+ site.setActive(activeState);
+ }
+
+ public IPresentablePart[] getPartList() {
+ return (IPresentablePart[]) partList.toArray(new IPresentablePart[partList.size()]);
+ }
+
+ private void updatePresentationBounds() {
+ StackPresentation presentation = site.getPresentation();
+ if (presentation != null) {
+ presentation.setBounds(control.getBounds());
+ }
+ }
+
+ public IPresentablePart getSelection() {
+ return selectedPart;
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective.java
new file mode 100644
index 0000000000..ad825c5ec8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/**
+ * @since 3.1
+ */
+public class StandaloneViewPerspective implements IPerspectiveFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ // One standalone view (bookmarks) with trim
+ layout.addStandaloneView(IPageLayout.ID_BOOKMARKS, true,
+ IPageLayout.LEFT, 0.5f, IPageLayout.ID_EDITOR_AREA);
+
+ // One standalone view (problems) without trim
+ layout.addStandaloneView(IPageLayout.ID_PROBLEM_VIEW, false,
+ IPageLayout.RIGHT, 0.5f, IPageLayout.ID_EDITOR_AREA);
+
+ // One regular view (outline)
+ layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.BOTTOM, 0.5f, IPageLayout.ID_EDITOR_AREA);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective2.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective2.java
new file mode 100644
index 0000000000..4a873e2a96
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective2.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/**
+ * @since 3.1
+ */
+public class StandaloneViewPerspective2 implements IPerspectiveFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ // One standalone view (bookmarks) without trim
+ layout.addStandaloneView(IPageLayout.ID_BOOKMARKS, false,
+ IPageLayout.LEFT, 0.5f, IPageLayout.ID_EDITOR_AREA);
+
+ // One standalone view (problems) without trim
+ layout.addStandaloneView(IPageLayout.ID_PROBLEM_VIEW, false,
+ IPageLayout.RIGHT, 0.5f, IPageLayout.ID_EDITOR_AREA);
+
+ // One regular view (outline)
+ layout.addStandaloneView(IPageLayout.ID_OUTLINE, false, IPageLayout.BOTTOM, 0.5f, IPageLayout.ID_EDITOR_AREA);
+ }
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/TestPresentablePart.java b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/TestPresentablePart.java
new file mode 100644
index 0000000000..ba8549015c
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/TestPresentablePart.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.tests.performance.presentations;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.presentations.IPartMenu;
+import org.eclipse.ui.presentations.IPresentablePart;
+
+public class TestPresentablePart implements IPresentablePart {
+
+ private List listeners = new ArrayList();
+
+ private Composite control;
+ private String name = "";
+ private String title = "";
+ private String status = "";
+ private Image image;
+ private String tooltip = "";
+ private boolean dirty;
+ private ToolBar toolbar;
+
+ public TestPresentablePart(Composite parent, Image image) {
+ control = new Composite(parent, SWT.NONE);
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ disposed();
+ }
+ });
+
+ // Add some items to the toolbar
+ toolbar = new ToolBar(parent, SWT.WRAP);
+ for (int idx = 0; idx < 6; idx++) {
+ ToolItem item = new ToolItem(toolbar, SWT.PUSH);
+ item.setImage(image);
+ }
+ this.image = image;
+ }
+
+ // Set methods called from presentation (all ignored)
+ public void setBounds(Rectangle bounds) {
+ control.setBounds(bounds);
+ }
+
+ public void setVisible(boolean isVisible) {
+ control.setVisible(isVisible);
+ toolbar.setVisible(isVisible);
+ }
+
+ public void setFocus() {
+ control.setFocus();
+ }
+
+ public void addPropertyListener(IPropertyListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removePropertyListener(IPropertyListener listener) {
+ listeners.remove(listener);
+ }
+
+ private void firePropertyChange(int propertyId) {
+ for (int i = 0; i < listeners.size(); i++) {
+ ((IPropertyListener) listeners.get(i)).propertyChanged(this,
+ propertyId);
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getTitleStatus() {
+ return status;
+ }
+
+ public Image getTitleImage() {
+ return image;
+ }
+
+ public String getTitleToolTip() {
+ return tooltip;
+ }
+
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public boolean isBusy() {
+ return false;
+ }
+
+ public boolean isCloseable() {
+ return true;
+ }
+
+ public Control getToolBar() {
+ return toolbar;
+ }
+
+ public IPartMenu getMenu() {
+ return null;
+ }
+
+ public Control getControl() {
+ return control;
+ }
+
+ public void disposed() {
+ toolbar.dispose();
+ toolbar = null;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ firePropertyChange(IPresentablePart.PROP_TITLE);
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ firePropertyChange(IPresentablePart.PROP_PART_NAME);
+ }
+
+ public void setImage(Image newImage) {
+ this.image = newImage;
+ firePropertyChange(IPresentablePart.PROP_TITLE);
+ }
+
+ public void setContentDescription(String descr) {
+ this.status = descr;
+ firePropertyChange(IPresentablePart.PROP_CONTENT_DESCRIPTION);
+ }
+
+ public void setTooltip(String tooltip) {
+ this.tooltip = tooltip;
+ firePropertyChange(IPresentablePart.PROP_TITLE);
+ }
+
+ public void setDirty(boolean dirty) {
+ this.dirty = dirty;
+ firePropertyChange(IPresentablePart.PROP_DIRTY);
+ }
+
+ public ToolItem addToToolbar(Image toAdd) {
+ ToolItem item = new ToolItem(toolbar, SWT.PUSH);
+ item.setImage(toAdd);
+ firePropertyChange(IPresentablePart.PROP_TOOLBAR);
+ return item;
+ }
+
+ public void removeFromToolbar(ToolItem toRemove) {
+ toRemove.dispose();
+ firePropertyChange(IPresentablePart.PROP_TOOLBAR);
+ }
+
+ private ListenerList partPropertyListeners = new ListenerList();
+
+ private Map partProperties = new HashMap();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.presentations.IPresentablePart#addPartPropertyListener(org.eclipse.jface.util.IPropertyChangeListener)
+ */
+ public void addPartPropertyListener(IPropertyChangeListener listener) {
+ partPropertyListeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.presentations.IPresentablePart#getPartProperty(java.lang.String)
+ */
+ public String getPartProperty(String key) {
+ return (String) partProperties.get(key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.presentations.IPresentablePart#removePartPropertyListener(org.eclipse.jface.util.IPropertyChangeListener)
+ */
+ public void removePartPropertyListener(IPropertyChangeListener listener) {
+ partPropertyListeners.remove(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISizeProvider#computePreferredSize(boolean, int, int, int)
+ */
+ public int computePreferredSize(boolean width, int availableParallel,
+ int availablePerpendicular, int preferredResult) {
+ return preferredResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISizeProvider#getSizeFlags(boolean)
+ */
+ public int getSizeFlags(boolean width) {
+ return 0;
+ }
+
+}
diff --git a/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/test_ideas.txt b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/test_ideas.txt
new file mode 100644
index 0000000000..22f8fe7dc9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/src/org/eclipse/ui/tests/performance/test_ideas.txt
@@ -0,0 +1,42 @@
+- Startup time/memory use
+- About
+ - open about then open configuration details then close
+- Workbench [resize Workbench Shell] [switch active part leak check] [stress test switch active part perf.][popup menu open]
+ - with a set of empty views and editors in standard layout
+ - with an editor with a menu entry/a toolbar entry and a view with a simple menu and toolbar
+- Editor [open/close] [zoom/unzoom] [split/unsplit] [stress test open 100 w/o close] [close 100 editors] [minimize/mazimize]
+ - empty
+ - editor with key/context support
+ - multi-page editor
+ - editor that provides a content outline
+ - editor that provides a property sheet
+ - editor that contributes heavily to menus
+ - editor that contributes heavily to toolbars
+ - change icon/title frequently
+ - with lots of popup menu contributions
+- View [open/close] [zoom/unzoom] [detached/re-attach] [make fastview/restore] [minimize/mazimize] [popup menu open]
+ - empty
+ - view with local toolbar
+ - with with view menu
+ - table viewer (TableView)
+ - view that indicates progress when in forground and background
+ - view with content message (see Problems view)
+ - change icon/title frequently
+ - with lots of popup menu contributions
+- Intro [close/open] [standby/non-standby]
+ - basic intro
+- Perspective [open/close] [stress test open 10 w/o close] [open in new window] [switch pespective]
+ - empty
+ - complex layout
+- Themes [switching theme]
+ - two themes that support the default workbench presentation items
+
+- Shutdown
+- Action Factory (brings in all classes)
+- Leak tests
+- Selection listeners
+- Decorators
+- GDI resources
+- Thread count
+- Overhead of progress support/progress monitor/view
+- Layout
diff --git a/tests/org.eclipse.rap.ui.tests.performance/test.xml b/tests/org.eclipse.rap.ui.tests.performance/test.xml
new file mode 100644
index 0000000000..7178600677
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/test.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+
+<project name="testsuite" default="runtests" basedir=".">
+ <!-- The property ${eclipse-home} should be passed into this script -->
+ <!-- Set a meaningful default value for when it is not. -->
+ <property name="eclipse-home" value="${basedir}\..\.."/>
+
+ <!-- sets the properties eclipse-home, and library-file -->
+ <property name="plugin-name" value="org.eclipse.ui.tests.performance"/>
+ <property name="library-file"
+ value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
+
+ <!-- This target holds all initialization code that needs to be done for -->
+ <!-- all tests that are to be run. Initialization for individual tests -->
+ <!-- should be done within the body of the suite target. -->
+ <target name="init">
+ <tstamp/>
+ <delete>
+ <fileset dir="${eclipse-home}" includes="org*.xml"/>
+ </delete>
+ </target>
+
+ <!--default target that does nothing. The performance target is called explicitly
+ by build team.-->
+ <target name="runtests"/>
+
+ <!-- This target holds code to cleanup the testing environment after -->
+ <!-- after all of the tests have been run. You can use this target to -->
+ <!-- delete temporary files that have been created. -->
+ <target name="cleanup">
+ </target>
+
+ <!-- This target runs the performance test suites. -->
+ <target name="performance" depends="init,performance-suite,jface-performance-suite,cleanup">
+ <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="includes" value="org*.xml"/>
+ <property name="output-file" value="${plugin-name}.xml"/>
+ </ant>
+ </target>
+
+ <target name="performance-suite">
+ <property name="performance-workspace" value="${eclipse-home}/performance-workspace-platform-ui"/>
+ <delete dir="${performance-workspace}" quiet="true"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${performance-workspace}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname" value="org.eclipse.ui.tests.performance.UIPerformanceTestSuite"/>
+ </ant>
+ </target>
+
+ <target name="jface-performance-suite">
+ <property name="performance-workspace-jface" value="${eclipse-home}/performance-workspace-platform-jface"/>
+ <delete dir="${performance-workspace-jface}" quiet="true"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${performance-workspace-jface}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname" value="org.eclipse.jface.tests.performance.JFacePerformanceSuite"/>
+ </ant>
+ </target>
+
+</project>
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/defaults_ps.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/defaults_ps.gif
new file mode 100644
index 0000000000..c0648993b8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/defaults_ps.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/filter_ps.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/filter_ps.gif
new file mode 100644
index 0000000000..6fe6f0e10a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/filter_ps.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/tree_mode.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/tree_mode.gif
new file mode 100644
index 0000000000..dda8baeba9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/elcl16/tree_mode.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/outline_co.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/outline_co.gif
new file mode 100644
index 0000000000..0dc862cbd7
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/outline_co.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/prop_ps.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/prop_ps.gif
new file mode 100644
index 0000000000..d11c996e57
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/16/icons/full/eview16/prop_ps.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample2.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample2.gif
new file mode 100644
index 0000000000..252d7ebcb8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample2.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample3.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample3.gif
new file mode 100644
index 0000000000..b949ac948a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/36/icons/sample3.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/contact.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/contact.gif
new file mode 100644
index 0000000000..5fd9c94946
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/contact.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/info.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/info.gif
new file mode 100644
index 0000000000..3679f84ad8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/info.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/internal_browser.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/internal_browser.gif
new file mode 100644
index 0000000000..229c391c49
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/internal_browser.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/login.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/login.gif
new file mode 100644
index 0000000000..1b724a6784
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/login.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/progress_ok.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/progress_ok.gif
new file mode 100644
index 0000000000..0fc45ba8ea
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/progress_ok.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/pview.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/pview.gif
new file mode 100644
index 0000000000..4aa54a69d9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/pview.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/register.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/register.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/register.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/sample.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/sample.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/sample.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/search.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/search.gif
new file mode 100644
index 0000000000..d540a01f4d
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/search.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/status.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/status.gif
new file mode 100644
index 0000000000..c1a19e1937
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/status.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/ttt.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/ttt.gif
new file mode 100644
index 0000000000..0e7454850a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/41/icons/ttt.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/ejbBinding_obj.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/ejbBinding_obj.gif
new file mode 100644
index 0000000000..c97e6eee19
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/ejbBinding_obj.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/sessions.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/sessions.gif
new file mode 100644
index 0000000000..9b9f79a66e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/71/icons/sessions.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/defaultview_misc.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/defaultview_misc.gif
new file mode 100644
index 0000000000..55ca8f3a9b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/defaultview_misc.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/view_menu.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/view_menu.gif
new file mode 100644
index 0000000000..ee7d421a46
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/eview16/view_menu.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/elements_obj.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/elements_obj.gif
new file mode 100644
index 0000000000..33be7d827d
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/elements_obj.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/fldr_obj.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/fldr_obj.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/89/icons/full/obj16/fldr_obj.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/defaultview_misc.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/defaultview_misc.gif
new file mode 100644
index 0000000000..55ca8f3a9b
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/defaultview_misc.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/view_menu.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/view_menu.gif
new file mode 100644
index 0000000000..ee7d421a46
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/91/icons/full/eview16/view_menu.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/WEB-INF/conf/W4T.xml b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/WEB-INF/conf/W4T.xml
new file mode 100644
index 0000000000..fa5ab22d6e
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/WEB-INF/conf/W4T.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<w4t:application xmlns:w4t="http://w4toolkit.com/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://w4toolkit.com/ w4t.xsd ">
+ <initialisation>
+ </initialisation>
+</w4t:application> \ No newline at end of file
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/jface/action/images/stop.gif b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/jface/action/images/stop.gif
new file mode 100644
index 0000000000..dc47edf069
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/jface/action/images/stop.gif
Binary files differ
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/rwt/widgets/ExternalBrowser-1955133473.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/rwt/widgets/ExternalBrowser-1955133473.js
new file mode 100644
index 0000000000..aedf6237cd
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/rwt/widgets/ExternalBrowser-1955133473.js
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.rwt.widgets.ExternalBrowser",
+{
+ extend : qx.core.Object,
+
+ statics : {
+ // maps id's (aka window names) to window instances
+ // key = id, value = window object
+ _map : {},
+
+ open : function( id, url, features ) {
+ var win = window.open( url, id, features, true );
+ org.eclipse.rwt.widgets.ExternalBrowser._map[ id ] = win;
+ },
+
+ close : function( id ) {
+ var win = org.eclipse.rwt.widgets.ExternalBrowser._map[ id ];
+ if( win != null ) {
+ win.close();
+ }
+ delete org.eclipse.rwt.widgets.ExternalBrowser._map[ id ];
+ }
+ }
+} );
+
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Application-1602013276.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Application-1602013276.js
new file mode 100644
index 0000000000..564db4f6bb
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Application-1602013276.js
@@ -0,0 +1,74 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.Application", {
+ extend : qx.application.Gui,
+
+ construct : function() {
+ this.base( arguments );
+ this._exitConfirmation = null;
+ },
+
+ destruct : function() {
+ var doc = qx.ui.core.ClientDocument.getInstance();
+ doc.removeEventListener( "windowresize",
+ org.eclipse.swt.Application._onResize );
+ },
+
+ statics : {
+ // TODO [rh] causes JavaScript error
+ // var doc = qx.ui.core.ClientDocument.getInstance();
+ // doc.removeEventListener( "windowresize", this._onResize );
+ _onResize : function( evt ) {
+ org.eclipse.swt.Application._appendWindowSize();
+ var req = org.eclipse.swt.Request.getInstance();
+ req.send();
+ },
+
+ _appendWindowSize : function() {
+ var width = qx.html.Window.getInnerWidth( window );
+ var height = qx.html.Window.getInnerHeight( window );
+ // Append document size to request
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = req.getUIRootId();
+ req.addParameter( id + ".bounds.width", String( width ) );
+ req.addParameter( id + ".bounds.height", String( height ) );
+ }
+ },
+
+ members : {
+ setExitConfirmation : function( msg ) {
+ this._exitConfirmation = msg;
+ },
+
+ main : function( evt ) {
+ this.base( arguments );
+ // Overwrite the default mapping for internal images. This is necessary
+ // if the application is deployed under a root different from "/".
+ qx.io.Alias.getInstance().add( "static", "./resource/static" );
+ qx.io.Alias.getInstance().add( "org.eclipse.swt", "./resource" );
+ // Observe window size
+ var doc = qx.ui.core.ClientDocument.getInstance();
+ doc.addEventListener( "windowresize",
+ org.eclipse.swt.Application._onResize );
+ // Initial request to obtain startup-shell
+ org.eclipse.swt.Application._appendWindowSize();
+ var req = org.eclipse.swt.Request.getInstance();
+ req.send();
+ },
+
+ close : function( evt ) {
+ this.base( arguments );
+ return this._exitConfirmation;
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ButtonUtil1975626283.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ButtonUtil1975626283.js
new file mode 100644
index 0000000000..bbb722bc12
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ButtonUtil1975626283.js
@@ -0,0 +1,126 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+/**
+ * This class contains static functions for radio buttons and check boxes.
+ */
+qx.Class.define( "org.eclipse.swt.ButtonUtil", {
+
+ statics : {
+
+ setLabelMode : function( button ) {
+ // Note: called directly after creating the menuItem instance, therefore
+ // it is not necessary to check getLabelObject and/or preserve its label
+ button.setLabel( "(empty)" );
+ button.getLabelObject().setMode( "html" );
+ button.getLabelObject().setAppearance( "label-graytext" );
+ button.setLabel( "" );
+ },
+
+ /**
+ * Registers the given button at the RadioManager of the first sibling
+ * radio button. If there is not sibing radio button, a new RadioManager
+ * is created.
+ */
+ registerRadioButton : function( button ) {
+ var radioManager = null;
+ var parent = button.getParent();
+ var siblings = parent.getChildren();
+ for( var i = 0; radioManager == null && i < siblings.length; i++ ) {
+ if( siblings[ i ] != button
+ && siblings[ i ].classname == button.classname )
+ {
+ radioManager = siblings[ i ].getManager();
+ }
+ }
+ if( radioManager == null ) {
+ radioManager = new qx.ui.selection.RadioManager();
+ }
+ radioManager.add( button );
+ },
+
+ /**
+ * Removes the given button from its RadioManager and disposes of the
+ * RadioManager if there are no more radio buttons that use this
+ * RadioManager.
+ */
+ unregisterRadioButton : function( button ) {
+ var radioManager = button.getManager();
+ if( radioManager != null ) {
+ radioManager.remove( button );
+ if( radioManager.getItems().length == 0 ) {
+ radioManager.dispose();
+ }
+ }
+ },
+
+ radioSelected : function( evt ) {
+ var radioManager = evt.getTarget();
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var radioButtons = radioManager.getItems();
+ for( var i=0; i<radioButtons.length; i++ ) {
+ var selected = radioButtons[ i ] == radioManager.getSelected();
+ var id = widgetManager.findIdByWidget( radioButtons[ i ] );
+ req.addParameter( id + ".selection", selected );
+ }
+ },
+
+ radioSelectedAction : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ org.eclipse.swt.ButtonUtil.radioSelected( evt );
+ var radioManager = evt.getTarget();
+ var radio = radioManager.getSelected();
+ if( radio != null ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( radio );
+ org.eclipse.swt.EventUtil.doWidgetSelected( id, 0, 0, 0, 0 );
+ }
+ }
+ },
+
+ checkSelected : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var check = evt.getTarget();
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( check );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".selection", check.getChecked() );
+ }
+ },
+
+ checkSelectedAction : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ org.eclipse.swt.ButtonUtil.checkSelected( evt );
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ org.eclipse.swt.EventUtil.doWidgetSelected( id, 0, 0, 0, 0 );
+ }
+ },
+
+ /* Called when a TOGGLE button is executed */
+ onToggleExecute : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var button = evt.getTarget();
+ var checked = !button.hasState( "checked" );
+ if( checked ) {
+ button.addState( "checked" );
+ } else {
+ button.removeState( "checked" );
+ }
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( button );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".selection", checked );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/CLabelUtil1376009346.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/CLabelUtil1376009346.js
new file mode 100644
index 0000000000..98b4165bc9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/CLabelUtil1376009346.js
@@ -0,0 +1,45 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions needed for labels.
+ * To represent an RWT Label object, the qx.ui.basic.Atom widget is used.
+ */
+qx.Class.define( "org.eclipse.swt.CLabelUtil", {
+
+ statics : {
+ SHOW_BOTH : "both",
+
+ APPEARANCE : "c-label-wrapper",
+
+ initialize : function( widget ) {
+ widget.setVerticalChildrenAlign( qx.constant.Layout.ALIGN_MIDDLE );
+ widget.setHorizontalChildrenAlign( qx.constant.Layout.ALIGN_LEFT );
+ widget.setAppearance( org.eclipse.swt.CLabelUtil.APPEARANCE );
+ widget.setOverflow( qx.constant.Style.OVERFLOW_HIDDEN );
+ // TODO [rh] workaround for weird getLabelObject behaviour
+ widget.setLabel( "(empty)" );
+ // end workaround
+ var labelObject = widget.getLabelObject();
+ labelObject.setMode( qx.constant.Style.LABEL_MODE_HTML );
+ labelObject.setTextOverflow( false );
+ labelObject.setAppearance( "label-graytext" );
+ widget.getLabelObject().setWrap( false );
+ // TODO [rh] workaround for weird getLabelObject behaviour
+ widget.setLabel( "" );
+ // end workaround
+ widget.setHideFocus( true );
+ widget.setShow( org.eclipse.swt.CLabelUtil.SHOW_BOTH );
+ }
+
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ComboUtil-2084565362.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ComboUtil-2084565362.js
new file mode 100644
index 0000000000..bd96f3c735
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ComboUtil-2084565362.js
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2008 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions for the Combo widget.
+ */
+qx.Class.define( "org.eclipse.swt.ComboUtil", {
+
+ statics : {
+
+ modifyText : function( evt ) {
+ var combo = evt.getTarget();
+ // If the drop-down list is not visible, the target is the text field
+ // instead of the combo.
+ if( !( combo instanceof qx.ui.form.ComboBox ) ) {
+ combo = combo.getParent();
+ }
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && org.eclipse.swt.TextUtil._isModifyingKey( evt.getKeyIdentifier() ) )
+ {
+ // if not yet done, register an event listener that adds a request param
+ // with the text widgets' content just before the request is sent
+ if( !org.eclipse.swt.TextUtil._isModified( combo ) ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEventListener( "send", org.eclipse.swt.ComboUtil._onSend, combo );
+ org.eclipse.swt.TextUtil._setModified( combo, true );
+ }
+ }
+ org.eclipse.swt.TextUtil.updateSelection( combo.getField(), combo );
+ },
+
+ /**
+ * This function gets assigned to the 'keyup' event of a text widget if
+ * there was a server-side ModifyListener registered.
+ */
+ modifyTextAction : function( evt ) {
+ var combo = evt.getTarget();
+ // If the drop-down list is not visible, the target is the text field
+ // instead of the combo.
+ if( !( combo instanceof qx.ui.form.ComboBox ) ) {
+ combo = combo.getParent();
+ }
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && !org.eclipse.swt.TextUtil._isModified( combo )
+ && org.eclipse.swt.TextUtil._isModifyingKey( evt.getKeyIdentifier() ) )
+ {
+ var req = org.eclipse.swt.Request.getInstance();
+ // Register 'send'-listener that adds a request param with current text
+ if( !org.eclipse.swt.TextUtil._isModified( combo ) ) {
+ req.addEventListener( "send", org.eclipse.swt.ComboUtil._onSend, combo );
+ org.eclipse.swt.TextUtil._setModified( combo, true );
+ }
+ // add modifyText-event with sender-id to request parameters
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( combo );
+ req.addEvent( "org.eclipse.swt.events.modifyText", id );
+ // register listener that is notified when a request is sent
+ qx.client.Timer.once( org.eclipse.swt.TextUtil._delayedModifyText,
+ combo,
+ 500 );
+ }
+ org.eclipse.swt.TextUtil.updateSelection( combo.getField(), combo );
+ },
+
+ /**
+ * This function gets assigned to the 'blur' event of a text widget if there
+ * was a server-side ModifyListener registered.
+ */
+ modifyTextOnBlur : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && org.eclipse.swt.TextUtil._isModified( evt.getTarget() ) )
+ {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.modifyText", id );
+ req.send();
+ }
+ },
+
+ _onSend : function( evt ) {
+ // NOTE: 'this' references the combo widget
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".text", this.getField().getComputedValue() );
+ // remove the _onSend listener and change the text widget state to 'unmodified'
+ req.removeEventListener( "send", org.eclipse.swt.ComboUtil._onSend, this );
+ org.eclipse.swt.TextUtil._setModified( this, false );
+ // Update the value property (which is qooxdoo-wise only updated on
+ // focus-lost) to be in sync with server-side
+ if( this.getFocused() ) {
+ this.setValue( this.getField().getComputedValue() );
+ }
+ },
+
+ onSelectionChanged : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var combo = evt.getTarget();
+ var list = combo.getList();
+ var listItem = list.getSelectedItem();
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var cboId = widgetManager.findIdByWidget( combo );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( cboId + ".selectedItem", list.indexOf( listItem ) );
+ }
+ },
+
+ onSelectionChangedAction : function( evt ) {
+ // TODO [rst] This listener was also called on focus out, if no item was
+ // selected. This fix should work since combos cannot be deselected.
+ if( !org_eclipse_rap_rwt_EventUtil_suspend && evt.getData() != null ) {
+ org.eclipse.swt.ComboUtil.onSelectionChanged( evt );
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ org.eclipse.swt.EventUtil.doWidgetSelected( id, 0, 0, 0, 0 );
+ }
+ }
+
+ }
+
+} );
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/EventUtil2075083609.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/EventUtil2075083609.js
new file mode 100644
index 0000000000..34bb6e071d
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/EventUtil2075083609.js
@@ -0,0 +1,110 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static listener functions for common events.
+ */
+qx.Class.define("org.eclipse.swt.EventUtil", {
+
+ statics : {
+ suspendEventHandling : function() {
+ org_eclipse_rap_rwt_EventUtil_suspend = true;
+ },
+
+ resumeEventHandling : function() {
+ org_eclipse_rap_rwt_EventUtil_suspend = false;
+ },
+
+ widgetSelected : function( evt ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var left = evt.getTarget().getLeft();
+ var top = evt.getTarget().getTop();
+ var width = evt.getTarget().getWidth();
+ var height = evt.getTarget().getHeight();
+ org.eclipse.swt.EventUtil.doWidgetSelected( id, left, top, width, height );
+ },
+
+ doWidgetSelected : function( id, left, top, width, height ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.widgetSelected", id );
+ req.addParameter( id + ".bounds.x", left );
+ req.addParameter( id + ".bounds.y", top );
+ req.addParameter( id + ".bounds.width", width );
+ req.addParameter( id + ".bounds.height", height );
+ req.send();
+ }
+ },
+
+ widgetResized : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ // TODO: [fappel] replace this ugly hack that is used in case of
+ // window maximizations
+ var height = evt.getTarget().getHeight();
+ if( height == null ) {
+ height = window.innerHeight;
+ if( isNaN( height ) ) { // IE special
+ height = document.body.clientHeight;
+ }
+ }
+ var width = evt.getTarget().getWidth();
+ if( width == null ) {
+ width = window.innerWidth;
+ if( isNaN( width ) ) { // IE special
+ width = document.body.clientWidth;
+ }
+ }
+ req.addParameter( id + ".bounds.height", height );
+ req.addParameter( id + ".bounds.width", width );
+ req.send();
+ }
+ },
+
+ widgetMoved : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ req.addParameter( id + ".bounds.x", evt.getTarget().getLeft() );
+ req.addParameter( id + ".bounds.y", evt.getTarget().getTop() );
+// req.send();
+ }
+ },
+
+ focusGained : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.focusGained", id );
+ req.send();
+ }
+ },
+
+ focusLost : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.focusLost", id );
+ req.send();
+ }
+ }
+ }
+});
+
+var org_eclipse_rap_rwt_EventUtil_suspend = false;
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/FontSizeCalculation1500612024.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/FontSizeCalculation1500612024.js
new file mode 100644
index 0000000000..a9940bdbe8
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/FontSizeCalculation1500612024.js
@@ -0,0 +1,61 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.FontSizeCalculation", {
+
+ statics : {
+ MEASUREMENT_LABEL : new qx.ui.basic.Label(),
+
+ probe : function( probeList ) {
+ for( i = 0; i < probeList.length; i++ ) {
+ var item = probeList[ i ];
+ var size = org.eclipse.swt.FontSizeCalculation._doMeasurement( item );
+ var param = size[ 0 ] + "," + size[ 1 ];
+ var id = item[ 0 ];
+ org.eclipse.swt.FontSizeCalculation._addRequestParam( id, param );
+ }
+ },
+
+ measureStrings : function( stringList ) {
+ for( i = 0; i < stringList.length; i++ ) {
+ var item = stringList[ i ];
+ var size = org.eclipse.swt.FontSizeCalculation._doMeasurement( item );
+ var param = size[ 0 ] + "," + size[ 1 ];
+ var id = item[ 0 ];
+ org.eclipse.swt.FontSizeCalculation._addRequestParam( id, param );
+ org.eclipse.swt.Request.getInstance().send();
+ }
+ },
+
+ _doMeasurement : function( item ) {
+ var lbl = org.eclipse.swt.FontSizeCalculation.MEASUREMENT_LABEL;
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var measureNode = qx.ui.basic.Label._getMeasureNode();
+ if( item[ 6 ] > 0 ) {
+ measureNode.style.width = item[ 6 ];
+ } else {
+ measureNode.style.width = "auto";
+ }
+ lbl.setText( item[ 1 ] );
+ wm.setFont( lbl, item[ 2 ], item[ 3 ], item[ 4 ], item[ 5 ] );
+ var result = [ lbl._computePreferredInnerWidth(),
+ lbl._computePreferredInnerHeight() ];
+ measureNode.style.width = "auto";
+ return result;
+ },
+
+ _addRequestParam : function ( name, value ) {
+ var request = org.eclipse.swt.Request.getInstance();
+ request.addParameter( name, value );
+ }
+ }
+} ); \ No newline at end of file
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LabelUtil-2065462132.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LabelUtil-2065462132.js
new file mode 100644
index 0000000000..6081ef4090
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LabelUtil-2065462132.js
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions needed for labels.
+ * To represent an RWT Label object, the qx.ui.basic.Atom widget is used.
+ */
+qx.Class.define( "org.eclipse.swt.LabelUtil", {
+
+ statics : {
+ SHOW_LABEL : "label",
+ SHOW_ICON : "icon",
+
+ APPEARANCE : "label-wrapper",
+
+ initialize : function( widget ) {
+ widget.setHorizontalChildrenAlign( qx.constant.Layout.ALIGN_LEFT );
+ if( !widget.getUserData( "pooled" ) ) {
+ widget.setVerticalChildrenAlign( qx.constant.Layout.ALIGN_TOP );
+ widget.setAppearance( org.eclipse.swt.LabelUtil.APPEARANCE );
+ widget.setOverflow( qx.constant.Style.OVERFLOW_HIDDEN );
+ // TODO [rh] workaround for weird getLabelObject behaviour
+ widget.setLabel( "(empty)" );
+ // end workaround
+ var labelObject = widget.getLabelObject();
+ labelObject.setMode( qx.constant.Style.LABEL_MODE_HTML );
+ labelObject.setTextOverflow( false );
+ labelObject.setAppearance( "label-graytext" );
+ // TODO [rh] workaround for weird getLabelObject behaviour
+ widget.setLabel( "" );
+ // end workaround
+ widget.setHideFocus( true );
+ // track DOM insertion state
+ widget.addEventListener( "beforeRemoveDom",
+ org.eclipse.swt.LabelUtil._onRemoveDom );
+ widget.addEventListener( "insertDom",
+ org.eclipse.swt.LabelUtil._onInsertDom );
+ }
+ },
+
+ _onRemoveDom : function( evt ) {
+ var widget = evt.getTarget();
+ widget._isInDOM = false;
+ },
+
+ _onInsertDom : function( evt ) {
+ var widget = evt.getTarget();
+ widget._isInDOM = true;
+ },
+
+ setWrap : function( widget, wrap ) {
+ widget.getLabelObject().setWrap( wrap );
+ },
+
+ setAlignment : function( widget, align ) {
+ widget.getLabelObject().setTextAlign( align );
+ widget.setHorizontalChildrenAlign( align );
+ },
+
+ setText : function( widget, text ) {
+ if( !widget.isCreated() ) {
+ widget.setUserData( "setText", text );
+ widget.addEventListener( "appear",
+ org.eclipse.swt.LabelUtil._setTextDelayed );
+ }
+ // workaround for pooling problems
+ else if( !widget._isInDOM && widget.getUserData( "pooled" ) ) {
+ widget.setUserData( "setText", text );
+ widget.addEventListener( "insertDom",
+ org.eclipse.swt.LabelUtil._setTextDelayed );
+ } else {
+ org.eclipse.swt.LabelUtil._doSetText( widget, text );
+ }
+ },
+
+ setImage : function( widget, imagePath ) {
+ if( !widget.isCreated() ) {
+ widget.setUserData( "setImage", imagePath );
+ widget.addEventListener( "appear",
+ org.eclipse.swt.LabelUtil._setImageDelayed );
+ } else if( !widget._isInDOM && widget.getUserData( "pooled" ) ) {
+ widget.setUserData( "setImage", imagePath );
+ widget.addEventListener( "insertDom",
+ org.eclipse.swt.LabelUtil._setImageDelayed );
+ } else {
+ org.eclipse.swt.LabelUtil._doSetImage( widget, imagePath );
+ }
+ },
+
+ _setTextDelayed : function( evt ) {
+ var widget = evt.getTarget();
+ var text = widget.getUserData( "setText" );
+ org.eclipse.swt.LabelUtil._doSetText( widget, text );
+ widget.removeEventListener( "appear",
+ org.eclipse.swt.LabelUtil._setTextDelayed );
+ widget.removeEventListener( "insertDom",
+ org.eclipse.swt.LabelUtil._setTextDelayed );
+ },
+
+ _setImageDelayed : function( evt ) {
+ var widget = evt.getTarget();
+ var imagePath = widget.getUserData( "setImage" );
+ org.eclipse.swt.LabelUtil._doSetImage( widget, imagePath );
+ widget.removeEventListener( "appear",
+ org.eclipse.swt.LabelUtil._setImageDelayed );
+ widget.removeEventListener( "insertDom",
+ org.eclipse.swt.LabelUtil._setImageDelayed );
+ },
+
+ _doSetText : function( widget, text ) {
+ if ( text != null ) {
+ widget.setLabel( text );
+ } else {
+ // TODO [rst] widget.resetLabel() throws JS error
+ widget.setLabel( "" );
+ }
+ widget.setShow( org.eclipse.swt.LabelUtil.SHOW_LABEL );
+ },
+
+ _doSetImage : function( widget, imagePath ) {
+ if( imagePath ) {
+ widget.setIcon( imagePath );
+ widget.setShow( org.eclipse.swt.LabelUtil.SHOW_ICON );
+ } else {
+ widget.resetIcon();
+ widget.setShow( org.eclipse.swt.LabelUtil.SHOW_LABEL );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LinkUtil1123992408.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LinkUtil1123992408.js
new file mode 100644
index 0000000000..63c33adeb9
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/LinkUtil1123992408.js
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions needed for the SWT Link widget.
+ */
+qx.Class.define( "org.eclipse.swt.LinkUtil", {
+
+ statics : {
+ init : function( widget ) {
+ widget.setTabIndex( -1 );
+ widget.setUserData( "nextTabIndex", 0 );
+ widget.addEventListener( "changeTabIndex",
+ org.eclipse.swt.LinkUtil._onTabIndexChange );
+ },
+
+ destroy : function( widget ) {
+ org.eclipse.swt.LinkUtil.clear( widget );
+ if( widget.hasEventListeners( "changeTabIndex" ) ) {
+ widget.removeEventListener( "changeTabIndex",
+ org.eclipse.swt.LinkUtil._onTabIndexChange );
+ }
+ },
+
+ clear : function( widget ) {
+ if( widget && !widget.getDisposed() ) {
+ var children = widget.getChildren();
+ var child = children[ 0 ];
+ while( child ) {
+ widget.remove( child );
+ if( child.hasEventListeners( "mousedown" ) ) {
+ child.removeEventListener( "mousedown",
+ org.eclipse.swt.LinkUtil._onMouseDown );
+ }
+ if( child.hasEventListeners( "keydown" ) ) {
+ child.removeEventListener( "keydown",
+ org.eclipse.swt.LinkUtil._onKeyDown );
+ }
+
+// child.dispose();
+ child = children[ 0 ];
+ }
+ }
+ },
+
+ setSelectionListener : function( widget, value ) {
+ widget.setUserData( "widgetSelectedListener", value );
+ },
+
+ addText : function( widget, text ) {
+ if( widget ) {
+ var newChild = org.eclipse.swt.LinkUtil._createLabel( widget, text );
+ newChild.setAppearance( "link-text" );
+ newChild.setWrap( false );
+ widget.add( newChild );
+ }
+ },
+
+ addLink : function( widget, text, index ) {
+ if( widget ) {
+ uText = "<u>" + text + "</u>";
+ var newChild = org.eclipse.swt.LinkUtil._createLabel( widget, uText );
+ newChild.setUserData( "index", index );
+ newChild.setAppearance( "link-href" );
+ newChild.setWrap( false );
+ widget.add( newChild );
+ var tabIndex = widget.getUserData( "nextTabIndex" );
+ newChild.setTabIndex( tabIndex++ );
+ widget.setUserData( "nextTabIndex", tabIndex );
+ newChild.addEventListener( "mousedown",
+ org.eclipse.swt.LinkUtil._onMouseDown,
+ newChild );
+ newChild.addEventListener( "keydown",
+ org.eclipse.swt.LinkUtil._onKeyDown,
+ newChild );
+ }
+ },
+
+ _createLabel : function( parent, text ) {
+ // replace spaces with nbsp
+ var replaced = text.replace( /\s/g, "&nbsp;" );
+ var label = new qx.ui.basic.Label( replaced, null, "html" );
+ return label;
+ },
+
+ _onMouseDown : function( evt ) {
+ var parent = this.getParent();
+ if( parent.getUserData( "widgetSelectedListener" ) ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( parent );
+ var index = this.getUserData( "index" );
+ req.addEvent( "org.eclipse.swt.events.widgetSelected", id );
+ req.addEvent( "org.eclipse.swt.events.widgetSelected.index", index );
+ req.send();
+ }
+ },
+
+ _onKeyDown : function( evt ) {
+ var keyId = evt.getKeyIdentifier();
+ if ( keyId == "Enter" ) {
+ var parent = this.getParent();
+ if( parent.getUserData( "widgetSelectedListener" ) ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( parent );
+ var index = this.getUserData( "index" );
+ req.addEvent( "org.eclipse.swt.events.widgetSelected", id );
+ req.addEvent( "org.eclipse.swt.events.widgetSelected.index", index );
+ req.send();
+ }
+ }
+ },
+
+ _onTabIndexChange : function( evt ) {
+ var tabIndex = evt.getData();
+ if( tabIndex >= 0 ) {
+ var target = evt.getCurrentTarget();
+ var children = target.getChildren();
+ for( var i = 0; i < children.length; i++ ) {
+ child = children[ i ];
+ child.setTabIndex( tabIndex++ );
+ }
+ target.setUserData( "nextTabIndex", tabIndex );
+ target.setTabIndex( -1 );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/MenuUtil-1871588199.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/MenuUtil-1871588199.js
new file mode 100644
index 0000000000..d638ba59ba
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/MenuUtil-1871588199.js
@@ -0,0 +1,174 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.MenuUtil", {
+
+ statics : {
+ setLabelMode : function( menuItem ) {
+ // Note: called directly after creating the menuItem instance, therefore
+ // it is not necessary to check getLabelObject and/or preserve its label
+ menuItem.setLabel( "(empty)" );
+ // TODO [rh] for some reason this workaround doesn't work for
+ // qx.ui.menubar.Button, the labelObject is still null
+ if( menuItem.getLabelObject() != null ) {
+ menuItem.getLabelObject().setMode( qx.constant.Style.LABEL_MODE_HTML );
+ }
+ menuItem.setLabel( "" );
+ },
+
+ // Event listener for "contextmenu" event
+ contextMenu : function( evt ) {
+ var widget = evt.getTarget();
+ var contextMenu = widget.getContextMenu();
+ if( contextMenu != null ) {
+ contextMenu.setLocation( evt.getPageX(), evt.getPageY() );
+ contextMenu.setOpener( this );
+ contextMenu.show();
+ }
+ },
+
+ // Called to open a popup menu from server side
+ showMenu : function( menu, x, y ) {
+ if( menu != null ) {
+ menu.setLocation( x, y );
+ menu.show();
+ }
+ },
+
+ checkMenuItemSelected : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".selection", evt.getTarget().getChecked() );
+ }
+ },
+
+ checkMenuItemSelectedAction : function( evt ) {
+ org.eclipse.swt.MenuUtil.checkMenuItemSelected( evt );
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ org.eclipse.swt.EventUtil.widgetSelected( evt );
+ }
+ },
+
+ radioMenuItemSelected : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".selection", evt.getTarget().getChecked() );
+ }
+ },
+
+ radioMenuItemSelectedAction : function( evt ) {
+ org.eclipse.swt.MenuUtil.radioMenuItemSelected( evt );
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ org.eclipse.swt.EventUtil.widgetSelected( evt );
+ }
+ },
+
+ createRadioManager : function( menuItem ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var name = wm.findIdByWidget( menuItem ) + "RadioMgr";
+ var manager = new qx.ui.selection.RadioManager( name );
+ menuItem.setManager( manager );
+ },
+
+ assignRadioManager : function( firstMenuItem, menuItem ) {
+ var manager = firstMenuItem.getManager();
+ menuItem.setManager( manager );
+ },
+
+ disposeRadioMenuItem : function( menuItem ) {
+ var manager = menuItem.getManager();
+ manager.remove( menuItem );
+ menuItem.dispose();
+ if( manager.getItems().length == 0 ) {
+ manager.dispose();
+ }
+ },
+
+ setMenuListener : function( menu, isset ) {
+ if( isset ) {
+ menu.addEventListener( "beforeAppear",
+ org.eclipse.swt.MenuUtil._menuShown );
+ menu.addEventListener( "disappear",
+ org.eclipse.swt.MenuUtil._menuHidden );
+ } else {
+ menu.removeEventListener( "beforeAppear",
+ org.eclipse.swt.MenuUtil._menuShown );
+ menu.removeEventListener( "disappear",
+ org.eclipse.swt.MenuUtil._menuHidden );
+ }
+ },
+
+ /*
+ * Called when menu is about to show. Sends menu event and shows only a
+ * preliminary item until the response is received.
+ */
+ _menuShown : function( evt ) {
+ // create preliminary item
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var preItem = this.getUserData( "preItem" );
+ if( !preItem ) {
+ preItem = new qx.ui.menu.Button();
+ preItem.setLabel( "..." );
+ preItem.setEnabled( false );
+ this.add( preItem );
+ this.setUserData( "preItem", preItem );
+ }
+ // hide all but the preliminary item
+ var items = this.getLayout().getChildren();
+ for( var i = 0; i < items.length; i++ ) {
+ var item = items[ i ];
+ item.setDisplay( false );
+ }
+ preItem.setDisplay( true );
+ // send event
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.menuShown", id );
+ req.send();
+ }
+ },
+
+ /*
+ * Called after menu has disappeared.
+ */
+ _menuHidden : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.menuHidden", id );
+ req.send();
+ }
+ },
+
+ /*
+ * Hides preliminary item and reveals the menu. Called by the response to a
+ * menu shown event.
+ */
+ unhideMenu : function( menu ) {
+ var items = menu.getLayout().getChildren();
+ for( var i = 0; i < items.length; i++ ) {
+ var item = items[ i ];
+ item.setDisplay( true );
+ }
+ var preItem = menu.getUserData( "preItem" );
+ if( preItem ) {
+ preItem.setDisplay( false );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Request-1891200396.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Request-1891200396.js
new file mode 100644
index 0000000000..79b1e66365
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/Request-1891200396.js
@@ -0,0 +1,383 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.Request", {
+ type : "singleton",
+ extend : qx.core.Target,
+
+ construct : function() {
+ this.base( arguments );
+ // the URL to which the requests are sent
+ this._url = "";
+ // the map of parameters that will be posted with the next call to 'send()'
+ this._parameters = {};
+ // instance variables that hold the essential request parameters
+ this._uiRootId = "";
+ this._requestCounter;
+ // Number of currently running or scheduled requests, used to determine when
+ // to show the wait hint (e.g. hour-glass cursor)
+ this._runningRequestCount = 0;
+ // Flag that is set to true if send() was called but the delay timeout
+ // has not yet timed out
+ this._inDelayedSend = false;
+ // As the CallBackRequests get blocked at the server to wait for
+ // background activity I choose a large timeout...
+ var requestQueue = qx.io.remote.RequestQueue.getInstance();
+ requestQueue.setDefaultTimeout( 60000 * 60 * 24 ); // 24h
+ // Initialize the request queue to allow only one request at a time
+ requestQueue.setMaxConcurrentRequests( 1 );
+ // References the currently running request or null if no request is active
+ this._currentRequest = null;
+ },
+
+ destruct : function() {
+ this._currentRequest = null;
+ },
+
+ events : {
+ "send" : "qx.event.type.DataEvent"
+ },
+
+ members : {
+ setUrl : function( url ) {
+ this._url = url;
+ },
+
+ getUrl : function() {
+ return this._url;
+ },
+
+ setUIRootId : function( uiRootId ) {
+ this._uiRootId = uiRootId;
+ },
+
+ getUIRootId : function() {
+ return this._uiRootId;
+ },
+
+ setRequestCounter : function( requestCounter ) {
+ this._requestCounter = requestCounter;
+ },
+
+ /**
+ * Adds a request parameter to this request with the given name and value
+ */
+ addParameter : function( name, value ) {
+ this._parameters[ name ] = value;
+ },
+
+ /**
+ * Removes the parameter denoted by name from this request.
+ */
+ removeParameter : function( name ) {
+ delete this._parameters[ name ];
+ },
+
+ /**
+ * Returns the parameter value for the given name or null if no parameter
+ * with such a name exists.
+ */
+ getParameter : function( name ) {
+ var result = this._parameters[ name ];
+ if( result === undefined ) {
+ result = null;
+ }
+ return result;
+ },
+
+ /**
+ * Adds the given eventType to this request. The sourceId denotes the id of
+ * the widget that caused the event.
+ */
+ addEvent : function( eventType, sourceId ) {
+ this._parameters[ eventType ] = sourceId;
+ },
+
+ /**
+ * To enable server callbacks to the UI this method sends a request
+ * that will be blocked by the server till background activities
+ * require UI updates.
+ */
+ enableUICallBack : function( url, service_param, service_id ) {
+ var request = new qx.io.remote.Request( url,
+ qx.net.Http.METHOD_GET,
+ qx.util.Mime.JAVASCRIPT );
+ request.setParameter( service_param, service_id );
+ this._sendStandalone( request );
+ },
+
+ /**
+ * Sends this request. All parameters that were added since the last 'send()'
+ * will now be sent.
+ */
+ send : function() {
+ if( !this._inDelayedSend ) {
+ this._inDelayedSend = true;
+ // Wait and then actually send the request
+ // TODO [rh] optimize wait interval (below 60ms seems to not work
+ // reliable)
+ qx.client.Timer.once( this._sendImmediate, this, 60 );
+ }
+ },
+
+ _sendImmediate : function() {
+ this._dispatchSendEvent();
+ // set mandatory parameters; do this after regular params to override them
+ // in case of conflict
+ this._parameters[ "uiRoot" ] = this._uiRootId;
+ if( this._requestCounter == -1 ) {
+ // TODO [fappel]: This is a workaround that prevents sending a request
+ // without a valid request id. Needed for background proccessing.
+ this._inDelayedSend = false;
+ this.send();
+ } else {
+ if( this._requestCounter != null ) {
+ this._parameters[ "requestCounter" ] = this._requestCounter;
+ this._requestCounter = -1;
+ }
+
+ // create and configure request object
+ var request = this._createRequest();
+ // copy the _parameters map which was filled during client interaction
+ // to the request
+ this._inDelayedSend = false;
+ this._copyParameters( request );
+ this._logSend();
+ this._runningRequestCount++;
+ // notify user when request takes longer than 500 ms
+ if( this._runningRequestCount === 1 ) {
+ qx.client.Timer.once( this._showWaitHint, this, 500 );
+ }
+ // queue request to be sent
+ request.send();
+ // clear the parameter list
+ this._parameters = {};
+ }
+ },
+
+ _copyParameters : function( request ) {
+ var data = new Array();
+ for( var parameterName in this._parameters ) {
+ data.push( encodeURIComponent( parameterName )
+ + "="
+ + encodeURIComponent( this._parameters[ parameterName ] ) );
+ }
+ request.setData( data.join( "&" ) );
+ },
+
+ _createRequest : function() {
+ var result = new qx.io.remote.Request( this._url,
+ qx.net.Http.METHOD_POST,
+ qx.util.Mime.TEXT );
+ result.addEventListener( "sending", this._handleSending, this );
+ result.addEventListener( "completed", this._handleCompleted, this );
+ result.addEventListener( "failed", this._handleFailed, this );
+ return result;
+ },
+
+ _logSend : function() {
+ if( qx.core.Variant.isSet( "qx.debug", "on" ) ) {
+ var msg = "sending request [ ";
+ for( var parameterName in this._parameters ) {
+ msg += parameterName + "=" + this._parameters[ parameterName ] + "; ";
+ }
+ msg += "]";
+ this.debug( msg );
+ }
+ },
+
+ _sendStandalone : function( request ) {
+ // TODO [rh] WORKAROUND
+ // we would need two requestQueues (one for 'normal' requests that
+ // is limited to 1 concurrent request and one for the 'independant'
+ // requests created here
+ // Until qooxdoo supports multiple requestQueues we create and
+ // send this kind of request without knownledge of the request queue
+ var vRequest = request;
+ var vTransport = new qx.io.remote.Exchange(vRequest);
+ // Establish event connection between qx.io.remote.Exchange instance and
+ // qx.io.remote.Request
+ vTransport.addEventListener("sending", vRequest._onsending, vRequest);
+ vTransport.addEventListener("receiving", vRequest._onreceiving, vRequest);
+ vTransport.addEventListener("completed", vRequest._oncompleted, vRequest);
+ vTransport.addEventListener("aborted", vRequest._onaborted, vRequest);
+ vTransport.addEventListener("timeout", vRequest._ontimeout, vRequest);
+ vTransport.addEventListener("failed", vRequest._onfailed, vRequest);
+ vTransport._start = (new Date).valueOf();
+ vTransport.send();
+ // END WORKAROUND
+ },
+
+ ////////////////////////
+ // Handle request events
+
+ _handleSending : function( evt ) {
+ var exchange = evt.getTarget();
+ this._currentRequest = exchange.getRequest();
+ },
+
+ _handleFailed : function( evt ) {
+ var giveUp = true;
+ if( this._isConnectionError( evt.getStatusCode() ) ) {
+ giveUp = !this._handleConnectionError( evt );
+ }
+ if( giveUp ) {
+ this._hideWaitHint();
+ var content;
+ var text = evt.getTarget().getImplementation().getRequest().responseText;
+ if( text == "" || text == null ) {
+ content
+ = "<html><head><title>Error Page</title></head><body>"
+ + "<p>Request failed:</p><pre>"
+ + "HTTP Status Code: "
+ + String( evt.getStatusCode() )
+ + "</pre></body></html>";
+ } else {
+ content = text;
+ }
+ this._writeErrorPage( content );
+ }
+ },
+
+ _handleCompleted : function( evt ) {
+ var text = evt.getTarget().getImplementation().getRequest().responseText;
+ if( text && text.indexOf( "<!DOCTYPE" ) === 0 ) {
+ // Handle request to timed out session: write info page and offer
+ // link to restart application. This way was chosen for two reasons:
+ // - with rendering an anchor tag we can restart the same entry point as
+ // is currently used
+ // - as clicking the link issues a regular request, we can be sure that
+ // the stale application will be cleaned up properly by the browser
+ var content
+ = "<html><head><title>Session timed out</title></head>"
+ + "<body><p>The server session timed out.</p>"
+ + "<p>Please click <a href=\""
+ + window.location
+ + "\">here</a> to restart the session.</p>"
+ + "</body></html>";
+ this._writeErrorPage( content );
+ } else {
+ try {
+ if( text && text.length > 0 ) {
+ window.eval( text );
+ }
+ this._runningRequestCount--;
+ this._hideWaitHint( evt );
+ } catch( ex ) {
+ this.error( "Could not execute javascript: [" + text + "]", ex );
+ var content
+ = "<html><head><title>Error Page</title></head><body>"
+ + "<p>Could not evaluate javascript response:</p><pre>"
+ + ex
+ + "\n\n"
+ + text
+ + "</pre></body></html>";
+ this._writeErrorPage( content );
+ }
+ }
+ },
+
+ ///////////////////////////////
+ // Handling connection problems
+
+ _handleConnectionError : function( evt ) {
+ var msg
+ = "The server seems to be temporarily unavailable.\n"
+ + "Would you like to retry?";
+ var result = confirm( msg );
+ if( result ) {
+ var request = this._createRequest();
+ var failedRequest = this._currentRequest;
+ // Reusing the same request object causes strange behaviour, therefore
+ // create a new request and copy the relevant parts from the failed one
+ var failedHeaders = failedRequest.getRequestHeaders();
+ for( var headerName in failedHeaders ) {
+ request.setRequestHeader( headerName, failedHeaders[ headerName ] );
+ }
+ var failedParameters = failedRequest.getParameters();
+ for( var parameterName in failedParameters ) {
+ request.setParameter( parameterName,
+ failedParameters[ parameterName ] );
+ }
+ request.setData( failedRequest.getData() );
+ this._restartRequest( request );
+ }
+ return result;
+ },
+
+ _restartRequest : function( request ) {
+ // TODO [rh] this is adapted from qx.io.remote.RequestQueue#add as there
+ // is no official way to insert a new request as the first one in
+ // RequestQueue
+ request.setState( "queued" );
+ var requestQueue = qx.io.remote.RequestQueue.getInstance();
+ qx.lang.Array.insertAt( requestQueue._queue, request, 0 );
+ requestQueue._check();
+ if( requestQueue.getEnabled() ) {
+ requestQueue._timer.start();
+ }
+ },
+
+ _isConnectionError : function( statusCode ) {
+ var result;
+ if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) {
+ result = ( statusCode === 12029
+ || statusCode === 12030
+ || statusCode === 12031 );
+ } else if( qx.core.Variant.isSet( "qx.client", "gecko" ) ) {
+ result = ( statusCode === -1 );
+ } else if( qx.core.Variant.isSet( "qx.client", "webkit" ) ) {
+ result = ( statusCode === 0 );
+ } else if( qx.core.Variant.isSet( "qx.client", "opera" ) ) {
+ result = ( statusCode === 0 );
+ } else {
+ result = false;
+ }
+ return result;
+ },
+
+ ///////////////////////////////////////////////////
+ // Wait hint - UI feedback while request is running
+
+ _showWaitHint : function() {
+ if( this._runningRequestCount > 0 ) {
+ var doc = qx.ui.core.ClientDocument.getInstance();
+ doc.setGlobalCursor( qx.constant.Style.CURSOR_PROGRESS );
+ }
+ },
+
+ _hideWaitHint : function( evt ) {
+ if( this._runningRequestCount === 0 ) {
+ var doc = qx.ui.core.ClientDocument.getInstance();
+ doc.setGlobalCursor( null );
+ }
+ },
+
+ _dispatchSendEvent : function() {
+ if( this.hasEventListeners( "send" ) ) {
+ var event = new qx.event.type.DataEvent( "send", this );
+ this.dispatchEvent( event, true );
+ }
+ },
+
+ _writeErrorPage : function( content ) {
+ // shutdown or disable all things that could interfere with showing the
+ // error page
+ var app = qx.core.Init.getInstance().getApplication();
+ app.setExitConfirmation( null );
+ qx.io.remote.RequestQueue.getInstance().setEnabled( false );
+ // write the error page content
+ document.open( "text/html", true );
+ document.write( content );
+ document.close();
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TabUtil-322550739.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TabUtil-322550739.js
new file mode 100644
index 0000000000..44881363ec
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TabUtil-322550739.js
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.TabUtil", {
+
+ statics : {
+ createTabItem : function( id, parentId, index ) {
+ var tabButton = new qx.ui.pageview.tabview.Button();
+ tabButton.setTabIndex( -1 );
+ tabButton.setLabel( "(empty)" );
+ tabButton.getLabelObject().setMode( "html" );
+ tabButton.setLabel( "" );
+ tabButton.setEnableElementFocus( false );
+ tabButton.addEventListener( "changeFocused",
+ org.eclipse.swt.TabUtil._onTabItemChangeFocus );
+ tabButton.addEventListener( "click",
+ org.eclipse.swt.TabUtil._onTabItemClick );
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var tabView = widgetManager.findWidgetById( parentId );
+ tabView.getBar().addAt( tabButton, index );
+ var tabViewPage = new qx.ui.pageview.tabview.Page( tabButton );
+ tabView.getPane().add( tabViewPage );
+ widgetManager.add( tabButton, id );
+ widgetManager.add( tabViewPage, id + "pg" );
+ },
+
+ releaseTabItem : function( itemId ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var tabButton = widgetManager.findWidgetById( itemId );
+ tabButton.removeEventListener( "changeFocused",
+ org.eclipse.swt.TabUtil._onTabItemChangeFocus );
+ tabButton.removeEventListener( "click",
+ org.eclipse.swt.TabUtil._onTabItemClick );
+ var tabPage = widgetManager.findWidgetById( itemId + "pg" );
+ widgetManager.dispose( tabPage );
+ },
+
+ _onTabItemChangeFocus : function( evt ) {
+ // Focus the tabFolder the item belongs to when the item is focused
+ if( evt.getTarget().getFocused() ) {
+ evt.getTarget().getParent().getParent().focus();
+ }
+ },
+
+ _onTabItemClick : function( evt ) {
+ // Focus the tabFolder the item belongs to when the item is clicked
+ var folder = evt.getTarget().getParent().getParent();
+ if( !folder.getFocused() ) {
+ folder.focus();
+ }
+ },
+
+ onTabFolderKeyPress : function( evt ) {
+ var folder = evt.getTarget();
+ if( folder.classname == "qx.ui.pageview.tabview.TabView" ) {
+ var manager = folder.getBar().getManager();
+ var item = manager.getSelected();
+ if( item != null ) {
+ switch( evt.getKeyIdentifier() ) {
+ case "Left":
+ manager.selectPrevious( item );
+ org.eclipse.swt.TabUtil.markTabItemFocused( folder,
+ evt.getTarget() );
+ evt.stopPropagation();
+ break;
+ case "Right":
+ manager.selectNext( item );
+ org.eclipse.swt.TabUtil.markTabItemFocused( folder,
+ evt.getTarget() );
+ evt.stopPropagation();
+ break;
+ }
+ }
+ }
+ },
+
+ onTabFolderChangeFocused : function( evt ) {
+ var folder = evt.getTarget();
+ var item = folder.getBar().getManager().getSelected();
+ org.eclipse.swt.TabUtil.markTabItemFocused( folder, item );
+ },
+
+ markTabItemFocused : function( folder, item ) {
+ var items = folder.getBar().getManager().getItems();
+ for( var i = 0; i < items.length; i++ ) {
+ items[i].removeState( "focused" );
+ }
+ // add state to the selected item if the tabFolder is focused
+ if( item != null && folder.getFocused() ) {
+ item.addState( "focused" );
+ }
+ },
+
+ tabSelected : function( evt ) {
+ var tab = evt.getTarget();
+ if( !org_eclipse_rap_rwt_EventUtil_suspend && tab.getChecked() ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ // TODO [rst] Add item parameter in doWidgetSelected
+ var itemId = widgetManager.findIdByWidget( tab );
+ req.addParameter( "org.eclipse.swt.events.widgetSelected.item",
+ itemId );
+ var id = widgetManager.findIdByWidget( tab.getParent().getParent() );
+ org.eclipse.swt.EventUtil.doWidgetSelected( id, 0, 0, 0, 0 );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TextUtil-1782166993.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TextUtil-1782166993.js
new file mode 100644
index 0000000000..af20a4733a
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TextUtil-1782166993.js
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.TextUtil", {
+
+ statics : {
+
+ // TODO [rh] workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=201080
+ // the fix is to exchange the _onblur implementation of qx.ui.forms.Text
+ // with our own one, that checks parent != null before calling
+ // setSelectionLength
+ hijack : function( text ) {
+ text.removeEventListener( "blur", text._onblur );
+ text._onblur = function() {
+ var vValue = this.getComputedValue().toString();
+ if( this._textOnFocus != vValue ) {
+ this.setValue( vValue );
+ }
+ if( this.getParent() != null ) {
+ this.setSelectionLength( 0 );
+ }
+ };
+ text.addEventListener( "blur", text._onblur );
+ },
+
+ ///////////////////////////////////////////////////////////////
+ // Functions for ModifyEvents and maintenance of the text/value
+
+ modifyText : function( evt ) {
+ var text = evt.getTarget();
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && org.eclipse.swt.TextUtil._isModifyingKey( evt.getKeyIdentifier() ) )
+ {
+ // if not yet done, register an event listener that adds a request param
+ // with the text widgets' content just before the request is sent
+ if( !org.eclipse.swt.TextUtil._isModified( text ) ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEventListener( "send", org.eclipse.swt.TextUtil._onSend, text );
+ org.eclipse.swt.TextUtil._setModified( text, true );
+ }
+ }
+ org.eclipse.swt.TextUtil.updateSelection( text, null );
+ },
+
+ /**
+ * This function gets assigned to the 'keyup' event of a text widget if
+ * there was a server-side ModifyListener registered.
+ */
+ modifyTextAction : function( evt ) {
+ var text = evt.getTarget();
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && !org.eclipse.swt.TextUtil._isModified( text )
+ && org.eclipse.swt.TextUtil._isModifyingKey( evt.getKeyIdentifier() ) )
+ {
+ var req = org.eclipse.swt.Request.getInstance();
+ // Register 'send'-listener that adds a request param with current text
+ if( !org.eclipse.swt.TextUtil._isModified( text ) ) {
+ req.addEventListener( "send", org.eclipse.swt.TextUtil._onSend, text );
+ org.eclipse.swt.TextUtil._setModified( text, true );
+ }
+ // add modifyText-event with sender-id to request parameters
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget(text);
+ req.addEvent( "org.eclipse.swt.events.modifyText", id );
+ // register listener that is notified when a request is sent
+ qx.client.Timer.once( org.eclipse.swt.TextUtil._delayedModifyText,
+ text,
+ 500 );
+ }
+ org.eclipse.swt.TextUtil.updateSelection( text, null );
+ },
+
+ /**
+ * This function gets assigned to the 'blur' event of a text widget if there
+ * was a server-side ModifyListener registered.
+ */
+ modifyTextOnBlur : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend
+ && org.eclipse.swt.TextUtil._isModified( evt.getTarget() ) )
+ {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.modifyText", id );
+ req.send();
+ }
+ },
+
+ _onSend : function( evt ) {
+ // NOTE: 'this' references the text widget
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".text", this.getComputedValue() );
+ // remove the _onSend listener and change the text widget state to 'unmodified'
+ req.removeEventListener( "send", org.eclipse.swt.TextUtil._onSend, this );
+ org.eclipse.swt.TextUtil._setModified( this, false );
+ // Update the value property (which is qooxdoo-wise only updated on
+ // focus-lost) to be in sync with server-side
+ if( this.getFocused() ) {
+ this.setValue( this.getComputedValue() );
+ }
+ },
+
+ _delayedModifyText : function( evt ) {
+ // NOTE: this references the text widget (see qx.client.Timer.once above)
+ if( org.eclipse.swt.TextUtil._isModified( this ) ) {
+ var req = org.eclipse.swt.Request.getInstance();
+ req.send();
+ }
+ },
+
+ _isModified : function( widget ) {
+ return widget.getUserData("modified") == true;
+ },
+
+ _setModified : function( widget, modified ) {
+ return widget.setUserData("modified", modified);
+ },
+
+ /**
+ * Determines whether the given keyIdentifier potentially modifies the
+ * content of a text widget.
+ */
+ _isModifyingKey : function( keyIdentifier ) {
+ var result = false;
+ switch( keyIdentifier ) {
+ // Modifier keys
+ case "Shift":
+ case "Control":
+ case "Alt":
+ case "Meta":
+ case "Win":
+ // Navigation keys
+ case "Up":
+ case "Down":
+ case "Left":
+ case "Right":
+ case "Home":
+ case "End":
+ case "PageUp":
+ case "PageDown":
+ case "Tab":
+ // Context menu key
+ case "Apps":
+ //
+ case "Escape":
+ case "Insert":
+ case "Enter":
+ //
+ case "CapsLock":
+ case "NumLock":
+ case "Scroll":
+ case "PrintScreen":
+ // Function keys 1 - 12
+ case "F1":
+ case "F2":
+ case "F3":
+ case "F4":
+ case "F5":
+ case "F6":
+ case "F7":
+ case "F8":
+ case "F9":
+ case "F10":
+ case "F11":
+ case "F12":
+ break;
+ default:
+ result = true;
+ }
+ return result;
+ },
+
+ ///////////////////////////////////////////////////////////////////
+ // Functions to maintain the selection-start and -length properties
+
+ onMouseUp : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var text = evt.getTarget();
+ org.eclipse.swt.TextUtil.updateSelection( text, null );
+ }
+ },
+
+ updateSelection : function( text, enclosingWidget ) {
+ // TODO [rh] executing the code below for a TextArea leads to Illegal
+ // Argument
+ if( text.classname != "qx.ui.form.TextArea" ) {
+ var widget = enclosingWidget != null ? enclosingWidget : text;
+ var start = text.getSelectionStart();
+ var length = text.getSelectionLength();
+ if( text.getUserData( "selectionStart" ) != start ) {
+ text.setUserData( "selectionStart", start );
+ org.eclipse.swt.TextUtil._setPropertyParam( widget,
+ "selectionStart",
+ start );
+ }
+ if( text.getUserData( "selectionLength" ) != length ) {
+ text.setUserData( "selectionLength", length );
+ org.eclipse.swt.TextUtil._setPropertyParam( widget,
+ "selectionCount",
+ length );
+ }
+ }
+ },
+
+ // TODO [rst] not text specific, move this function to Request
+ _setPropertyParam : function( widget, name, value ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( widget );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + "." + name, value );
+ },
+
+ setSelection : function( text, start, length ) {
+ if( text.isCreated() && !text.getUserData( "pooled" ) ) {
+ org.eclipse.swt.TextUtil._doSetSelection( text, start, length );
+ }
+ else {
+ text.setUserData( "onAppear.selectionStart", start );
+ text.setUserData( "onAppear.selectionLength", length );
+ text.addEventListener( "appear",
+ org.eclipse.swt.TextUtil._onAppearSetSelection );
+ }
+ },
+
+ _onAppearSetSelection : function( evt ) {
+ var text = evt.getTarget();
+ var start = text.getUserData( "onAppear.selectionStart" );
+ var length = text.getUserData( "onAppear.selectionLength" );
+ org.eclipse.swt.TextUtil._doSetSelection( text, start, length );
+ text.removeEventListener( "appear",
+ org.eclipse.swt.TextUtil._onAppearSetSelection );
+ },
+
+ _doSetSelection : function( text, start, length ) {
+ text.setUserData( "selectionStart", start );
+ text.setSelectionStart( start );
+ text.setUserData( "selectionLength", length );
+ text.setSelectionLength( length );
+ },
+
+ // TODO [rst] Workaround for pooling problems with wrap property in IE.
+ // These methods can probably be dropped once qx bug 300 is fixed.
+ setWrap : function( text, wrap ) {
+ if( text.isCreated() && !text.getUserData( "pooled" ) ) {
+ text.setWrap( wrap );
+ } else {
+ text.setUserData( "onAppear.wrap", wrap );
+ text.addEventListener( "appear",
+ org.eclipse.swt.TextUtil._onAppearSetWrap );
+ }
+ },
+
+ _onAppearSetWrap : function( evt ) {
+ var text = evt.getTarget();
+ var wrap = text.getUserData( "onAppear.wrap" );
+ text.setUserData( "onAppear.wrap", undefined );
+ text.setWrap( wrap );
+ text.removeEventListener( "appear",
+ org.eclipse.swt.TextUtil._onAppearSetWrap );
+ },
+
+ ////////////////////////////
+ // SelectionListener support
+
+ /**
+ * This function is registered server-side if a SelectionListener should
+ * be notified about the widgetDefaultSelection event that occurs when
+ * Enter was pressed.
+ */
+ widgetDefaultSelected : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ if( evt.getKeyIdentifier() == "Enter"
+ && !evt.isShiftPressed()
+ && !evt.isAltPressed()
+ && !evt.isCtrlPressed()
+ && !evt.isMetaPressed() )
+ {
+ evt.setPropagationStopped( true );
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var id = widgetManager.findIdByWidget( evt.getTarget() );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.widgetDefaultSelected", id );
+ req.send();
+ }
+ }
+ }
+
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ToolItemUtil-436206436.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ToolItemUtil-436206436.js
new file mode 100644
index 0000000000..49443f5fea
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/ToolItemUtil-436206436.js
@@ -0,0 +1,139 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions for toolbar items.
+ */
+qx.Class.define( "org.eclipse.swt.ToolItemUtil", {
+
+ statics : {
+ createSeparator : function( id, parent, isFlat ) {
+ var sep = new qx.ui.toolbar.Separator();
+ var line = sep.getFirstChild();
+ sep.setUserData( "line", line );
+ if( isFlat ) {
+ sep.addState( "rwt_FLAT" );
+ line.addState( "rwt_FLAT" );
+ }
+ org.eclipse.swt.WidgetManager.getInstance().add( sep, id, false );
+ sep.setParent( parent );
+ parent.add( sep );
+ },
+
+ setControl : function( sep, control ) {
+ if( control ) {
+ control.moveSelfAfter( sep );
+ control.setDisplay( true );
+ sep.setUserData( "control", control );
+ sep.setDisplay( false );
+ } else {
+ var oldcontrol = sep.getUserData( "control", control );
+ if( oldcontrol ) {
+ oldcontrol.setDisplay( false );
+ }
+ sep.setDisplay( true );
+ }
+ },
+
+ createRadio : function( id, parent, selected, neighbour ) {
+ var radio = new qx.ui.toolbar.RadioButton();
+ radio.setDisableUncheck( true );
+ parent.add( radio );
+ if( neighbour ) {
+ radio.radioManager = neighbour.radioManager;
+ } else {
+ radio.radioManager = new qx.ui.selection.RadioManager();
+ }
+ radio.radioManager.add( radio );
+ if( selected ) {
+ radio.radioManager.setSelected( radio );
+ }
+ radio.setLabel( "(empty)" );
+ radio.getLabelObject().setMode( "html" );
+ radio.setLabel( "" );
+ org.eclipse.swt.WidgetManager.getInstance().add( radio, id, false );
+ radio.setParent( parent );
+ },
+
+ createPush : function( id, parent, isFlat ) {
+ var push = new qx.ui.toolbar.Button();
+ if( isFlat ) {
+ push.addState( "rwt_FLAT" );
+ }
+ push.setShow( "both" );
+ push.setLabel( "(empty)" );
+ push.getLabelObject().setMode( qx.constant.Style.LABEL_MODE_HTML );
+ push.setLabel( "" );
+ parent.add( push );
+ org.eclipse.swt.WidgetManager.getInstance().add( push, id, false );
+ },
+
+ createDropDown : function( id, parent, isFlat ) {
+ org.eclipse.swt.ToolItemUtil.createPush( id, parent, isFlat );
+ var button
+ = org.eclipse.swt.WidgetManager.getInstance().findWidgetById( id );
+ var dropDown = new qx.ui.toolbar.Button( "", "widget/arrows/down.gif" );
+ dropDown.setHeight( "100%" );
+ dropDown.setUserData( "buttonId", id );
+ if( isFlat ) {
+ dropDown.addState( "rwt_FLAT" );
+ }
+ parent.add( dropDown );
+ var dropDownId = id + "_dropDown";
+ org.eclipse.swt.WidgetManager.getInstance().add( dropDown, dropDownId, false );
+ // Register enable listener that keeps enabled state of dropDown in sync
+ // with the enabeled state of the actual button
+ // TODO [rh] check whether this listener must be removed upon disposal
+ button.addEventListener( "changeEnabled",
+ org.eclipse.swt.ToolItemUtil._onDropDownChangeEnabled );
+ },
+
+ _onDropDownChangeEnabled : function( evt ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var button = evt.getTarget();
+ var buttonId = widgetManager.findIdByWidget( button );
+ var dropDownId = buttonId + "_dropDown";
+ var dropDown = widgetManager.findWidgetById( dropDownId );
+ dropDown.setEnabled( button.getEnabled() );
+ },
+
+ updateDropDownListener : function( id, remove ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var dropDown = widgetManager.findWidgetById( id );
+ var listener = org.eclipse.swt.ToolItemUtil._dropDownSelected;
+ if( remove ) {
+ dropDown.removeEventListener( "execute", listener );
+ } else {
+ dropDown.addEventListener( "execute", listener );
+ }
+ },
+
+ createCheck : function( id, parent ) {
+ var button = new qx.ui.toolbar.CheckBox();
+ parent.add( button );
+ org.eclipse.swt.WidgetManager.getInstance().add( button, id, false );
+ },
+
+ _dropDownSelected : function( evt ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var dropDown = evt.getTarget();
+ var dropDownId = widgetManager.findIdByWidget( dropDown );
+ var buttonId = dropDown.getUserData( "buttonId" );
+ var button = widgetManager.findWidgetById( buttonId );
+ var element = button.getElement();
+ var left = qx.html.Location.getPageBoxLeft( element );
+ var top = qx.html.Location.getPageBoxBottom( element );
+ var req = org.eclipse.swt.Request.getInstance();
+ org.eclipse.swt.EventUtil.doWidgetSelected( dropDownId, left, top, 0, 0 );
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TreeItemUtil-208952825.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TreeItemUtil-208952825.js
new file mode 100644
index 0000000000..52eb91cf45
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/TreeItemUtil-208952825.js
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * This class contains static functions needed for TreeItems.
+ */
+// TODO [rh] move remaining methods to TreeItem.js and delete
+qx.Class.define( "org.eclipse.swt.TreeItemUtil", {
+
+ statics : {
+
+ createTreeItem : function( widgetId, parent, tree ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+
+ var realParent = null;
+ if( parent instanceof org.eclipse.swt.widgets.Tree ) {
+ realParent = parent.getTree();
+ } else {
+ realParent = parent;
+ }
+
+ var w = new org.eclipse.swt.widgets.TreeItem( realParent, tree );
+ wm.add( w, widgetId, false );
+
+ this.hijackTreeItemSelection( w );
+ },
+
+ /**
+ * Hijacking to avoid selection bugs.
+ *
+ * TODO: Remove this after next qooxdoo update
+ */
+ hijackTreeItemSelection : function( item ) {
+ item._applySelected = function(value, old)
+ {
+ if (value)
+ {
+ this.addState("selected");
+ this._labelObject.addState("selected");
+ }
+ else
+ {
+ this.removeState("selected");
+ this._labelObject.removeState("selected");
+ }
+
+ var vTree = this.getTree();
+
+ if (!vTree._fastUpdate || (old && vTree._oldItem == this))
+ {
+ this._iconObject.setSource(this._evalCurrentIcon());
+
+ if (value) {
+ this._iconObject.addState("selected");
+ } else {
+ this._iconObject.removeState("selected");
+ }
+ }
+
+ /**
+ * Disabled due to selection bugs in qooxdoo
+ var vManager = this.getTree().getManager();
+
+ if (old && vManager.getSelectedItem() == this) {
+ vManager.deselectAll();
+ } else if (value && vManager.getSelectedItem() != this) {
+ //vManager.setSelectedItem(this);
+ }
+ */
+ };
+ }
+
+
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetManager-512780408.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetManager-512780408.js
new file mode 100644
index 0000000000..d81abc0c36
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetManager-512780408.js
@@ -0,0 +1,369 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * Maps widget id's to their respective object references. Allows for
+ * adding, removing and disposing of widgets and their id. In addition
+ * the mapping of widgets and their respective id's can be queried.
+ */
+qx.Class.define( "org.eclipse.swt.WidgetManager", {
+ type : "singleton",
+ extend : qx.core.Object,
+
+ construct : function() {
+ this.base( arguments );
+ // Holds the association between widget-id's and widget-instances.
+ // Key: id (string), value: widget instanace (qx.ui.core.Widget)
+ this._map = {};
+
+ // initialize widget pool
+ this._widgetPool = new Object();
+ // this field is needed as Opera has some problems with
+ // accessing local variables in eval expressions.
+ this._current = null;
+
+ this._fontPool = new Object();
+ this._toolTipPool = new Array();
+ },
+
+ statics : {
+ _onAppearFocus : function( evt ) {
+ var widget = this;
+ widget.focus();
+ evt.getTarget().removeEventListener(
+ "appear",
+ org.eclipse.swt.WidgetManager._onAppearFocus,
+ widget );
+ },
+
+ _onAppearSetForeground : function( evt ) {
+ var color = String( this );
+ if( color == null ) {
+ evt.getTarget().resetTextColor();
+ } else {
+ // 'this' references the color string but for some reason must be
+ // explicitly converted to a string
+ evt.getTarget().setTextColor( color );
+ }
+ evt.getTarget().removeEventListener(
+ "appear",
+ org.eclipse.swt.WidgetManager._onAppearSetForeground,
+ this );
+ }
+ },
+
+ members : {
+ /**
+ * Disposes of the widget that is registered with the given id. The widget
+ * is disconnected from its parent, its 'dispose' method is called and it is
+ * removed from this WidgetManager (see remove).
+ * No action is taken if there is no widget registered for the given id or
+ * the widget was already disposed of.
+ * In case of a widget type that supports pooling the widget is disconnected
+ * from its parent, its 'disposeHandler' that reinitializes the widget is
+ * called and it's added to the pool to be ready for reuse.
+ */
+ dispose : function( id ) {
+ var widget = this.findWidgetById( id );
+ if( widget != null ) {
+ this.remove( widget );
+ if( !widget.getDisposed() ) {
+ this._removeToolTipPopup( widget );
+ // TODO [rh] workaround for disposing of a Sash: if( parent && ...
+ var parent = widget.getParent();
+ if( parent && parent.getChildren() ) {
+ widget.setParent( null );
+ }
+ // handle widgets that can be pooled
+ var typePoolId = widget.getUserData( "typePoolId" );
+ if( typePoolId != null ) {
+ var typePool = this._widgetPool[ typePoolId ];
+ typePool.resetHandler( widget );
+ widget.setUserData( "pooled", true );
+ // EXPERIMENTAL: If the widget has a reset method, call it
+ if( widget.rap_reset ) {
+ widget.rap_reset();
+ }
+ typePool.elements.push( widget );
+ // dispose of widgets that cannot be pooled
+ } else {
+ widget.dispose();
+ }
+ }
+ }
+ },
+
+ registerResetHandler : function( typePoolId, resetHandler ) {
+ this._createWidgetPool( typePoolId, resetHandler );
+ },
+
+ newWidget : function( widgetId, parentId, isControl, typePoolId, type ) {
+ this.newWidget( widgetId, parentId, isControl, typePoolId, type, null );
+ },
+
+ newWidget : function( widgetId,
+ parentId,
+ isControl,
+ typePoolId,
+ type,
+ paramList )
+ {
+ // Note [fappel]: Do not remove the 'wm' declaration. This is needed
+ // for IE if the 'newExpression' has a reference to
+ // the variable defined in the script from the server.
+ // TODO [fappel]: Think about improvement of the hardcoded expression...
+ var wm = this;
+
+ var result = null;
+ // if the widget type supports pooling get a widget from the pool -
+ // if available...
+ if( typePoolId != null && this._widgetPool[ typePoolId ] ) {
+ var typePool = this._widgetPool[ typePoolId ];
+ result = typePool.elements.pop();
+ if( result ) {
+ if( paramList != null ) {
+ // If paramList isn't empty we have to reinitialize the widget.
+ // Luckily only our own js widgets use this...
+ var expression = "org.eclipse.swt.WidgetManager.getInstance()."
+ + "_current.reInit("
+ + paramList
+ + ");";
+ // Assignment of the field _current is needed as Opera has some
+ // problems with accessing local variables in eval expressions.
+ this._current = result;
+ window.eval( expression );
+ this._current = null;
+ }
+ // EXPERIMENTAL: If the widget has an init method, call it
+ if( result.rap_init ) {
+ result.rap_init();
+ }
+ }
+// this.debug( "_____ recycled: " + result );
+ }
+
+ // ... otherwise create a new one
+ if( result == null ) {
+ var newExpression;
+ if( paramList != null ) {
+ newExpression = "new " + type + "(" + paramList + ");";
+ } else {
+ newExpression = "new " + type + "();";
+ }
+ result = window.eval( newExpression );
+ result.setUserData( "typePoolId", typePoolId );
+ result.setUserData( "pooled", false );
+// this.debug( "_____ created: " + result );
+ }
+
+ // map the widget to the server side widgetId
+ if( result.classname == "org.eclipse.swt.widgets.Shell" ) {
+ // TODO [rh] HACK: when a Shell is created, the isControl parameter is
+ // set to false so that setParent isn't called (see below).
+ // But to keep the activeControl mechanism working, it must be
+ // added to the WidgetManager with the isCcontrol flag set to true
+ this.add( result, widgetId, true );
+ } else {
+ this.add( result, widgetId, isControl );
+ }
+ // insert controls into the widget tree
+ if( isControl ) {
+ this.setParent( result, parentId );
+ }
+ return result;
+ },
+
+ /**
+ * Registeres the given widget under the given id at the WidgetManager.
+ */
+ add : function( widget, id, isControl ) {
+ this._map[ id ] = widget;
+ if( isControl != "undefined" && isControl == true ) {
+ widget.setUserData( "isControl", true );
+ }
+ widget.setUserData( "id", id );
+ },
+
+ /**
+ * Unregisteres the given widget at the WidgetManager. Note that the widget is
+ * not disposed of.
+ */
+ remove : function( widget ) {
+ var id = this.findIdByWidget( widget );
+ delete this._map[ id ];
+ },
+
+ /**
+ * Returns the widget for the given id or null if there is no widget
+ * registered for the given id exists.
+ */
+ findWidgetById : function( id ) {
+ var result = this._map[ id ];
+ if( result == null ) {
+ this.warn( "No widget registered for id " + id );
+ }
+ return result;
+ },
+
+ /**
+ * Returns the id (string) for the given widget or null if the widget is not
+ * registered.
+ */
+ findIdByWidget : function( widget ) {
+ var result;
+ if( widget != null ) {
+ result = widget.getUserData( "id" );
+ }
+ return result;
+ },
+
+ /**
+ * Determines whether the given widget represents a server-side instance of
+ * Control (or one of its subclasses)
+ */
+ isControl : function( widget ) {
+ var data = null;
+ if( widget != null ) {
+ data = widget.getUserData( "isControl" );
+ }
+ return data != null && data == true;
+ },
+
+ /**
+ * Adds the given widget to the children of the widget denoted by parentId
+ */
+ setParent : function( widget, parentId ) {
+ var parent = this.findWidgetById( parentId );
+ // TODO [rh] there seems to be a difference between add and setParent
+ // when using add sizes and clipping are treated differently
+ // parent.add( widget );
+ widget.setParent( parent );
+ },
+
+ setHtmlId : function( widget, id ) {
+ // Test if 'widget' provides a setHtmlProperty method, fail silently
+ // otherwise
+ if( widget.setHtmlProperty ) {
+ widget.setHtmlProperty( "id", id );
+ }
+ },
+
+ focus : function( widgetId ) {
+ var widget = this.findWidgetById( widgetId );
+ if( widget.isMaterialized() ) {
+ widget.focus();
+ } else {
+ widget.addEventListener( "appear",
+ org.eclipse.swt.WidgetManager._onAppearFocus,
+ widget );
+ }
+ },
+
+ setForeground : function( widget, color ) {
+// TODO [rst] It seems that this workaround is not necessary anymore
+// if ( widget.isMaterialized() ) { // TODO [rh] isMaterialized or isCreated?
+ if( color == null ) {
+ widget.resetTextColor();
+ } else {
+ widget.setTextColor( color );
+ }
+// } else {
+// widget.addEventListener(
+// "appear",
+// org.eclipse.swt.WidgetManager._onAppearSetForeground,
+// color );
+// }
+ },
+
+ /**
+ * Creates a new caching pool for widgets with the given pooling id.
+ */
+ _createWidgetPool : function( typePoolId, resetHandler ) {
+ var typePool = new Object();
+ typePool.elements = new Array();
+ typePool.resetHandler = resetHandler;
+ this._widgetPool[ typePoolId ] = typePool;
+ },
+
+ ////////////////
+ // Font handling
+
+ setFont : function( widget, name, size, bold, italic ) {
+ if( widget.setFont ) { // test if font property is supported
+ var font = this._createFont( name, size, bold, italic );
+ widget.setFont( font );
+ } else {
+ this.debug( widget.classname + " does not support fonts" );
+ }
+ },
+
+ _createFont : function( name, size, bold, italic ) {
+ var id = name + size + bold + italic;
+ var font = this._fontPool[ id ];
+ if( !font ) {
+ font = new qx.ui.core.Font( size, name );
+ font.setBold( bold );
+ font.setItalic( italic );
+ this._fontPool[ id ] = font;
+ }
+ return font;
+ },
+
+ ////////////////////
+ // ToolTip handling
+
+ /**
+ * Sets the toolTipText for the given widget. An empty or null toolTipText
+ * removes the tool tip of the widget.
+ */
+ setToolTip : function( widget, toolTipText ) {
+ // remove and dispose of an eventually existing tool tip
+ this._removeToolTipPopup( widget );
+ if( toolTipText != null && toolTipText != "" ) {
+ var toolTip = this._createToolTipPopup( toolTipText );
+ widget.setToolTip( toolTip );
+ }
+ },
+
+ /**
+ * Fetches a recycled tool tip popup from the widget pool if available or
+ * creates one otherwise.
+ */
+ _createToolTipPopup : function( text ) {
+ var toolTip = this._toolTipPool.pop();
+ if( !toolTip ) {
+ toolTip = new qx.ui.popup.ToolTip();
+ var atom = toolTip.getAtom();
+ atom.setLabel( "(empty)" );
+ atom.getLabelObject().setMode( "html" );
+ atom.setLabel( text );
+ } else {
+ toolTip.getAtom().setLabel( text );
+ }
+ return toolTip;
+ },
+
+ /**
+ * Removes the tool tip that is assigned to the given widget and stores it
+ * in the widget pool.
+ * If the widget has no tool tip assigned, nothing is done.
+ */
+ _removeToolTipPopup : function( widget ) {
+ var toolTip = widget.getToolTip();
+ widget.setToolTip( null );
+ if( toolTip ) {
+ // hide tooltip as disposing a visible one might cause app to hang
+ toolTip.hide();
+ this._toolTipPool.push( toolTip );
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetUtil-1981844903.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetUtil-1981844903.js
new file mode 100644
index 0000000000..7ee7d23b24
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/WidgetUtil-1981844903.js
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+/**
+ * This class contains static functions for radio buttons and check boxes.
+ */
+qx.Class.define( "org.eclipse.swt.WidgetUtil", {
+
+ statics : {
+
+ /*
+ * workaround for IE bug
+ * div's have the height of the font even if they are empty
+ */
+ fixIEBoxHeight : function( widget ) {
+ if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) {
+ widget.setStyleProperty( "fontSize", "0" );
+ widget.setStyleProperty( "lineHeight", "0" );
+ }
+ }
+ }
+}); \ No newline at end of file
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/browser/Browser733962551.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/browser/Browser733962551.js
new file mode 100644
index 0000000000..9776697901
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/browser/Browser733962551.js
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.browser.Browser", {
+ extend : qx.ui.embed.Iframe,
+
+ construct : function() {
+ this.base( arguments );
+ // TODO [rh] preliminary workaround to make Browser accessible by tab
+ this.setTabIndex( 1 );
+ this.setAppearance( "browser" );
+ },
+
+ members : {
+
+ execute : function( script ) {
+ var result = true;
+ try {
+ this.getContentWindow().eval( script );
+ } catch( e ) {
+ result = false;
+ }
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = org.eclipse.swt.WidgetManager.getInstance().findIdByWidget( this );
+ req.addParameter( id + ".executeResult", result );
+ req.send();
+ }
+
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabFolder-602093123.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabFolder-602093123.js
new file mode 100644
index 0000000000..1f9a21b803
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabFolder-602093123.js
@@ -0,0 +1,425 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.custom.CTabFolder", {
+ extend : qx.ui.layout.CanvasLayout,
+
+ construct : function() {
+ this.base( arguments );
+ this.setTabIndex( 1 );
+ this.setHideFocus( true );
+ this._hasFolderListener = false;
+ this._hasSelectionListener = false;
+ this._tabPosition = "top";
+ this._tabHeight = 20;
+ //
+ var borderColor = "#c0c0c0";
+ var border = new qx.ui.core.Border( 1, "solid", borderColor );
+ this.setBorder( border );
+ //
+ this._chevron = null;
+ this._chevronMenu = null;
+ // Minimize/maximize buttons, initially non-existing
+ this._minMaxState = "normal"; // valid states: min, max, normal
+ this._maxButton = null;
+ this._minButton = null;
+ // Construct highlight border lines
+ var highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setLeft( 2, "solid", borderColor );
+ this._highlightLeft = new qx.ui.basic.Atom();
+ this._highlightLeft.setBorder( highlightBorder );
+ this._highlightLeft.setWidth( 2 );
+ this.add( this._highlightLeft );
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setRight( 2, "solid", borderColor );
+ this._highlightRight = new qx.ui.basic.Atom();
+ this._highlightRight.setBorder( highlightBorder );
+ this._highlightRight.setWidth( 2 );
+ this.add( this._highlightRight );
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setTop( 2, "solid", borderColor );
+ this._highlightTop = new qx.ui.basic.Atom();
+ this._highlightTop.setBorder( highlightBorder );
+ this._highlightTop.setLeft( 0 );
+ this._highlightTop.setHeight( 2 );
+ this.add( this._highlightTop );
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setTop( 2, "solid", borderColor );
+ this._highlightBottom = new qx.ui.basic.Atom();
+ this._highlightBottom.setBorder( highlightBorder );
+ this._highlightBottom.setLeft( 0 );
+ this._highlightBottom.setHeight( 1 );
+
+ // fix ie style issues
+ org.eclipse.swt.WidgetUtil.fixIEBoxHeight( this._highlightLeft );
+ org.eclipse.swt.WidgetUtil.fixIEBoxHeight( this._highlightRight );
+ org.eclipse.swt.WidgetUtil.fixIEBoxHeight( this._highlightTop );
+ org.eclipse.swt.WidgetUtil.fixIEBoxHeight( this._highlightBottom );
+
+ this.add( this._highlightBottom );
+ // Create horizontal line that separates the button bar from the rest of
+ // the client area
+ border = new qx.ui.core.Border();
+ border.setTop( 1, "solid", borderColor );
+ this._separator = new qx.ui.basic.Atom();
+ this._separator.setBorder( border );
+ this._separator.setLeft( 0 );
+// this._separator.setTop( this._tabHeight );
+ this._separator.setHeight( 1 );
+ this.add( this._separator );
+ // Add resize listeners to update selection border (this._highlightXXX)
+ this.addEventListener( "changeWidth", this._updateHighlightBorders, this );
+ this.addEventListener( "changeHeight", this._updateHighlightBorders, this );
+ // Add keypress listener to select items with left/right keys
+ this.addEventListener( "keypress", this._onKeyPress, this );
+ },
+
+ destruct : function() {
+ // use hideMin/MaxButton to dispose of toolTips
+ this.hideMinButton();
+ this.hideMaxButton();
+ this.removeEventListener( "changeWidth", this._updateHighlightBorders, this );
+ this.removeEventListener( "changeHeight", this._updateHighlightBorders, this );
+ this.removeEventListener( "keypress", this._onKeyPress, this );
+ },
+
+ statics : {
+ BUTTON_SIZE : 18,
+
+ MIN_TOOLTIP : "Minimize",
+ MAX_TOOLTIP : "Maximize",
+ RESTORE_TOOLTIP : "Restore",
+ CHEVRON_TOOLTIP : "Show List",
+ CLOSE_TOOLTIP : "Close",
+
+ setToolTipTexts : function( min, max, restore, chevron, close ) {
+ org.eclipse.swt.custom.CTabFolder.MIN_TOOLTIP = min;
+ org.eclipse.swt.custom.CTabFolder.MAX_TOOLTIP = max;
+ org.eclipse.swt.custom.CTabFolder.RESTORE_TOOLTIP = restore;
+ org.eclipse.swt.custom.CTabFolder.CHEVRON_TOOLTIP = chevron;
+ org.eclipse.swt.custom.CTabFolder.CLOSE_TOOLTIP = close;
+ }
+ },
+
+ members : {
+ /* valid values; "top", "bottom" */
+ setTabPosition : function( tabPosition ) {
+ this._tabPosition = tabPosition;
+ // update tab items
+ var children = this.getChildren();
+ for( var i = 0; i < children.length; i++ ) {
+ if( children[ i ].classname === "org.eclipse.swt.custom.CTabItem" ) {
+ children[ i ].setTabPosition( tabPosition );
+ }
+ }
+ this._updateHighlightBorders();
+ },
+
+ getTabPosition : function() {
+ return this._tabPosition;
+ },
+
+ setTabHeight : function( tabHeight ) {
+ this._tabHeight = tabHeight;
+ this._separator.setTop( this._tabHeight );
+ var buttonTop = this._getButtonTop();
+ if( this._minButton != null ) {
+ this._minButton.setTop( buttonTop );
+ }
+ if( this._maxButton != null ) {
+ this._maxButton.setTop( buttonTop );
+ }
+ if( this._chevron != null ) {
+ this._chevron.setTop( buttonTop );
+ }
+ this._updateHighlightBorders();
+ },
+
+ // TODO [rh] optimize usage of border objects (get, change, set)
+ setSelectionBackground : function( color ) {
+ var highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setLeft( 2, qx.constant.Style.BORDER_SOLID, color );
+ this._highlightLeft.setBorder( highlightBorder );
+
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setRight( 2, qx.constant.Style.BORDER_SOLID, color );
+ this._highlightRight.setBorder( highlightBorder );
+
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setTop( 2, qx.constant.Style.BORDER_SOLID, color );
+ this._highlightTop.setBorder( highlightBorder );
+
+ highlightBorder = new qx.ui.core.Border();
+ highlightBorder.setTop( 2, qx.constant.Style.BORDER_SOLID, color );
+ this._highlightBottom.setBorder( highlightBorder );
+ },
+
+ _getButtonTop : function() {
+ return ( this._tabHeight / 2 ) - ( org.eclipse.swt.custom.CTabFolder.BUTTON_SIZE / 2 );
+ },
+
+ showChevron : function( left, top, width, height ) {
+ if( this._chevron == null ) {
+ // Create chevron button
+ this._chevron = new qx.ui.toolbar.Button();
+ this._chevron.addState( "rwt_FLAT" );
+ this._chevron.setShow( qx.constant.Style.BUTTON_SHOW_ICON );
+ this._chevron.addEventListener( "execute", this._onChevronExecute, this );
+ this._chevron.setIcon( "widget/ctabfolder/chevron.gif" );
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._chevron,
+ org.eclipse.swt.custom.CTabFolder.CHEVRON_TOOLTIP );
+ this.add( this._chevron );
+ }
+ this._chevron.setTop( top );
+ this._chevron.setLeft( left );
+ this._chevron.setWidth( width );
+ this._chevron.setHeight( height );
+ },
+
+ hideChevron : function() {
+ if( this._chevron != null ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._chevron, null );
+ this._chevron.removeEventListener( "execute", this._onChevronExecute, this );
+ this.remove( this._chevron );
+ this._chevron.dispose();
+ this._chevron = null;
+ }
+ },
+
+ setMinMaxState : function( state ) {
+ this._minMaxState = state;
+ var minIcon = "";
+ var maxIcon = "";
+ var minToolTip = "";
+ var maxToolTip = "";
+ switch( state ) {
+ case "min":
+ minIcon = "widget/ctabfolder/restore.gif";
+ maxIcon = "widget/ctabfolder/maximize.gif";
+ minToolTip = org.eclipse.swt.custom.CTabFolder.RESTORE_TOOLTIP;
+ maxToolTip = org.eclipse.swt.custom.CTabFolder.MAX_TOOLTIP;
+ break;
+ case "max":
+ minIcon = "widget/ctabfolder/minimize.gif";
+ maxIcon = "widget/ctabfolder/restore.gif";
+ minToolTip = org.eclipse.swt.custom.CTabFolder.MIN_TOOLTIP;
+ maxToolTip = org.eclipse.swt.custom.CTabFolder.RESTORE_TOOLTIP;
+ break;
+ case "normal":
+ minIcon = "widget/ctabfolder/minimize.gif";
+ maxIcon = "widget/ctabfolder/maximize.gif";
+ minToolTip = org.eclipse.swt.custom.CTabFolder.MIN_TOOLTIP;
+ maxToolTip = org.eclipse.swt.custom.CTabFolder.MAX_TOOLTIP;
+ break;
+ }
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ if( this._minButton != null ) {
+ this._minButton.setIcon( minIcon );
+ wm.setToolTip( this._minButton, minToolTip );
+ }
+ if( this._maxButton != null ) {
+ this._maxButton.setIcon( maxIcon );
+ wm.setToolTip( this._maxButton, maxToolTip );
+ }
+ },
+
+ showMaxButton : function( left, top, width, height ) {
+ if( this._maxButton == null ) {
+ this._maxButton = new qx.ui.toolbar.Button();
+ this._maxButton.addState( "rwt_FLAT" );
+ this._maxButton.setShow( qx.constant.Style.BUTTON_SHOW_ICON );
+ this.setMinMaxState( this._minMaxState ); // initializes the icon according to current state
+ this._maxButton.addEventListener( "execute", this._onMinMaxExecute, this );
+ this.add( this._maxButton );
+ }
+ this._maxButton.setTop( top );
+ this._maxButton.setLeft( left );
+ this._maxButton.setWidth( width );
+ this._maxButton.setHeight( height );
+ },
+
+ hideMaxButton : function() {
+ if( this._maxButton != null ) {
+ this._maxButton.removeEventListener( "execute",
+ this._onMinMaxExecute,
+ this );
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._maxButton, null );
+ this.remove( this._maxButton );
+ this._maxButton.dispose();
+ this._maxButton = null;
+ }
+ },
+
+ showMinButton : function( left, top, width, height ) {
+ if( this._minButton == null ) {
+ this._minButton = new qx.ui.toolbar.Button();
+ this._minButton.addState( "rwt_FLAT" );
+ this._minButton.setShow( qx.constant.Style.BUTTON_SHOW_ICON );
+ this.setMinMaxState( this._minMaxState ); // initializes the icon according to current state
+ this._minButton.addEventListener( "execute", this._onMinMaxExecute, this );
+ this.add( this._minButton );
+ }
+ this._minButton.setTop( top );
+ this._minButton.setLeft( left );
+ this._minButton.setWidth( width );
+ this._minButton.setHeight( height );
+ },
+
+ hideMinButton : function( left ) {
+ if( this._minButton != null ) {
+ this._minButton.removeEventListener( "execute",
+ this._onMinMaxExecute,
+ this );
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._minButton, null );
+ this.remove( this._minButton );
+ this._minButton.dispose();
+ this._minButton = null;
+ }
+ },
+
+ setHasFolderListener : function( hasFolderListener ) {
+ this._hasFolderListener = hasFolderListener;
+ },
+
+ setHasSelectionListener : function( value ) {
+ this._hasSelectionListener = value;
+ },
+
+ _updateHighlightBorders : function() {
+ var separatorHeight = this._separator.getHeight();
+ // ex _onChangeWidth
+ this._separator.setWidth( this.getWidth() - 2 );
+ this._highlightRight.setLeft( this.getWidth() - 2 - this._highlightRight.getWidth() );
+ this._highlightTop.setWidth( this.getWidth() - 2 );
+ this._highlightBottom.setWidth( this.getWidth() - 2 );
+ // ex _onChangeHeight
+ var top;
+ if( this._tabPosition === "top" ) {
+ this._separator.setTop( this._tabHeight );
+ this._highlightBottom.setTop( this.getHeight() - 4 );
+ this._highlightTop.setTop( this._tabHeight + separatorHeight );
+ top = this._tabHeight + separatorHeight + 2;
+ } else { // tabPosition == "bottom"
+ this._separator.setTop( this.getHeight() - ( this._tabHeight + 1 ) );
+ this._highlightBottom.setTop( this.getHeight() - ( this._tabHeight + separatorHeight + 2 ) );
+ this._highlightTop.setTop( 0 );
+ top = 2;
+ }
+ var height = this.getHeight() - ( this._tabHeight + separatorHeight + 4 );
+ this._highlightLeft.setTop( top );
+ this._highlightLeft.setHeight( height );
+ this._highlightRight.setTop( top );
+ this._highlightRight.setHeight( height );
+ },
+
+ _onChevronExecute : function( evt ) {
+ if( this._chevronMenu == null || !this._chevronMenu.isSeeable() ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEvent( "org.eclipse.swt.events.ctabFolderShowList", id );
+ req.send();
+ }
+ }
+ },
+
+ _onMinMaxExecute : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var event;
+ if ( evt.getTarget() == this._minButton ) {
+ // Minimize button was pressed
+ if( this._minMaxState == "min" ) {
+ this.setMinMaxState( "normal" );
+ event = "org.eclipse.swt.events.ctabFolderRestored";
+ } else {
+ this.setMinMaxState( "min" );
+ event = "org.eclipse.swt.events.ctabFolderMinimized";
+ }
+ } else {
+ // Maximize button was pressed
+ if( this._minMaxState == "normal" || this.minMaxState == "min" ) {
+ this.setMinMaxState( "max" );
+ event = "org.eclipse.swt.events.ctabFolderMaximized";
+ } else {
+ this.setMinMaxState( "normal" );
+ event = "org.eclipse.swt.events.ctabFolderRestored";
+ }
+ }
+ var id = org.eclipse.swt.WidgetManager.getInstance().findIdByWidget( this );
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addParameter( id + ".minimized", this._minMaxState == "min" );
+ req.addParameter( id + ".maximized", this._minMaxState == "max" );
+ if( this._hasFolderListener ) {
+ req.addEvent( event, id );
+ req.send();
+ }
+ }
+ },
+
+ _onKeyPress : function( evt ) {
+ switch( evt.getKeyIdentifier() ) {
+ case "Left":
+ // TODO [rh] implementatin missing: select tab item to the left
+ evt.stopPropagation();
+ break;
+ case "Right":
+ // TODO [rh] implementatin missing: select tab item to the right
+ evt.stopPropagation();
+ break;
+ }
+ },
+
+ // TODO [rst] Change to respect _hasSelectionListener as soon as server-side
+ // code is revised accordingly -> CTabFolderLCA.readData().
+ _notifyItemClick : function(item) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ if( !item.isSelected() ) {
+ // deselect any previous selected CTabItem
+ var items = this.getChildren();
+ for( var i = 0; i < items.length; i++ ) {
+ if ( items[ i ].classname == "org.eclipse.swt.custom.CTabItem" ) {
+ items[ i ].setSelected( false );
+ }
+ }
+ item.setSelected( true );
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( this );
+ var itemId = widgetManager.findIdByWidget( item );
+ req.addParameter( id + ".selectedItemId", itemId );
+ req.addEvent( "org.eclipse.swt.events.widgetSelected", id );
+ req.send();
+ }
+ }
+ },
+
+ _notifyItemDblClick : function( item ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ if( this._hasSelectionListener ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( this );
+ var itemId = widgetManager.findIdByWidget( item );
+ // TODO [rst] remove this parameter as soon as server-side code is revised
+ // -> CTabFolderLCA.readData()
+ req.addParameter( id + ".selectedItemId", itemId );
+ req.addEvent( "org.eclipse.swt.events.widgetDefaultSelected", id );
+ req.send();
+ }
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabItem1765734906.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabItem1765734906.js
new file mode 100644
index 0000000000..b584c11898
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/CTabItem1765734906.js
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+qx.Class.define( "org.eclipse.swt.custom.CTabItem", {
+ extend : qx.ui.basic.Atom,
+
+ construct : function( parent, canClose ) {
+ this.base( arguments );
+ this.setAppearance( "c-tab-item" );
+ this.setVerticalChildrenAlign( qx.constant.Layout.ALIGN_MIDDLE );
+ this.setHorizontalChildrenAlign( qx.constant.Layout.ALIGN_LEFT );
+ this.setOverflow( qx.constant.Style.OVERFLOW_HIDDEN );
+ this.setTabIndex( -1 );
+ // Set the label part to 'html mode'
+ this.setLabel( "(empty)" );
+ this.getLabelObject().setMode( qx.constant.Style.LABEL_MODE_HTML );
+ this.getLabelObject().setVerticalAlign( qx.constant.Layout.ALIGN_MIDDLE );
+ this.setLabel( "" );
+ this._selected = false;
+ this._unselectedCloseVisible = true;
+ this._selectionBackground = null;
+ this._selectionForeground = null;
+ this.setTabPosition( parent.getTabPosition() );
+ if( canClose ) {
+ this._closeButton = new qx.ui.basic.Image();
+ this._closeButton.setAppearance( "c-tab-close-button" );
+ this._closeButton.setWidth( 20 );
+ // TODO [rh] center image vertically in tab item
+ this._closeButton.setHeight( "80%" );
+ this._closeButton.addEventListener( "click", this._onClose, this );
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._closeButton,
+ org.eclipse.swt.custom.CTabFolder.CLOSE_TOOLTIP );
+ this.add( this._closeButton );
+ this._updateCloseButton();
+ } else {
+ this._closeButton = null;
+ }
+ this.addEventListener( "mouseover", this._onMouseOver, this );
+ this.addEventListener( "mouseout", this._onMouseOut, this );
+ this.addEventListener( "click", this._onClick, this );
+ this.addEventListener( "dblclick", this._onDblClick, this );
+ },
+
+ destruct : function() {
+ this.removeEventListener( "mouseover", this._onMouseOver, this );
+ this.removeEventListener( "mouseout", this._onMouseOut, this );
+ this.removeEventListener( "click", this._onClick, this );
+ this.removeEventListener( "dblclick", this._onDblClick, this );
+ if( this._closeButton != null ) {
+ this._closeButton.removeEventListener( "click", this._onClose, this );
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ wm.setToolTip( this._closeButton, null );
+ this._closeButton.dispose();
+ this._closeButton = null;
+ }
+ },
+
+ statics : {
+ STATE_OVER : "over",
+ STATE_SELECTED : "selected",
+
+ IMG_CLOSE : "widget/ctabfolder/close.gif",
+ IMG_CLOSE_HOVER : "widget/ctabfolder/close_hover.gif"
+ },
+
+ members : {
+ setTabPosition : function( tabPosition ) {
+ if( tabPosition === "top" ) {
+ this.addState( "barTop" );
+ } else {
+ this.removeState( "barTop" );
+ }
+ },
+
+ setSelected : function( selected ) {
+ this._selected = selected;
+ if( selected ) {
+ this.addState( org.eclipse.swt.custom.CTabItem.STATE_SELECTED );
+ this.setBackgroundColor( this._selectionBackground );
+ this.setTextColor( this._selectionForeground );
+ } else {
+ this.removeState( org.eclipse.swt.custom.CTabItem.STATE_SELECTED );
+ this.setBackgroundColor( null );
+ this.setTextColor( null );
+ }
+ this._updateCloseButton();
+ },
+
+ isSelected : function() {
+ return this._selected;
+ },
+
+ setUnselectedCloseVisible : function( value ) {
+ this._unselectedCloseVisible = value;
+ this._updateCloseButton();
+ },
+
+ setSelectionBackground : function( color ) {
+ this._selectionBackground = color;
+ if( this.isSelected() ) {
+ this.setBackgroundColor( this._selectionBackground );
+ }
+ },
+
+ setSelectionForeground : function( color ) {
+ this._selectionForeground = color;
+ if( this.isSelected() ) {
+ this.setTextColor( this._selectionForeground );
+ }
+ },
+
+ _updateCloseButton : function() {
+ if( this._closeButton != null ) {
+ var visible
+ = this.isSelected()
+ || ( this._unselectedCloseVisible
+ && this.hasState( org.eclipse.swt.custom.CTabItem.STATE_OVER ) );
+ this._closeButton.setVisibility( visible );
+ }
+ },
+
+ _onMouseOver : function( evt ) {
+ this.addState( org.eclipse.swt.custom.CTabItem.STATE_OVER );
+ if( evt.getTarget() == this._closeButton ) {
+ this._closeButton.addState( org.eclipse.swt.custom.CTabItem.STATE_OVER );
+ }
+ this._updateCloseButton();
+ },
+
+ _onMouseOut : function( evt ) {
+ this.removeState( org.eclipse.swt.custom.CTabItem.STATE_OVER );
+ if( evt.getTarget() == this._closeButton ) {
+ this._closeButton.removeState( org.eclipse.swt.custom.CTabItem.STATE_OVER );
+ }
+ this._updateCloseButton();
+ },
+
+ _onClick : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ if( evt.getTarget() != this._closeButton ) {
+ evt.getTarget().getParent()._notifyItemClick( evt.getTarget() );
+ }
+ }
+ },
+
+ _onDblClick : function( evt ) {
+ if( evt.getTarget() != this._closeButton ) {
+ evt.getTarget().getParent()._notifyItemDblClick( evt.getTarget() );
+ }
+ },
+
+ _onClose : function( evt ) {
+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) {
+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
+ var req = org.eclipse.swt.Request.getInstance();
+ var id = widgetManager.findIdByWidget( this );
+ req.addEvent( "org.eclipse.swt.events.ctabItemClosed", id );
+ req.send();
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/ScrolledComposite900368632.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/ScrolledComposite900368632.js
new file mode 100644
index 0000000000..8e3f8d72d0
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/custom/ScrolledComposite900368632.js
@@ -0,0 +1,100 @@
+
+/*******************************************************************************
+ * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.swt.custom.ScrolledComposite", {
+ extend : qx.ui.layout.CanvasLayout,
+
+ construct : function() {
+ this.base( arguments );
+ this.setAppearance( "scrolledcomposite" );
+ this._initialScrollTop = null;
+ this._initialScrollLeft = null;
+ this._lastScrollLeft = 0;
+ this._lastScrollTop = 0;
+ var req = org.eclipse.swt.Request.getInstance();
+ req.addEventListener( "send", this._onRequestSend, this );
+ },
+
+ destruct : function() {
+ var req = org.eclipse.swt.Request.getInstance();
+ req.removeEventListener( "send", this._onRequestSend, this );
+ },
+
+ members : {
+
+ setHBarSelection : function( value ) {
+ if( !this.isCreated() ) {
+ this._initialScrollLeft = value;
+ this.addEventListener( "create", this._setHBarSelectionOnCreate, this );
+ } else {
+ this.setScrollLeft( value );
+ this._lastScrollLeft = value;
+ }
+ },
+
+ setVBarSelection : function( value ) {
+ if( !this.isCreated() ) {
+ this._initialScrollTop = value;
+ this.addEventListener( "create", this._setVBarSelectionOnCreate, this );
+ } else {
+ this.setScrollTop( value );
+ this._lastScrollTop = value;
+ }
+ },
+
+ _setHBarSelectionOnCreate : function( evt ) {
+ if( this._initialScrollLeft != null ) {
+ // Workaround: IE throws error when setting scrollLeft to a higher value
+ // than scrollWidth.
+ if( this._initialScrollLeft <= this.getScrollWidth() ) {
+ this.setScrollLeft( this._initialScrollLeft );
+ }
+ this._lastScrollLeft = this._initialScrollLeft;
+ }
+ this.removeEventListener( "create", this._setHBarSelectionOnCreate, this );
+ },
+
+ _setVBarSelectionOnCreate : function( evt ) {
+ if( this._initialScrollTop != null ) {
+ // Workaround: IE throws error when setting scrollTop to a higher value
+ // than scrollHeight
+ if( this._initialScrollTop <= this.getScrollHeight() ) {
+ this.setScrollTop( this._initialScrollTop );
+ }
+ this._lastScrollTop = this._initialScrollTop;
+ }
+ this.removeEventListener( "create", this._setVBarSelectionOnCreate, this );
+ },
+
+ /**
+ * Creates request parameters that denote the current scroll position just
+ * before a request is sent.
+ * This is a workaround, it seems that there is no 'scroll event'.
+ */
+ _onRequestSend : function( evt ) {
+ if( this.isCreated() ) {
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var id = wm.findIdByWidget( this );
+ var scrollX = this.getScrollLeft();
+ if( scrollX != this._lastScrollLeft ) {
+ evt.getTarget().addParameter( id + ".horizontalBar.selection", scrollX );
+ this._lastScrollLeft = scrollX;
+ }
+ var scrollY = this.getScrollTop();
+ if( scrollY != this._lastScrollTop ) {
+ evt.getTarget().addParameter( id + ".verticalBar.selection", scrollY );
+ this._lastScrollTop = scrollY;
+ }
+ }
+ }
+ }
+});
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/AppearancesBase908093218.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/AppearancesBase908093218.js
new file mode 100644
index 0000000000..c489d7f486
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/AppearancesBase908093218.js
@@ -0,0 +1,1576 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Theme.define( "org.eclipse.swt.theme.AppearancesBase",
+{
+ title : "Appearances Base Theme",
+
+ appearances : {
+
+ "empty" : {
+ },
+
+ "widget" : {
+ },
+
+ "image" : {
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ CORE
+ ---------------------------------------------------------------------------
+ */
+
+ "cursor-dnd-move" : {
+ style : function(states) {
+ return {
+ source : "widget/cursors/move.gif"
+ };
+ }
+ },
+
+ "cursor-dnd-copy" : {
+ style : function(states) {
+ return {
+ source : "widget/cursors/copy.gif"
+ };
+ }
+ },
+
+ "cursor-dnd-alias" : {
+ style : function(states) {
+ return {
+ source : "widget/cursors/alias.gif"
+ };
+ }
+ },
+
+ "cursor-dnd-nodrop" : {
+ style : function(states) {
+ return {
+ source : "widget/cursors/nodrop.gif"
+ };
+ }
+ },
+
+ "client-document" :
+ {
+ style : function( states ) {
+ return {
+ font : "widget.font",
+ textColor : "black",
+ backgroundColor : "white",
+ // TODO [rst] Eliminate absolute references
+ backgroundImage : "./resource/widget/rap/display/bg.gif"
+ };
+ }
+ },
+
+ "client-document-blocker" :
+ {
+ style : function( states ) {
+ // You could also use: "static/image/dotted_white.gif" for example as backgroundImage here
+ // (Visible) background tiles could be dramatically slow down mshtml!
+ // A background image or color is always needed for mshtml to block the events successfully.
+ return {
+ cursor : "default",
+ backgroundImage : "static/image/blank.gif"
+ };
+ }
+ },
+
+ "atom" :
+ {
+ style : function( states ) {
+ return {
+ cursor : "default",
+ spacing : 4,
+ width : "auto",
+ height : "auto",
+ horizontalChildrenAlign : "center",
+ verticalChildrenAlign : "middle"
+ };
+ }
+ },
+
+ // Note: This appearance applies to qooxdoo labels (as embedded in Atom,
+ // Button, etc.). For SWT Label, see apperance "label-wrapper".
+ // Any styles set for this appearance cannot be overridden by themeing of
+ // controls that include a label! This is because the "inheritance" feature
+ // does not overwrite theme property values from themes.
+ "label" :
+ {
+ },
+
+ "label-graytext" :
+ {
+ style : function( states ) {
+ return {
+ textColor : states.disabled ? "widget.graytext" : "undefined"
+ };
+ }
+ },
+
+ // this applies to a qooxdoo qx.ui.basic.Atom that represents an RWT Label
+ "label-wrapper" :
+ {
+ style : function( states ) {
+ return {
+ textColor : states.disabled ? "widget.graytext" : "widget.foreground",
+ backgroundColor : "widget.background",
+ font : "widget.font",
+ border : states.rwt_BORDER ? "label.BORDER.border" : "label.border"
+ };
+ }
+ },
+
+ // this applies to a qooxdoo qx.ui.basic.Atom that represents an RWT Label
+ "c-label-wrapper" :
+ {
+ style : function( states ) {
+ var result = { };
+
+ result.textColor = states.disabled ? "widget.graytext" : "widget.foreground";
+ result.backgroundColor = "widget.background";
+ result.font = "widget.font";
+ if( states.rwt_SHADOW_IN ) {
+ result.border = "thinInset";
+ } else if( states.rwt_SHADOW_OUT ) {
+ result.border = "thinOutset";
+ } else {
+ result.border = states.rwt_BORDER ? "label.BORDER.border" : "label.border"
+ }
+ return result;
+ }
+ },
+
+ "htmlcontainer" :
+ {
+ include : "label"
+ },
+
+ "popup" :
+ {
+
+ },
+
+ "tool-tip" :
+ {
+ include : "popup",
+
+ style : function( states ) {
+ return {
+ backgroundColor : "widget.info.background",
+ textColor : "widget.info.foreground",
+ border : "info",
+ padding : [ 1, 3, 2, 3 ]
+ };
+ }
+ },
+
+ "iframe" :
+ {
+ style : function( states ) {
+ return {
+ border : "inset"
+ };
+ }
+ },
+
+ "check-box" :
+ {
+ style : function( states ) {
+ return {
+ font : "widget.font",
+ textColor : states.disabled ? "widget.graytext" : "button.CHECK.foreground",
+ backgroundColor : "button.CHECK.background",
+ cursor : "default",
+ width : "auto",
+ height : "auto",
+ horizontalChildrenAlign : "center",
+ verticalChildrenAlign : "middle",
+ spacing : 4,
+ padding : [ 2, 3 ],
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border"
+ };
+ }
+ },
+
+ "radio-button" : {
+ include : "check-box"
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ BUTTON
+ ---------------------------------------------------------------------------
+ */
+
+ "button" :
+ {
+ include : "atom",
+
+ style : function( states ) {
+ var result = { };
+
+ result.font = "button.font";
+ result.textColor = states.disabled ? "widget.graytext" : "button.foreground";
+
+ // background color
+ if( states.rwt_FLAT && ( states.pressed || states.checked ) ) {
+ result.backgroundColor = "button.FLAT.pressed.background";
+ } else if( states.over ) {
+ result.backgroundColor = "button.hover.background";
+ } else {
+ result.backgroundColor = "button.background";
+ }
+
+ // border
+ if( states.rwt_FLAT ) {
+ if( states.pressed || states.checked ) {
+ result.border = "button.FLAT.pressed.border";
+ } else {
+ result.border = "button.FLAT.border";
+ }
+ } else if( states.rwt_BORDER ) {
+ if( states.pressed || states.checked ) {
+ result.border = "button.BORDER.pressed.border";
+ } else {
+ result.border = "button.BORDER.border";
+ }
+ } else {
+ if( states.pressed || states.checked ) {
+ result.border = "button.pressed.border";
+ } else {
+ result.border = "button.border";
+ }
+ }
+
+ // padding
+ if( !states.rwt_FLAT && ( states.pressed || states.checked ) ) {
+ result.padding = [ 4, 3, 2, 5 ];
+ } else {
+ result.padding = [ 3, 4, 3, 4 ];
+ }
+
+ result.spacing = org.eclipse.swt.theme.Dimensions.getInstance().get( "button.spacing" );
+ return result;
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ TOOLBAR
+ ---------------------------------------------------------------------------
+ */
+
+ "toolbar" :
+ {
+ style : function( states ) {
+ return {
+ font : "widget.font",
+ overflow : "hidden",
+ border : states.rwt_BORDER ? "toolbar.BORDER.border" : "toolbar.border",
+ textColor : states.disabled ? "widget.graytext" : "widget.foreground",
+ backgroundColor : "toolbar.background"
+ };
+ }
+ },
+
+ "toolbar-separator" :
+ {
+ style : function( states ) {
+ return {
+ width : 8
+ };
+ }
+ },
+
+ "toolbar-separator-line" :
+ {
+ style : function( states ) {
+ return {
+ top : 2,
+ left : 3,
+ width : 2,
+ bottom : 2,
+ border : states.rwt_FLAT ? "horizontalDivider" : "undefined"
+ };
+ }
+ },
+
+ "toolbar-button" :
+ {
+ style : function( states ) {
+ var result =
+ {
+ cursor : "default",
+ overflow : "hidden",
+ spacing : 4,
+ width : "auto",
+ verticalChildrenAlign : "middle",
+ backgroundImage : states.checked && !states.over ? "static/image/dotted_white.gif" : null,
+ backgroundColor : "toolbar.background",
+ textColor : "toolbar.foreground"
+ };
+ if( states.disabled ) {
+ result.textColor = "widget.graytext";
+ } else if( states.over ) {
+ result.backgroundColor = "toolbar.hover.background";
+ result.textColor = "toolbar.hover.foreground";
+ }
+ if( states.pressed || states.checked || states.abandoned ) {
+ result.border = "thinInset";
+ result.padding = [ 3, 2, 1, 4 ];
+ } else if( !states.rwt_FLAT || states.over ) {
+ result.border = "thinOutset";
+ result.padding = [ 2, 3 ];
+ } else {
+ result.border = "undefined";
+ result.padding = [ 3, 4 ];
+ }
+ return result;
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ WINDOW (SHELL)
+ ---------------------------------------------------------------------------
+ */
+
+ "window" :
+ {
+ style : function( states ) {
+ return {
+ textColor : "widget.foreground",
+ backgroundColor : "shell.background",
+ border : ( states.rwt_TITLE || states.rwt_BORDER )
+ && !states.maximized
+ ? "shell.BORDER.border"
+ : "shell.border",
+ minWidth : states.rwt_TITLE ? 80 : 5,
+ minHeight : states.rwt_TITLE ? 25 : 5
+ };
+ }
+ },
+
+ "window-captionbar" :
+ {
+ style : function( states ) {
+ var dimensions = org.eclipse.swt.theme.Dimensions.getInstance();
+ var result = {
+ margin : dimensions.get( "shell.title.margin" ),
+ padding : dimensions.get( "shell.title.padding" ),
+ verticalChildrenAlign : "middle"
+ };
+ if( states.active ) {
+ result.textColor = "shell.title.foreground";
+ result.backgroundColor = "shell.title.background";
+ result.backgroundImage = "widget/shell.title.active.bgimage";
+ } else {
+ result.textColor = "shell.title.inactive.foreground";
+ result.backgroundColor = "shell.title.inactive.background";
+ result.backgroundImage = "widget/shell.title.inactive.bgimage";
+ }
+ if( states.rwt_TITLE ) {
+ result.minHeight = dimensions.get( "shell.title.height" );
+ result.maxHeight = dimensions.get( "shell.title.height" );
+ } else {
+ result.minHeight = 0;
+ result.maxHeight = 0;
+ }
+ return result;
+ }
+ },
+
+ "window-resize-frame" :
+ {
+ style : function( states ) {
+ return {
+ border : "shadow"
+ };
+ }
+ },
+
+ "window-captionbar-icon" :
+ {
+ style : function( states ) {
+ return {
+ marginRight : 2
+ };
+ }
+ },
+
+ "window-captionbar-title" :
+ {
+ style : function( states ) {
+ return {
+ cursor : "default",
+ font : "shell.title.font",
+ marginRight : 2
+ };
+ }
+ },
+
+ "window-captionbar-button" :
+ {
+ style : function( states ) {
+ var result = {
+ margin : org.eclipse.swt.theme.Dimensions.getInstance().get( "shell.button.margin" )
+ };
+ return result;
+ }
+ },
+
+ "window-captionbar-minimize-button" :
+ {
+ include : "window-captionbar-button",
+ style : function( states ) {
+ var result = {};
+ if( states.active ) {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.minbutton.over.image";
+ } else {
+ result.icon = "widget/shell.minbutton.image";
+ }
+ } else {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.minbutton.inactive.over.image";
+ } else {
+ result.icon = "widget/shell.minbutton.inactive.image";
+ }
+ }
+ return result;
+ }
+ },
+
+ "window-captionbar-maximize-button" :
+ {
+ include : "window-captionbar-button",
+ style : function( states ) {
+ var result = {};
+ if( states.active ) {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.maxbutton.over.image";
+ } else {
+ result.icon = "widget/shell.maxbutton.image";
+ }
+ } else {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.maxbutton.inactive.over.image";
+ } else {
+ result.icon = "widget/shell.maxbutton.inactive.image";
+ }
+ }
+ return result;
+ }
+ },
+
+ "window-captionbar-restore-button" :
+ {
+ include : "window-captionbar-button",
+ style : function( states ) {
+ var result = {};
+ if( states.active ) {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.restorebutton.over.image";
+ } else {
+ result.icon = "widget/shell.restorebutton.image";
+ }
+ } else {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.restorebutton.inactive.over.image";
+ } else {
+ result.icon = "widget/shell.restorebutton.inactive.image";
+ }
+ }
+ return result;
+ }
+ },
+
+ "window-captionbar-close-button" :
+ {
+ include : "window-captionbar-button",
+ style : function( states ) {
+ var result = {};
+ if( states.active ) {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.closebutton.over.image";
+ } else {
+ result.icon = "widget/shell.closebutton.image";
+ }
+ } else {
+ if( states.over && !states.pressed ) {
+ result.icon = "widget/shell.closebutton.inactive.over.image";
+ } else {
+ result.icon = "widget/shell.closebutton.inactive.image";
+ }
+ }
+ return result;
+ }
+ },
+
+ "window-statusbar" :
+ {
+ style : function( states ) {
+ return {
+ border : "thinInset",
+ height : "auto"
+ };
+ }
+ },
+
+ "window-statusbar-text" :
+ {
+ style : function( states ) {
+ return {
+ padding : [ 1, 4 ],
+ cursor : "default"
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ RESIZER
+ ---------------------------------------------------------------------------
+ */
+
+ // TODO [rst] necessary?
+
+ "resizer" :
+ {
+ style : function( states ) {
+ return {
+ border : "outset"
+ };
+ }
+ },
+
+ "resizer-frame" :
+ {
+ style : function( states ) {
+ return {
+ border : "shadow"
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ MENU
+ ---------------------------------------------------------------------------
+ */
+
+ "menu" :
+ {
+ style : function( states ) {
+ return {
+ width : "auto",
+ height : "auto",
+ textColor : "menu.foreground",
+ backgroundColor : "menu.background",
+ overflow : "hidden",
+ border : "menu.border",
+ padding : org.eclipse.swt.theme.Dimensions.getInstance().get( "menu.padding" )
+ };
+ }
+ },
+
+ "menu-layout" :
+ {
+ style : function( states ) {
+ return {
+ top : 0,
+ right : 0,
+ bottom : 0,
+ left : 0
+ };
+ }
+ },
+
+ "menu-button" :
+ {
+ style : function( states ) {
+ var result = {
+ minWidth : "auto",
+ height : "auto",
+ spacing : 2,
+ padding : [ 2, 4 ],
+ cursor : "default",
+ verticalChildrenAlign : "middle",
+ backgroundColor : states.over ? "menu.hover.background" : "menu.background"
+ };
+ if( states.disabled ) {
+ result.textColor = "widget.graytext";
+ } else if( states.over ) {
+ result.textColor = "menu.hover.foreground";
+ } else {
+ result.textColor = "menu.foreground";
+ }
+ return result;
+ }
+ },
+
+ "menu-button-arrow" :
+ {
+ style : function( states ) {
+ return {
+ source : "widget/arrows/next.gif"
+ };
+ }
+ },
+
+ "menu-check-box" :
+ {
+ include : "menu-button",
+
+ style : function(states)
+ {
+ return {
+ icon : states.checked ? "widget/menu/checkbox.gif" : "static/image/blank.gif"
+ };
+ }
+ },
+
+ "menu-radio-button" :
+ {
+ include : "menu-button",
+
+ style : function(states)
+ {
+ return {
+ icon : states.checked ? "widget/menu/radiobutton.gif" : "static/image/blank.gif"
+ };
+ }
+ },
+
+ "menu-separator" :
+ {
+ style : function( states ) {
+ return {
+ height : "auto",
+ marginTop : 3,
+ marginBottom : 2,
+ paddingLeft : 3,
+ paddingRight : 3
+ };
+ }
+ },
+
+ "menu-separator-line" :
+ {
+ style : function( states ) {
+ return {
+ right : 0,
+ left : 0,
+ height : 0,
+ border : "verticalDivider"
+ };
+ }
+ },
+
+ "menubar-button" :
+ {
+ style : function( states ) {
+ var result =
+ {
+ cursor : "default",
+ overflow : "hidden",
+ spacing : 4,
+ width : "auto",
+ padding : [ 3, 4 ],
+ verticalChildrenAlign : "middle",
+ backgroundImage : states.checked && !states.over ? "static/image/dotted_white.gif" : null
+ };
+ if( states.disabled ) {
+ result.backgroundColor = "toolbar.background";
+ result.textColor = "widget.graytext";
+ } else if( states.over ) {
+ result.backgroundColor = "menu.hover.background";
+ result.textColor = "menu.hover.foreground";
+ } else {
+ result.backgroundColor = "menu.background";
+ result.textColor = "menu.foreground";
+ }
+ return result;
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ LIST
+ ---------------------------------------------------------------------------
+ */
+
+ "list" :
+ {
+ style : function( states ) {
+ return {
+ overflow : "hidden",
+ backgroundColor : "list.background",
+ border : states.rwt_BORDER ? "thinInset" : "undefined"
+ };
+ }
+ },
+
+ "list-item" :
+ {
+ style : function( states ) {
+ var result = {
+ cursor : "default",
+ height : "auto",
+ horizontalChildrenAlign : "left",
+ verticalChildrenAlign : "middle",
+ spacing : 4,
+ padding : [ 3, 5 ],
+ minWidth : "auto"
+ };
+ if( states.selected ) {
+ if( states.parent_unfocused ) {
+ result.textColor = states.disabled ? "widget.graytext" : "list.selection.unfocused.foreground";
+ result.backgroundColor = "list.selection.unfocused.background";
+ } else {
+ result.textColor = states.disabled ? "widget.graytext" : "list.selection.foreground";
+ result.backgroundColor = "list.selection.background";
+ }
+ } else {
+ result.textColor = states.disabled ? "widget.graytext" : "undefined";
+ result.backgroundColor = null;
+ }
+ return result;
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ TEXT
+ ---------------------------------------------------------------------------
+ */
+
+ "text-field" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "text.BORDER.border" : "text.border",
+ font : "widget.font",
+ padding : org.eclipse.swt.theme.Dimensions.getInstance().get( "text.SINGLE.padding" ),
+ textColor : states.disabled ? "widget.graytext" : "undefined",
+ backgroundColor : "list.background"
+ };
+ }
+ },
+
+ "text-area" : {
+ include : "text-field",
+ style : function( states ) {
+ return {
+ padding : states.rwt_BORDER ? [ 0, 0, 0, 4 ] : [ 0, 0, 0, 3 ]
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ COMBOBOX
+ ---------------------------------------------------------------------------
+ */
+
+ "combo-box" :
+ {
+ style : function( states ) {
+ return {
+ border : "inset",
+ backgroundColor : "list.background"
+ };
+ }
+ },
+
+ "combo-box-list" :
+ {
+ include : "list",
+
+ style : function( states ) {
+ return {
+ border : "undefined",
+ overflow : "scrollY"
+ };
+ }
+ },
+
+ "combo-box-popup" :
+ {
+ include : "list",
+
+ style : function( states ) {
+ return {
+ height : "auto",
+ border : "shadow",
+ textColor : states.selected ? "list.selection.foreground" : "list.foreground",
+ backgroundColor : states.selected ? "list.selection.background" : "list.background"
+ };
+ }
+ },
+
+ "combo-box-text-field" :
+ {
+ style : function( states ) {
+ return {
+ font : "widget.font",
+ padding : states.rwt_BORDER ? [ 1, 4 ] : [ 0, 3 ],
+ textColor : states.disabled ? "widget.graytext" : "widget.foreground",
+ backgroundColor : "list.background"
+ };
+ }
+ },
+
+ // Used both for ComboBox and ComboBoxEx
+ "combo-box-button" :
+ {
+ style : function( states ) {
+ return {
+ border : "thinOutset",
+ padding : [ 0, 3, 0, 2 ],
+ icon : "widget/arrows/down.gif",
+ // TODO [rst] rather use button.bgcolor?
+ backgroundColor : "widget.background"
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ TREE
+ ---------------------------------------------------------------------------
+ */
+
+ "tree-element" :
+ {
+ style : function( states ) {
+ return {
+ height : 16,
+ verticalChildrenAlign : "middle"
+ };
+ }
+ },
+
+ "tree-element-icon" :
+ {
+ style : function( states ) {
+ return {
+ width : 16,
+ height : 16
+ };
+ }
+ },
+
+ "tree-element-label" :
+ {
+ include : "label",
+
+ style : function( states ) {
+ var result = {
+ cursor : "default",
+ height : 16,
+ padding : 2
+ };
+ if( states.selected ) {
+ if( states.parent_unfocused ) {
+ result.textColor = states.disabled ? "widget.graytext" : "list.selection.unfocused.foreground";
+ result.backgroundColor = "list.selection.unfocused.background";
+ } else {
+ result.textColor = states.disabled ? "widget.graytext" : "list.selection.foreground";
+ result.backgroundColor = "list.selection.background";
+ }
+ } else {
+ result.textColor = states.disabled ? "widget.graytext" : "undefined";
+ result.backgroundColor = "transparent";
+ }
+ return result;
+ }
+ },
+
+ "tree-folder" :
+ {
+ include : "tree-element"
+ },
+
+ "tree-folder-icon" :
+ {
+ include : "tree-element-icon"
+ },
+
+ "tree-folder-label" :
+ {
+ include : "tree-element-label"
+ },
+
+ "tree-container" :
+ {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER
+ ? "control.BORDER.border"
+ : "control.border"
+ };
+ }
+ },
+
+ "tree" :
+ {
+ include : "tree-folder",
+ style : function( states ) {
+ return {
+ verticalChildrenAlign : "top",
+ backgroundColor : "list.background",
+ border : states.rwt_BORDER
+ ? "control.BORDER.border"
+ : "control.border"
+ };
+ }
+ },
+
+ "tree-icon" :
+ {
+ include : "tree-folder-icon"
+ },
+
+ "tree-label" :
+ {
+ include : "tree-folder-label"
+ },
+
+ "tree-check-box" : {
+ include : "image",
+ style : function( states ) {
+ var result = {};
+ if( states.grayed ) {
+ if( states.checked ) {
+ result.source = "widget/table/check_gray_on.gif";
+ } else {
+ result.source = "widget/table/check_gray_off.gif";
+ }
+ } else {
+ if( states.checked ) {
+ result.source = "widget/table/check_white_on.gif";
+ } else {
+ result.source = "widget/table/check_white_off.gif";
+ }
+ }
+ result.marginRight = 3;
+ return result;
+ }
+ },
+
+ "tree-column" : {
+ style : function( states ) {
+ var result = {
+ cursor : "default",
+ paddingLeft : 2,
+ paddingRight : 2,
+ spacing : 2,
+ textColor : states.disabled ? "widget.graytext" : "undefined"
+ };
+ if( states.mouseover && !states.disabled ) {
+ result.backgroundColor = "tree.column.hover.background";
+ result.border = "tree.column.hover.border";
+ } else {
+ result.backgroundColor = "tree.column.background";
+ result.border = "tree.column.border";
+ }
+ if( states.moving ) {
+ result.opacity = 0.6;
+ } else {
+ result.opacity = 1.0;
+ }
+ return result;
+ }
+ },
+
+ "tree-column-resizer" : {
+ style : function( sates ) {
+ return {
+ // TODO [rh] use same bg-color as splitpane-spltter (see there)
+ backgroundColor : "#d6d5d9",
+ width : 3
+ }
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ TAB FOLDER
+ ---------------------------------------------------------------------------
+ */
+
+ "tab-view" :
+ {
+ style : function( states ) {
+ return {
+ textColor : "widget.foreground",
+ font : "widget.font",
+ spacing : -1,
+ border : states.rwt_BORDER
+ ? "control.BORDER.border"
+ : "control.border"
+ };
+ }
+ },
+
+ "tab-view-bar" :
+ {
+ style : function( states ) {
+ return {
+ height : "auto"
+ };
+ }
+ },
+
+ "tab-view-pane" :
+ {
+ style : function( states ) {
+ return {
+// height : "1*",
+ overflow : "hidden",
+ backgroundColor : "widget.background",
+ border : new qx.ui.core.Border(1, "solid", "widget.thinborder"),
+ padding : 10
+ };
+ }
+ },
+
+ "tab-view-page" :
+ {
+// style : function( states ) {
+// return {
+// TODO [rst] disappeared in qx 0.7
+// top : 0,
+// right : 0,
+// bottom : 0,
+// left : 0
+// };
+// }
+ },
+
+ "tab-view-button" :
+ {
+ include : "atom",
+
+ style : function( states ) {
+ var border_top_normal = new qx.ui.core.Border(1, "solid", "widget.thinborder");
+ border_top_normal.setWidthBottom(0);
+
+ var border_top_checked = new qx.ui.core.Border(1, "solid", "widget.thinborder");
+ border_top_checked.setWidthBottom(0);
+ border_top_checked.setTop(3, "solid", "widget.selection-marker");
+
+ var border_bottom_normal = new qx.ui.core.Border(1, "solid", "widget.thinborder");
+ border_bottom_normal.setWidthTop(0);
+
+ var border_bottom_checked = new qx.ui.core.Border(1, "solid", "widget.thinborder");
+ border_bottom_checked.setWidthTop(0);
+ border_bottom_checked.setBottom(3, "solid", "widget.selection-marker");
+
+ var result;
+
+ if( states.checked ) {
+ result = {
+ backgroundColor : "tabfolder.checked.background",
+ zIndex : 1, // TODO [rst] Doesn't this interfere with our z-order?
+ padding : [ 2, 8, 4, 7 ],
+ border : states.barTop ? border_top_checked : border_bottom_checked,
+ margin : [ 0, -1, 0, -2 ]
+ };
+ if( states.alignLeft ) {
+ if( states.firstChild ) {
+ result.paddingLeft = 6;
+ result.paddingRight = 7;
+ result.marginLeft = 0;
+ }
+ } else {
+ if( states.lastChild ) {
+ result.paddingLeft = 8;
+ result.paddingRight = 5;
+ result.marginRight = 0;
+ }
+ }
+ } else {
+ result = {
+ backgroundColor : states.over ? "tabfolder.hover.background" : "tabfolder.background",
+ zIndex : 0, // TODO [rst] Doesn't this interfere with our z-order?
+ padding : [ 2, 6, 2, 5 ],
+ marginRight : 1,
+ marginLeft : 0
+ };
+ if( states.alignLeft ) {
+ if( states.firstChild ) {
+ result.paddingLeft = 6;
+ result.paddingRight = 5;
+ }
+ } else {
+ if( states.lastChild ) {
+ result.paddingLeft = 6;
+ result.paddingRight = 5;
+ result.marginRight = 0;
+ }
+ }
+ if( states.barTop ) {
+ result.border = border_top_normal;
+ result.marginTop = 3;
+ result.marginBottom = 1;
+ } else {
+ result.border = border_bottom_normal;
+ result.marginTop = 1;
+ result.marginBottom = 3;
+ }
+ }
+ result.textColor = states.disabled ? "widget.graytext" : "undefined";
+ return result;
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ GROUP BOX
+ ---------------------------------------------------------------------------
+ */
+
+ "group-box" :
+ {
+ style : function( states ) {
+ return {
+ backgroundColor : "widget.background",
+ border : states.rwt_BORDER
+ ? "control.BORDER.border"
+ : "control.border"
+ };
+ }
+ },
+
+ "group-box-legend" :
+ {
+ include : "atom",
+
+ style : function( states ) {
+ var dimensions = org.eclipse.swt.theme.Dimensions.getInstance();
+ return {
+ top : 0,
+ left : 0,
+ padding : dimensions.get( "group.label.padding" ),
+ margin : dimensions.get( "group.label.margin" ),
+ font : "group.label.font",
+ backgroundColor : "widget.background"
+// TODO [rst] Group label is not grayed out in SWT - check other toolkits
+// textColor : states.disabled ? "widget.graytext" : "undefined"
+ };
+ }
+ },
+
+ "group-box-frame" :
+ {
+ style : function( states ) {
+ return {
+ top : 0,
+ left : 0,
+ right : 0,
+ bottom : 0,
+ margin : org.eclipse.swt.theme.Dimensions.getInstance().get( "group.margin" ),
+ border : "group.frame.border"
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ SPINNER
+ ---------------------------------------------------------------------------
+ */
+
+ "spinner" :
+ {
+ style : function( states ) {
+ return {
+ backgroundColor : "list.background",
+ border : states.rwt_BORDER ? "text.BORDER.border" : "text.border"
+ };
+ }
+ },
+
+ "spinner-text-field" :
+ {
+ style : function( states ) {
+ return {
+ top : 0,
+ left : 0,
+ right : 0,
+ bottom : 0,
+ padding : org.eclipse.swt.theme.Dimensions.getInstance().get( "text.SINGLE.padding" ),
+ textColor : states.disabled ? "widget.graytext" : "undefined"
+ };
+ }
+ },
+
+ "spinner-button" :
+ {
+ style : function( states ) {
+ var result = {
+ width : 16,
+ backgroundColor : "widget.background"
+ };
+ if( states.rwt_FLAT ) {
+ result.border = "undefined";
+ } else if( states.pressed || states.checked || states.abandoned ) {
+ result.border = "inset";
+ } else {
+ result.border = "outset";
+ }
+ return result;
+ }
+ },
+
+ "spinner-button-up" :
+ {
+ include : "spinner-button",
+ style : function( states ) {
+ return {
+ source : "widget/arrows/up_small.gif",
+ padding : [ 0, 3, 1 ]
+ };
+ }
+ },
+
+ "spinner-button-down" :
+ {
+ include : "spinner-button",
+ style : function( states ) {
+ return {
+ source : "widget/arrows/down_small.gif",
+ padding : [ 0, 3, 1 ]
+ };
+ }
+ },
+
+ /*
+ ---------------------------------------------------------------------------
+ TABLE
+ ---------------------------------------------------------------------------
+ */
+
+ "table" : {
+ style : function( states ) {
+ return {
+ backgroundColor : "list.background",
+ textColor : "list.foreground",
+ font : "widget.font",
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border"
+ };
+ }
+ },
+
+ "table-column" : {
+ style : function( states ) {
+ var result = {
+ cursor : "default",
+ paddingLeft : 2,
+ paddingRight : 2,
+ spacing : 2,
+ textColor : states.disabled ? "widget.graytext" : "widget.foreground",
+ opacity : states.moving ? 0.6 : 1.0
+ };
+ if( states.mouseover && !states.disabled ) {
+ result.backgroundColor = "table.column.hover.background";
+ result.border = "table.column.hover.border";
+ } else {
+ result.backgroundColor = "table.column.background";
+ result.border = "table.column.border";
+ }
+ return result;
+ }
+ },
+
+ "table-column-resizer" : {
+ style : function( sates ) {
+ return {
+ width : 3,
+ opacity : 0.3,
+ backgroundColor : "black"
+ }
+ }
+ },
+
+ "table-row" : {
+ style : function( states ) {
+ var result = {
+ cursor : "default",
+ border : states.lines ? "table.row.horizontalLine" : "undefined"
+ };
+ if( states.selected ) {
+ result.textColor = states.disabled
+ ? "widget.graytext"
+ : "list.selection.foreground";
+ result.backgroundColor = states.disabled
+ ? "list.selection.unfocused.background"
+ : "list.selection.background";
+ } else {
+ result.textColor = states.disabled
+ ? "widget.graytext"
+ : "undefined";
+ result.backgroundColor = states.disabled
+ ? "list.background"
+ : "undefined";
+ }
+ return result;
+ }
+ },
+
+ "table-check-box" : {
+ include : "image",
+ style : function( states ) {
+ var result = {};
+ if( states.grayed ) {
+ if( states.checked ) {
+ result.source = "widget/table/check_gray_on.gif";
+ } else {
+ result.source = "widget/table/check_gray_off.gif";
+ }
+ } else {
+ if( states.checked ) {
+ result.source = "widget/table/check_white_on.gif";
+ } else {
+ result.source = "widget/table/check_white_off.gif";
+ }
+ }
+ return result;
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Sash
+
+ "sash" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "inset" : "undefined",
+ cursor : states.disabled ? "undefined"
+ : states.horizontal ? "row-resize"
+ : "col-resize"
+ };
+ }
+ },
+
+ "sash-slider" : {
+ style : function( states ) {
+ return {
+ zIndex : 1e7,
+ opacity : 0.3,
+ backgroundColor : "black"
+ };
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // CTabFolder
+
+ "c-tab-item" : {
+ include: "atom",
+
+ style: function( states ) {
+ var border_top = new qx.ui.core.Border();
+ border_top.setRight( 1, "solid", "#c0c0c0" );
+
+ var border_top_checked = new qx.ui.core.Border();
+ border_top_checked.setRight( 1, "solid", "#c0c0c0" );
+
+ var border_bottom = new qx.ui.core.Border();
+ border_bottom.setRight( 1, "solid", "#c0c0c0" );
+
+ var border_bottom_checked = new qx.ui.core.Border();
+ border_bottom_checked.setRight( 1, "solid", "#c0c0c0" );
+
+ var result = {
+ font : "widget.font",
+ paddingLeft : 4
+ };
+ if( states.selected ) {
+ if( states.barTop ) {
+ result.border = border_top_checked;
+ } else {
+ result.border = border_bottom_checked;
+ }
+ } else {
+ if( states.barTop ) {
+ result.border = border_top;
+ } else {
+ result.border = border_bottom;
+ }
+ }
+ return result;
+ }
+ },
+
+ "c-tab-close-button" :
+ {
+ include : "image",
+
+ style : function( states ) {
+ return {
+ source : states.over
+ ? "widget/ctabfolder/close_hover.gif"
+ : "widget/ctabfolder/close.gif"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Composite
+
+ "composite" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // ScrolledComposite
+
+ "scrolledcomposite" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "shadow" : "control.border"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // CoolBar
+
+ "coolbar" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border"
+ }
+ }
+ },
+
+ "coolitem-handle" : {
+ style : function( states ) {
+ return {
+ width : "100%",
+ border : "thinOutset",
+ margin : [ 1, 2, 1, 0 ],
+ cursor : "w-resize"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Browser
+
+ "browser" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border",
+ backgroundColor : "white"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Label (style SWT.SEPARATOR)
+
+ "separator" : {
+ style : function( states ) {
+ return {
+ border : states.rwt_BORDER ? "thinInset" : "undefined"
+ }
+ }
+ },
+
+ "separator-line" : {
+ style : function( states ) {
+ var result = {};
+ var orient = states.rwt_VERTICAL ? "vertical" : "horizontal";
+ if( states.rwt_SHADOW_IN ) {
+ result.border = "separator.shadowin." + orient + ".border";
+ } else if( states.rwt_SHADOW_OUT ) {
+ result.border = "separator.shadowout." + orient + ".border";
+ } else {
+ result.border = "undefined";
+ }
+ return result;
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Link
+
+ "link" : {
+ style : function( states ) {
+ return {
+ font : "widget.font",
+ border : states.rwt_BORDER ? "control.BORDER.border" : "control.border"
+ }
+ }
+ },
+
+ "link-text" : {
+ style : function( states ) {
+ return {
+ textColor : states.disabled ? "widget.graytext" : "undefined"
+ }
+ }
+ },
+
+ "link-href" : {
+ style : function( states ) {
+ return {
+ cursor : "pointer",
+ textColor : states.disabled ? "widget.graytext" : "link.foreground"
+ }
+ }
+ },
+
+ // ------------------------------------------------------------------------
+ // Progress Bar
+
+ "progressbar" : {
+ style : function( states ) {
+ return {
+ border : "thinInset",
+ backgroundImage : "widget/progressbar.bgimage",
+ backgroundColor : "progressbar.background"
+ }
+ }
+ },
+
+ "progressbar-bar" : {
+ style : function( states ) {
+ return {
+ backgroundImage : "widget/progressbar.fgimage",
+ backgroundColor : "progressbar.foreground"
+ }
+ }
+ },
+
+ "scrollbar-blocker" : {
+ style : function( states ) {
+ return {
+ backgroundColor : "black",
+ opacity : 0.2
+ };
+ }
+ }
+}
+
+} );
diff --git a/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/BordersBase-944351833.js b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/BordersBase-944351833.js
new file mode 100644
index 0000000000..4911f694fd
--- /dev/null
+++ b/tests/org.eclipse.rap.ui.tests.performance/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/org/eclipse/swt/theme/BordersBase-944351833.js
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Innoopract Informationssysteme GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Innoopract Informationssysteme GmbH - initial API and implementation
+ ******************************************************************************/
+
+qx.Theme.define( "org.eclipse.swt.theme.BordersBase",
+{
+ title : "Borders Base Theme",
+
+ borders : {
+
+ "black" :
+ {
+ width : 1,
+ color : "black"
+ },
+
+ "shadow" :
+ {
+ width : 1,
+ color : "widget.shadow"
+ },
+
+ "lightShadow" :
+ {
+ width : 1,
+ color : "widget.lightshadow"
+ },
+
+ // border for tooltips
+ "info" :
+ {
+ width : 1,
+ color : "widget.info.foreground"
+ },
+
+ "inset" :
+ {
+ width : 2,
+ color : [ "widget.shadow", "widget.highlight", "widget.highlight", "widget.shadow" ],
+ innerColor : [ "widget.darkshadow", "widget.lightshadow", "widget.lightshadow", "widget.darkshadow" ]
+ },
+
+ "outset" :
+ {
+ width : 2,
+ color : [ "widget.lightshadow", "widget.darkshadow", "widget.darkshadow", "widget.lightshadow" ],
+ innerColor : [ "widget.highlight", "widget.shadow", "widget.shadow", "widget.highlight" ]
+ },
+
+ "groove" :
+ {
+ width : 2,
+ color : [ "widget.shadow", "widget.highlight", "widget.highlight", "widget.shadow" ],
+ innerColor : [ "widget.highlight", "widget.shadow", "widget.shadow", "widget.highlight" ]
+ },
+
+ "ridge" :
+ {
+ width : 2,
+ color : [ "widget.highlight", "widget.shadow", "widget.shadow", "widget.highlight" ],
+ innerColor : [ "widget.shadow", "widget.highlight", "widget.highlight", "widget.shadow" ]
+ },
+
+ "thinInset" :
+ {
+ width : 1,
+ color : [ "widget.shadow"