Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariot Chauvin2011-06-09 14:35:20 +0000
committerMariot Chauvin2011-06-09 14:35:20 +0000
commit7c27b120465e80a6b4dc7933af995bd2fc794889 (patch)
tree6a8d54efff66bcb5f9605d05755f726c0f079a62
parent9b2c99f1ff3b7bd3db6c5b3f25632acb3385d5ef (diff)
parentfeef09828b212e790ee7edc15dfc6da767b7b8d1 (diff)
downloadorg.eclipse.swtbot-7c27b120465e80a6b4dc7933af995bd2fc794889.tar.gz
org.eclipse.swtbot-7c27b120465e80a6b4dc7933af995bd2fc794889.tar.xz
org.eclipse.swtbot-7c27b120465e80a6b4dc7933af995bd2fc794889.zip
Merge remote branch 'origin/master'
-rw-r--r--examples/gef/org.eclipse.gef.examples.logic.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swt.examples/META-INF/MANIFEST.MF2
-rwxr-xr-xorg.eclipse.swtbot.ant.optional.junit3/META-INF/MANIFEST.MF2
-rwxr-xr-xorg.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.dsl/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/widgets/AbstractSWTBotEclipseTest.java5
-rw-r--r--org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse.gef.finder/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse.gef/feature.xml2
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.test.junit3/feature.xml2
-rw-r--r--org.eclipse.swtbot.eclipse.test.junit4/feature.xml2
-rw-r--r--org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_441
-rw-r--r--org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_52
-rw-r--r--org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_62
-rw-r--r--org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_433
-rw-r--r--org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_56
-rw-r--r--org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_412
-rw-r--r--org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_51
-rw-r--r--org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java (renamed from org.eclipse.swtbot.eclipse.ui/src_eclipse_3.5/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java)0
-rw-r--r--org.eclipse.swtbot.eclipse.ui/src_eclipse_3.4/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java428
-rw-r--r--org.eclipse.swtbot.eclipse/feature.xml6
-rw-r--r--org.eclipse.swtbot.forms.finder.test/.classpath2
-rw-r--r--org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java67
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AllTests.java29
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java90
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java30
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java49
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java23
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java40
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java30
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java30
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java27
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java27
-rw-r--r--org.eclipse.swtbot.forms.finder/.settings/org.moreunit.prefs6
-rw-r--r--org.eclipse.swtbot.forms.finder/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/SWTFormsBot.java324
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/finders/SWTFormsBot.java504
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotExpandableComposite.java59
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotFormText.java76
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotImageHyperlink.java2
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotScrolledFormText.java76
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotSection.java68
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotToggleHyperlink.java77
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTreeNode.java69
-rw-r--r--org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTwistie.java69
-rw-r--r--org.eclipse.swtbot.forms/feature.xml4
-rw-r--r--org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.generator/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/HamcrestFactoryWriter.java85
-rw-r--r--org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/SWTBotGeneratorMain.java3
-rw-r--r--org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/XmlConfigurator.java4
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTBot/additionalMethods3
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTBot/imports19
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTBot/javadoc35
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTFormsBot/additionalMethods0
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTFormsBot/imports13
-rw-r--r--org.eclipse.swtbot.generator/templates/SWTFormsBot/javadoc5
-rw-r--r--org.eclipse.swtbot.generator/widgets-forms.xml4
-rw-r--r--org.eclipse.swtbot.go/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.ide/feature.xml2
-rw-r--r--org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_315
-rw-r--r--org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_52
-rw-r--r--org.eclipse.swtbot.junit4_x/_build.properties.junit4_54
-rw-r--r--org.eclipse.swtbot.junit4_x/_classpath.junit4_51
-rw-r--r--org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java61
-rw-r--r--org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java61
-rw-r--r--org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java (renamed from org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java)0
-rw-r--r--org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java (renamed from org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java)0
-rw-r--r--org.eclipse.swtbot.releng/allElements.xml9
-rw-r--r--org.eclipse.swtbot.releng/build.properties.template4
-rw-r--r--org.eclipse.swtbot.releng/build.xml31
-rw-r--r--org.eclipse.swtbot.releng/check-prerequisites.xml4
-rw-r--r--org.eclipse.swtbot.releng/javadoc.xml7
-rwxr-xr-xorg.eclipse.swtbot.releng/make-release.rb8
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.forms.finder.test.xml76
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml2
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/test.xml6
-rw-r--r--org.eclipse.swtbot.swt.demo/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadioTest.java58
-rw-r--r--org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotToggleButtonTest.java5
-rw-r--r--org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBot.java5
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/FileUtils.java41
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/BrowserAuthenticationListenerDelegate.java84
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotBrowser.java4
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadio.java60
-rw-r--r--org.eclipse.swtbot.test/feature.xml22
-rw-r--r--org.eclipse.swtbot.updatesite/build.xml143
-rw-r--r--org.eclipse.swtbot.updatesite/site.template.org.eclipse.swtbot.featurelist.xml4
-rw-r--r--org.eclipse.swtbot/feature.xml2
-rwxr-xr-x[-rw-r--r--]org.eclipse.ui.forms.examples/.classpath (renamed from org.eclipse.swtbot.junit4_x/_classpath.junit4_3)3
-rwxr-xr-xorg.eclipse.ui.forms.examples/.cvsignore1
-rwxr-xr-xorg.eclipse.ui.forms.examples/.project26
-rwxr-xr-xorg.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.core.prefs53
-rwxr-xr-xorg.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.ui.prefs3
-rwxr-xr-xorg.eclipse.ui.forms.examples/.settings/org.eclipse.pde.prefs12
-rw-r--r--org.eclipse.ui.forms.examples/META-INF/MANIFEST.MF20
-rwxr-xr-xorg.eclipse.ui.forms.examples/about.html22
-rwxr-xr-x[-rw-r--r--]org.eclipse.ui.forms.examples/build.properties (renamed from org.eclipse.swtbot.junit4_x/_build.properties.junit4_3)22
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/clear.gifbin0 -> 545 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/close_view.gifbin0 -> 73 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/container_obj.gifbin0 -> 562 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/e_search_menu.gifbin0 -> 592 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/file_obj.gifbin0 -> 152 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/form_banner.gifbin0 -> 5600 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/help.gifbin0 -> 259 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/help_topic.gifbin0 -> 136 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/large_image.gifbin0 -> 2300 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/linkto_help.gifbin0 -> 618 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/newprj_wiz.gifbin0 -> 2864 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/nw.gifbin0 -> 1210 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/progress.gifbin0 -> 4700 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/sample.gifbin0 -> 983 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/th_horizontal.gifbin0 -> 174 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/th_vertical.gifbin0 -> 217 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/toc_closed.gifbin0 -> 585 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/toc_open.gifbin0 -> 583 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/icons/topic_small.gifbin0 -> 322 bytes
-rwxr-xr-xorg.eclipse.ui.forms.examples/plugin.properties13
-rwxr-xr-xorg.eclipse.ui.forms.examples/plugin.xml106
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPlugin.java150
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPluginResources.properties10
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/FormEditorInput.java69
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/OpenFormEditorAction.java34
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/OpenFormDialog.java31
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java41
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java370
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java185
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/HeadlessPage.java49
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/IModelListener.java24
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NamedObject.java36
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java581
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSimpleFormEditorAction.java25
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSingleHeaderEditorAction.java26
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/PageWithSubPages.java102
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java136
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesPage.java36
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java118
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditor.java84
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditorInput.java25
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleModel.java70
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java137
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java140
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOne.java59
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOneDetailsPage.java186
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwo.java47
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwoDetailsPage.java135
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/index.xml163
-rwxr-xr-x[-rw-r--r--]org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/FormView.java (renamed from org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/FormView.java)27
-rwxr-xr-xorg.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/ShowHelpAction.java56
160 files changed, 4310 insertions, 2401 deletions
diff --git a/examples/gef/org.eclipse.gef.examples.logic.test/META-INF/MANIFEST.MF b/examples/gef/org.eclipse.gef.examples.logic.test/META-INF/MANIFEST.MF
index 947e756d..4605293c 100644
--- a/examples/gef/org.eclipse.gef.examples.logic.test/META-INF/MANIFEST.MF
+++ b/examples/gef/org.eclipse.gef.examples.logic.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: GEF logic SWTBot Test
Bundle-SymbolicName: org.eclipse.gef.examples.logic.test
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.gef.examples.logic,
org.eclipse.swtbot.eclipse.gef.finder,
diff --git a/org.eclipse.swt.examples/META-INF/MANIFEST.MF b/org.eclipse.swt.examples/META-INF/MANIFEST.MF
index 22d5fda5..c613b8e2 100644
--- a/org.eclipse.swt.examples/META-INF/MANIFEST.MF
+++ b/org.eclipse.swt.examples/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Eclipse SWT Example plugin (based on Eclipse's SWT Examples) (incubation)
Bundle-SymbolicName: org.eclipse.swt.examples;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: org.eclipse.swt.examples.addressbook,
diff --git a/org.eclipse.swtbot.ant.optional.junit3/META-INF/MANIFEST.MF b/org.eclipse.swtbot.ant.optional.junit3/META-INF/MANIFEST.MF
index b8bf67c6..fe203293 100755
--- a/org.eclipse.swtbot.ant.optional.junit3/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.ant.optional.junit3/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Headless Ant support for JUnit3 (deprecated), use JUnit4 instead.
Bundle-SymbolicName: org.eclipse.swtbot.ant.optional.junit3
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Fragment-Host: org.apache.ant
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime.compatibility,
diff --git a/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF b/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF
index f866624d..eb048da2 100755
--- a/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Headless Ant support for JUnit4
Bundle-SymbolicName: org.eclipse.swtbot.ant.optional.junit4
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Fragment-Host: org.apache.ant
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime.compatibility,
diff --git a/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
index 68b12766..16feb1b7 100644
--- a/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Test Launcher Application Plug-in
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.core;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.eclipse.core.runtime;version="3.4.0",
diff --git a/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
index c035a2fd..e20702d1 100644
--- a/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Dsl for Eclipse IDE (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.dsl.test
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/org.eclipse.swtbot.eclipse.dsl/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.dsl/META-INF/MANIFEST.MF
index 78f67b90..af3b14df 100644
--- a/org.eclipse.swtbot.eclipse.dsl/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.dsl/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Dsl for Eclipse IDE (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.dsl
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Activator: org.eclipse.swtbot.eclipse.dsl.Activator
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
index 0beb2432..a33fbe02 100644
--- a/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse Control Finder Plug-in Test (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.finder.test;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Require-Bundle: org.eclipse.jface.text,
org.eclipse.core.resources,
org.eclipse.ui,
diff --git a/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/widgets/AbstractSWTBotEclipseTest.java b/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/widgets/AbstractSWTBotEclipseTest.java
index 70242fec..7808f12a 100644
--- a/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/widgets/AbstractSWTBotEclipseTest.java
+++ b/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/widgets/AbstractSWTBotEclipseTest.java
@@ -14,6 +14,7 @@ import java.util.List;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.After;
import org.junit.BeforeClass;
@@ -28,12 +29,12 @@ public abstract class AbstractSWTBotEclipseTest {
private static void closeWelcomePage() {
try {
- System.setProperty("org.eclipse.swtbot.search.timeout", "0");
+ SWTBotPreferences.TIMEOUT = 0;
bot.viewByTitle("Welcome").close();
} catch (WidgetNotFoundException e) {
// do nothing
} finally {
- System.setProperty("org.eclipse.swtbot.search.timeout", "5000");
+ SWTBotPreferences.TIMEOUT = 5000;
}
}
diff --git a/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
index 57c458e2..81921fdf 100644
--- a/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse Control Finder Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.finder;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org - SWTBot
Export-Package: org.eclipse.swtbot.eclipse.finder,
@@ -14,7 +14,7 @@ Export-Package: org.eclipse.swtbot.eclipse.finder,
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Import-Package: javax.swing.text,
- junit.framework;version="4.3.1",
+ junit.framework;version="4.5.0",
org.apache.log4j;version="[1.2.13,1.3.0)",
org.eclipse.core.commands,
org.eclipse.core.commands.common,
diff --git a/org.eclipse.swtbot.eclipse.gef.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.gef.finder/META-INF/MANIFEST.MF
index bc82d15e..44bf6651 100644
--- a/org.eclipse.swtbot.eclipse.gef.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.gef.finder/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Gef Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.gef.finder;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.swtbot.eclipse.gef.finder,
org.eclipse.swtbot.eclipse.gef.finder.finders,
@@ -29,5 +29,5 @@ Import-Package: org.apache.log4j;version="[1.2.13,1.3.0)",
org.eclipse.ui.part,
org.hamcrest;version="1.1.0",
org.hamcrest.core;version="1.1.0",
- org.junit;version="4.3.1"
+ org.junit;version="4.5.0"
Require-Bundle: org.eclipse.swtbot.eclipse.finder;visibility:=reexport
diff --git a/org.eclipse.swtbot.eclipse.gef/feature.xml b/org.eclipse.swtbot.eclipse.gef/feature.xml
index 1e4752d2..bae26d61 100644
--- a/org.eclipse.swtbot.eclipse.gef/feature.xml
+++ b/org.eclipse.swtbot.eclipse.gef/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.eclipse.gef"
label="SWTBot for GEF Testing (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org"
plugin="org.eclipse.swtbot.eclipse.ui">
diff --git a/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF
index a786a106..819afe41 100644
--- a/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Headless JUnit3 Launch Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.junit3.headless;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF
index 120f9185..c989d517 100644
--- a/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Headless JUnit4 Launch Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.junit4.headless;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.swtbot.eclipse.junit4.headless
-Import-Package: junit.framework;version="4.3.0",
+Import-Package: junit.framework;version="4.5.0",
org.apache.tools.ant,
org.apache.tools.ant.taskdefs.optional.junit,
org.eclipse.core.runtime;version="3.4.0",
diff --git a/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
index 2f2ddb58..32000db6 100644
--- a/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse Spy (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.spy;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Activator: org.eclipse.swtbot.eclipse.spy.Activator
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/org.eclipse.swtbot.eclipse.test.junit3/feature.xml b/org.eclipse.swtbot.eclipse.test.junit3/feature.xml
index 01b0ef28..f3377e52 100644
--- a/org.eclipse.swtbot.eclipse.test.junit3/feature.xml
+++ b/org.eclipse.swtbot.eclipse.test.junit3/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.eclipse.test.junit3"
label="SWTBot JUnit 3.x Headless launchers for Eclipse (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org">
<description url="http://eclipse.org/">
diff --git a/org.eclipse.swtbot.eclipse.test.junit4/feature.xml b/org.eclipse.swtbot.eclipse.test.junit4/feature.xml
index 1368c21a..53f1926f 100644
--- a/org.eclipse.swtbot.eclipse.test.junit4/feature.xml
+++ b/org.eclipse.swtbot.eclipse.test.junit4/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.eclipse.test.junit4"
label="SWTBot JUnit 4.x Headless launchers for Eclipse (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org">
<description url="http://eclipse.org/">
diff --git a/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
index 8a5ec925..9c75be5c 100644
--- a/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse Ui Test Plug-in
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.ui.test
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Fragment-Host: org.eclipse.swtbot.eclipse.ui
diff --git a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_4 b/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_4
deleted file mode 100644
index 1ccd28da..00000000
--- a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_4
+++ /dev/null
@@ -1,41 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: SWTBot Eclipse UI Plug-in (incubation)
-Bundle-SymbolicName: org.eclipse.swtbot.eclipse.ui;singleton:=true
-Bundle-Version: 2.0.3.qualifier
-Bundle-Activator: org.eclipse.swtbot.eclipse.ui.Activator
-Bundle-ActivationPolicy: lazy
-Bundle-Vendor: Eclipse.org - SWTBot
-Export-Package: org.eclipse.swtbot.eclipse.ui,
- org.eclipse.swtbot.eclipse.ui.launcher,
- org.eclipse.swtbot.eclipse.ui.preferences,
- org.eclipse.swtbot.eclipse.ui.project,
- org.eclipse.swtbot.eclipse.ui.wizards
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.core.runtime.preferences,
- org.eclipse.debug.core,
- org.eclipse.debug.ui,
- org.eclipse.jdt.core,
- org.eclipse.jdt.junit.launcher,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui,
- org.eclipse.jface.preference,
- org.eclipse.jface.resource,
- org.eclipse.jface.util,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.util,
- org.eclipse.pde.core,
- org.eclipse.pde.core.plugin,
- org.eclipse.pde.internal.core,
- org.eclipse.pde.internal.core.util,
- org.eclipse.pde.internal.ui,
- org.eclipse.pde.internal.ui.launcher,
- org.eclipse.pde.ui.launcher,
- org.eclipse.swt.events,
- org.eclipse.swt.layout,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.plugin
diff --git a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_5 b/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_5
index f2250e67..8e6e8d0b 100644
--- a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_5
+++ b/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_5
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse UI Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.ui;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Activator: org.eclipse.swtbot.eclipse.ui.Activator
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org - SWTBot
diff --git a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_6 b/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_6
index eaa0acc8..8de88814 100644
--- a/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_6
+++ b/org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_6
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Eclipse UI Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.eclipse.ui;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Activator: org.eclipse.swtbot.eclipse.ui.Activator
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org - SWTBot
diff --git a/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_4 b/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_4
deleted file mode 100644
index 19cd495c..00000000
--- a/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_4
+++ /dev/null
@@ -1,33 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Ketan Padegaonkar 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:
-# Ketan Padegaonkar - initial API and implementation
-###############################################################################
-source.. = src/,\
- src_eclipse_3.4/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- LICENSE.EPL,\
- about.html,\
- plugin.xml,\
- feature.gif,\
- src/,\
- intro/,\
- about.ini,\
- about.properties,\
- icons/,\
- src_eclipse_3.4/
-jars.compile.order = .
-src.includes = LICENSE.EPL,\
- about.html,\
- intro/,\
- about.ini,\
- feature.gif,\
- about.properties,\
- icons/
diff --git a/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_5 b/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_5
index ec584f82..cf2cc54c 100644
--- a/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_5
+++ b/org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_5
@@ -8,8 +8,7 @@
# Contributors:
# Ketan Padegaonkar - initial API and implementation
###############################################################################
-source.. = src/,\
- src_eclipse_3.5/
+source.. = src
output.. = bin/
bin.includes = META-INF/,\
.,\
@@ -21,8 +20,7 @@ bin.includes = META-INF/,\
intro/,\
about.ini,\
about.properties,\
- icons/,\
- src_eclipse_3.5/
+ icons/
jars.compile.order = .
src.includes = LICENSE.EPL,\
about.html,\
diff --git a/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_4 b/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_4
deleted file mode 100644
index aaad475d..00000000
--- a/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_4
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src_eclipse_3.4"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_5 b/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_5
index e2f3a559..41098a31 100644
--- a/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_5
+++ b/org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_5
@@ -7,6 +7,5 @@
</accessrules>
</classpathentry>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src_eclipse_3.5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.swtbot.eclipse.ui/src_eclipse_3.5/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java b/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java
index 94260d92..94260d92 100644
--- a/org.eclipse.swtbot.eclipse.ui/src_eclipse_3.5/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java
+++ b/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java
diff --git a/org.eclipse.swtbot.eclipse.ui/src_eclipse_3.4/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java b/org.eclipse.swtbot.eclipse.ui/src_eclipse_3.4/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java
deleted file mode 100644
index 343098d5..00000000
--- a/org.eclipse.swtbot.eclipse.ui/src_eclipse_3.4/org/eclipse/swtbot/eclipse/ui/SWTBotLaunchConfigurationDelegate.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Ketan Padegaonkar 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:
- * Ketan Padegaonkar - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.eclipse.ui;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMRunner;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.PluginRegistry;
-import org.eclipse.pde.core.plugin.TargetPlatform;
-import org.eclipse.pde.internal.core.ClasspathHelper;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.TargetPlatformHelper;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.eclipse.pde.internal.ui.IPDEUIConstants;
-import org.eclipse.pde.internal.ui.PDEPlugin;
-import org.eclipse.pde.internal.ui.PDEUIMessages;
-import org.eclipse.pde.internal.ui.launcher.EclipsePluginValidationOperation;
-import org.eclipse.pde.internal.ui.launcher.LaunchArgumentsHelper;
-import org.eclipse.pde.internal.ui.launcher.LaunchConfigurationHelper;
-import org.eclipse.pde.internal.ui.launcher.LaunchPluginValidator;
-import org.eclipse.pde.internal.ui.launcher.LauncherUtils;
-import org.eclipse.pde.internal.ui.launcher.VMHelper;
-import org.eclipse.pde.ui.launcher.IPDELauncherConstants;
-import org.eclipse.pde.ui.launcher.PDESourcePathProvider;
-
-/**
- * This class is a copy of {@link org.eclipse.pde.ui.launcher.JUnitLaunchConfigurationDelegate} with the
- * {@link #collectExecutionArguments(ILaunchConfiguration, List, List)} modified to use
- * {@value Activator#APPLICATION_ID}. A launch delegate for launching JUnit Plug-in tests.
- *
- * @since 3.3
- */
-@SuppressWarnings("all")
-public class SWTBotLaunchConfigurationDelegate extends org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate {
-
- public static final String LAUNCH_CONFIG_ID = "org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig"; //$NON-NLS-1$
-
- private static String[] REQUIRED_PLUGINS = { "org.junit", "org.eclipse.jdt.junit.runtime", "org.eclipse.pde.junit.runtime" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected File fConfigDir = null;
- private Map fPluginMap;
-
- /** */
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getVMRunner(org.eclipse.debug.core.
- * ILaunchConfiguration, java.lang.String)
- */
- public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode) throws CoreException {
- IVMInstall launcher = VMHelper.createLauncher(configuration);
- return launcher.getVMRunner(mode);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate#verifyMainTypeName(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public String verifyMainTypeName(ILaunchConfiguration configuration) throws CoreException {
- if (TargetPlatformHelper.getTargetVersion() >= 3.3)
- return "org.eclipse.equinox.launcher.Main"; //$NON-NLS-1$
- return "org.eclipse.core.launcher.Main"; //$NON-NLS-1$
- }
-
- private String getTestPluginId(ILaunchConfiguration configuration) throws CoreException {
- IJavaProject javaProject = getJavaProject(configuration);
- IPluginModelBase model = PluginRegistry.findModel(javaProject.getProject());
- if (model == null)
- abort(NLS.bind(PDEUIMessages.JUnitLaunchConfiguration_error_notaplugin, javaProject.getProject().getName()), null, IStatus.OK);
- if (model instanceof IFragmentModel)
- return ((IFragmentModel) model).getFragment().getPluginId();
-
- return model.getPluginBase().getId();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration#abort(java.lang.String,
- * java.lang.Throwable, int)
- */
- protected void abort(String message, Throwable exception, int code) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, code, message, exception));
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate#collectExecutionArguments(org.eclipse.debug.core
- * .ILaunchConfiguration, java.util.List, java.util.List)
- */
- protected void collectExecutionArguments(ILaunchConfiguration configuration, List/* String */vmArguments, List/* String */programArgs)
- throws CoreException {
- super.collectExecutionArguments(configuration, vmArguments, programArgs);
-
- // Specify the JUnit Plug-in test application to launch
- programArgs.add("-application"); //$NON-NLS-1$
- String application = getApplication(configuration);
-
- programArgs.add(application);
-
- // If a product is specified, then add it to the program args
- if (configuration.getAttribute(IPDELauncherConstants.USE_PRODUCT, false)) {
- programArgs.add("-product"); //$NON-NLS-1$
- programArgs.add(configuration.getAttribute(IPDELauncherConstants.PRODUCT, "")); //$NON-NLS-1$
- } else {
- // Specify the application to test
- String defaultApplication = IPDEUIConstants.CORE_TEST_APPLICATION.equals(application) ? null : TargetPlatform
- .getDefaultApplication();
- String testApplication = configuration.getAttribute(IPDELauncherConstants.APP_TO_TEST, defaultApplication);
- if (testApplication != null) {
- programArgs.add("-testApplication"); //$NON-NLS-1$
- programArgs.add(testApplication);
- }
- }
-
- // Specify the location of the runtime workbench
- String targetWorkspace = LaunchArgumentsHelper.getWorkspaceLocation(configuration);
- if (targetWorkspace.length() > 0) {
- programArgs.add("-data"); //$NON-NLS-1$
- programArgs.add(targetWorkspace);
- }
-
- // Create the platform configuration for the runtime workbench
- String productID = LaunchConfigurationHelper.getProductID(configuration);
- LaunchConfigurationHelper.createConfigIniFile(configuration, productID, fPluginMap, getConfigurationDirectory(configuration));
- String brandingId = LaunchConfigurationHelper.getContributingPlugin(productID);
- TargetPlatform.createPlatformConfiguration(getConfigurationDirectory(configuration), (IPluginModelBase[]) fPluginMap.values()
- .toArray(new IPluginModelBase[fPluginMap.size()]), brandingId != null ? (IPluginModelBase) fPluginMap.get(brandingId)
- : null);
- TargetPlatformHelper.checkPluginPropertiesConsistency(fPluginMap, getConfigurationDirectory(configuration));
-
- programArgs.add("-configuration"); //$NON-NLS-1$
- programArgs.add("file:" + new Path(getConfigurationDirectory(configuration).getPath()).addTrailingSeparator().toString()); //$NON-NLS-1$
-
- // Specify the output folder names
- programArgs.add("-dev"); //$NON-NLS-1$
- programArgs.add(ClasspathHelper.getDevEntriesProperties(
- getConfigurationDirectory(configuration).toString() + "/dev.properties", fPluginMap)); //$NON-NLS-1$
-
- // necessary for PDE to know how to load plugins when target platform = host platform
- // see PluginPathFinder.getPluginPaths()
- if (fPluginMap.containsKey(PDECore.PLUGIN_ID))
- programArgs.add("-pdelaunch"); //$NON-NLS-1$
-
- // Create the .options file if tracing is turned on
- if (configuration.getAttribute(IPDELauncherConstants.TRACING, false)
- && !IPDELauncherConstants.TRACING_NONE.equals(configuration.getAttribute(IPDELauncherConstants.TRACING_CHECKED,
- (String) null))) {
- programArgs.add("-debug"); //$NON-NLS-1$
- String path = getConfigurationDirectory(configuration).getPath() + IPath.SEPARATOR + ".options"; //$NON-NLS-1$
- programArgs.add(LaunchArgumentsHelper.getTracingFileArgument(configuration, path));
- }
-
- // add the program args specified by the user
- String[] userArgs = LaunchArgumentsHelper.getUserProgramArgumentArray(configuration);
- for (int i = 0; i < userArgs.length; i++) {
- // be forgiving if people have tracing turned on and forgot
- // to remove the -debug from the program args field.
- if (userArgs[i].equals("-debug") && programArgs.contains("-debug")) //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- programArgs.add(userArgs[i]);
- }
-
- if (!configuration.getAttribute(IPDEUIConstants.APPEND_ARGS_EXPLICITLY, false)) {
- if (!programArgs.contains("-os")) { //$NON-NLS-1$
- programArgs.add("-os"); //$NON-NLS-1$
- programArgs.add(TargetPlatform.getOS());
- }
- if (!programArgs.contains("-ws")) { //$NON-NLS-1$
- programArgs.add("-ws"); //$NON-NLS-1$
- programArgs.add(TargetPlatform.getWS());
- }
- if (!programArgs.contains("-arch")) { //$NON-NLS-1$
- programArgs.add("-arch"); //$NON-NLS-1$
- programArgs.add(TargetPlatform.getOSArch());
- }
- }
-
- programArgs.add("-testpluginname"); //$NON-NLS-1$
- programArgs.add(getTestPluginId(configuration));
- }
-
- private String getApplication(ILaunchConfiguration configuration) {
- return Activator.APPLICATION_ID;
- }
-
- private IPluginModelBase findPlugin(String id) throws CoreException {
- IPluginModelBase model = PluginRegistry.findModel(id);
- if (model == null)
- model = PDECore.getDefault().findPluginInHost(id);
- if (model == null)
- abort(NLS.bind(PDEUIMessages.JUnitLaunchConfiguration_error_missingPlugin, id), null, IStatus.OK);
- return model;
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProgramArguments(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
- return LaunchArgumentsHelper.getUserProgramArguments(configuration);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getVMArguments(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {
- return LaunchArgumentsHelper.getUserVMArguments(configuration);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getEnvironment(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException {
- return DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getClasspath(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
- String[] classpath = LaunchArgumentsHelper.constructClasspath(configuration);
- if (classpath == null)
- abort(PDEUIMessages.WorkbenchLauncherConfigurationDelegate_noStartup, null, IStatus.OK);
- return classpath;
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getWorkingDirectory(org.eclipse.debug.core.
- * ILaunchConfiguration)
- */
- public File getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
- return LaunchArgumentsHelper.getWorkingDirectory(configuration);
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getVMSpecificAttributesMap(org.eclipse.debug
- * .core.ILaunchConfiguration)
- */
- public Map getVMSpecificAttributesMap(ILaunchConfiguration configuration) throws CoreException {
- return LaunchArgumentsHelper.getVMSpecificAttributesMap(configuration);
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#setDefaultSourceLocator(org.eclipse.debug.core
- * .ILaunch, org.eclipse.debug.core.ILaunchConfiguration)
- */
- protected void setDefaultSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException {
- ILaunchConfigurationWorkingCopy wc = null;
- if (configuration.isWorkingCopy())
- wc = (ILaunchConfigurationWorkingCopy) configuration;
- else
- wc = configuration.getWorkingCopy();
- String id = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, (String) null);
- if (!PDESourcePathProvider.ID.equals(id)) {
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, PDESourcePathProvider.ID);
- wc.doSave();
- }
-
- manageLaunch(launch);
- }
-
- /**
- * Returns the location of the configuration area
- *
- * @param configuration the launch configuration
- * @return a directory where the configuration area is located
- */
- protected File getConfigurationDirectory(ILaunchConfiguration configuration) {
- if (fConfigDir == null)
- fConfigDir = LaunchConfigurationHelper.getConfigurationArea(configuration);
- return fConfigDir;
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getBuildOrder(org.eclipse.debug.core.
- * ILaunchConfiguration, java.lang.String)
- */
- protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException {
- return computeBuildOrder(LaunchPluginValidator.getAffectedProjects(configuration));
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProjectsForProblemSearch(org.eclipse.debug
- * .core.ILaunchConfiguration, java.lang.String)
- */
- protected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration, String mode) throws CoreException {
- return LaunchPluginValidator.getAffectedProjects(configuration);
- }
-
- /**
- * Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch
- * terminates.
- *
- * @param launch the launch
- */
- protected void manageLaunch(ILaunch launch) {
- PDEPlugin.getDefault().getLaunchListener().manage(launch);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate#preLaunchCheck(org.eclipse.debug.core.
- * ILaunchConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- // Get the list of plug-ins to run
- fPluginMap = LaunchPluginValidator.getPluginsToRun(configuration);
-
- // implicitly add the plug-ins required for JUnit testing if necessary
- for (int i = 0; i < REQUIRED_PLUGINS.length; i++) {
- String id = REQUIRED_PLUGINS[i];
- if (!fPluginMap.containsKey(id))
- fPluginMap.put(id, findPlugin(id));
- }
-
- boolean autoValidate = configuration.getAttribute(IPDELauncherConstants.AUTOMATIC_VALIDATE, false);
- monitor.beginTask("", autoValidate ? 3 : 4); //$NON-NLS-1$
- if (autoValidate)
- validatePluginDependencies(configuration, new SubProgressMonitor(monitor, 1));
- validateProjectDependencies(configuration, new SubProgressMonitor(monitor, 1));
- clear(configuration, new SubProgressMonitor(monitor, 1));
- launch.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, getConfigurationDirectory(configuration).toString());
- synchronizeManifests(configuration, new SubProgressMonitor(monitor, 1));
- }
-
- /**
- * Checks for old-style plugin.xml files that have become stale since the last launch. For any stale plugin.xml
- * files found, the corresponding MANIFEST.MF is deleted from the runtime configuration area so that it gets
- * regenerated upon startup.
- *
- * @param configuration the launch configuration
- * @param monitor the progress monitor
- */
- protected void synchronizeManifests(ILaunchConfiguration configuration, IProgressMonitor monitor) {
- LaunchConfigurationHelper.synchronizeManifests(configuration, getConfigurationDirectory(configuration));
- monitor.done();
- }
-
- /**
- * Clears the workspace prior to launching if the workspace exists and the option to clear it is turned on. Also
- * clears the configuration area if that option is chosen.
- *
- * @param configuration the launch configuration
- * @param monitor the progress monitor
- * @throws CoreException if unable to retrieve launch attribute values
- * @since 3.3
- */
- protected void clear(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- String workspace = LaunchArgumentsHelper.getWorkspaceLocation(configuration);
- // Clear workspace and prompt, if necessary
- if (!LauncherUtils.clearWorkspace(configuration, workspace, new SubProgressMonitor(monitor, 1))) {
- monitor.setCanceled(true);
- return;
- }
-
- // clear config area, if necessary
- if (configuration.getAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, false))
- CoreUtility.deleteContent(getConfigurationDirectory(configuration));
- }
-
- /**
- * Checks if the Automated Management of Dependencies option is turned on. If so, it makes aure all manifests are
- * updated with the correct dependencies.
- *
- * @param configuration the launch configuration
- * @param monitor a progress monitor
- */
- protected void validateProjectDependencies(ILaunchConfiguration configuration, IProgressMonitor monitor) {
- LauncherUtils.validateProjectDependencies(configuration, monitor);
- }
-
- /**
- * Validates inter-bundle dependencies automatically prior to launching if that option is turned on.
- *
- * @param configuration the launch configuration
- * @param monitor a progress monitor
- */
- protected void validatePluginDependencies(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- EclipsePluginValidationOperation op = new EclipsePluginValidationOperation(configuration);
- LaunchPluginValidator.runValidationOperation(op, monitor);
- }
-}
diff --git a/org.eclipse.swtbot.eclipse/feature.xml b/org.eclipse.swtbot.eclipse/feature.xml
index 939b3b8d..022c2d43 100644
--- a/org.eclipse.swtbot.eclipse/feature.xml
+++ b/org.eclipse.swtbot.eclipse/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.eclipse"
label="SWTBot for Eclipse Testing (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org"
plugin="org.eclipse.swtbot.eclipse.ui">
@@ -26,6 +26,10 @@
id="org.eclipse.swtbot"
version="0.0.0"/>
+ <includes
+ id="org.eclipse.swtbot.forms"
+ version="0.0.0"/>
+
<requires>
<import plugin="org.eclipse.osgi"/>
<import plugin="org.junit4"/>
diff --git a/org.eclipse.swtbot.forms.finder.test/.classpath b/org.eclipse.swtbot.forms.finder.test/.classpath
index ad32c83a..64c5e31b 100644
--- a/org.eclipse.swtbot.forms.finder.test/.classpath
+++ b/org.eclipse.swtbot.forms.finder.test/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
index 98a2deaa..ff6e5253 100644
--- a/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
-#Mon May 03 06:25:00 CDT 2010
+#Tue Mar 01 22:21:58 PST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
index 0f9a263c..d2245dd4 100644
--- a/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Forms Tests
Bundle-SymbolicName: org.eclipse.swtbot.forms.finder.test;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.swt,
org.eclipse.jface,
@@ -17,5 +17,4 @@ Require-Bundle: org.eclipse.swt,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.swtbot.eclipse.finder
-Import-Package: com.ibm.icu.text
Bundle-Vendor: Eclipse SWTBot
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java
deleted file mode 100644
index ffea4527..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test;
-
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swtbot.forms.finder.finders.SWTFormsBot;
-import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
-import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.results.WidgetResult;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-
-
-@RunWith(SWTBotJunit4ClassRunner.class)
-public abstract class AbstractSWTBotFormsTestCase {
-
- public static Display display;
- public static SWTFormsBot bot;
- public static FormView view;
- public static Thread thread;
-
- protected Shell createShell(final String text) {
- return UIThreadRunnable.syncExec(new WidgetResult<Shell>() {
- public Shell run() {
- Shell shell = new Shell(display);
- shell.setText(text);
- shell.setLayout(new GridLayout());
- return shell;
- }
- });
- }
-
- @Before
- public void setUp() {
- display = new Display();
- bot = new SWTFormsBot();
- thread = new Thread("UI Thread") {
- public void run() {
- while ((display != null) && !display.isDisposed())
- if (!display.readAndDispatch())
- display.sleep();
- }
- };
- thread.start();
- Shell shell = createShell("Forms Test");
- view = new FormView(shell);
- shell.open();
- }
-
- @After
- public void tearDown() {
- // TODO
- }
-
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AllTests.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AllTests.java
new file mode 100644
index 00000000..33dd134d
--- /dev/null
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AllTests.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ketan Padegaonkar 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.forms.finder.test;
+
+import org.eclipse.swtbot.forms.finder.test.widgets.SWTBotHyperlinkTest;
+import org.eclipse.swtbot.forms.finder.test.widgets.SWTBotImageHyperlinkTest;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJUnit4Suite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
+ */
+@RunWith(SWTBotJUnit4Suite.class)
+@SuiteClasses({
+ SWTBotHyperlinkTest.class,
+ SWTBotImageHyperlinkTest.class,
+ })
+public class AllTests {
+
+}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java
new file mode 100644
index 00000000..07bf0089
--- /dev/null
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ketan Padegaonkar 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.forms.finder.test.widgets;
+
+import static org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.syncExec;
+
+import java.util.List;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.forms.finder.SWTFormsBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.ActionFactory;
+import org.junit.After;
+import org.junit.BeforeClass;
+
+public abstract class AbstractSWTBotFormsTest {
+
+ protected static SWTFormsBot bot = new SWTFormsBot();
+ protected static SWTWorkbenchBot workbench = new SWTWorkbenchBot();
+
+ @BeforeClass
+ public static void beforeClass() {
+ closeWelcomePage();
+ closeAllViews();
+ showFormsView();
+ }
+
+ private static void showFormsView() {
+ syncExec(new VoidResult() {
+ public void run() {
+ IWorkbenchWindow window = new WorkbenchContentsFinder().activeWorkbenchWindow();
+ try {
+ window.getActivePage().showView("org.eclipse.ui.forms.examples.views.FormView");
+ ActionFactory.MAXIMIZE.create(window).run();
+ } catch (PartInitException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+
+ private static void closeAllViews() {
+ List<SWTBotView> views = workbench.views();
+ for (SWTBotView view : views) {
+ view.close();
+ }
+ }
+
+ private static void closeWelcomePage() {
+ try {
+ SWTBotPreferences.TIMEOUT = 0;
+ System.setProperty("org.eclipse.swtbot.search.timeout", "0");
+ workbench.viewByTitle("Welcome").close();
+ } catch (WidgetNotFoundException e) {
+ // do nothing
+ } finally {
+ SWTBotPreferences.TIMEOUT = 5000;
+ }
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ saveAndCloseAllEditors();
+ }
+
+ /**
+ * @throws WidgetNotFoundException
+ */
+ private void saveAndCloseAllEditors() {
+ List<? extends SWTBotEditor> editors = workbench.editors();
+ for (SWTBotEditor editor : editors) {
+ editor.saveAndClose();
+ }
+ }
+}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java
deleted file mode 100644
index 69712469..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotExpandableComposite;
-import org.junit.Test;
-
-public class SWTBotExpandableCompositeTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findExpandableComposite() throws Exception {
- String title = "Expandable Composite title";
- SWTBotExpandableComposite composite = bot.expandableComposite(title);
- assertNotNull(composite);
- assertEquals(title, composite.getText());
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java
deleted file mode 100644
index 11ba0008..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotFormText;
-import org.junit.Test;
-
-public class SWTBotFormTextTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findsFormText() throws Exception {
- StringBuffer buf = new StringBuffer();
- buf.append("<form>");
- buf.append("<p>");
- buf.append("Here is some plain text for the text to render; ");
- buf.append("this text is at <a href=\"http://www.eclipse.org\" nowrap=\"true\">http://www.eclipse.org</a> web site.");
- buf.append("</p>");
- buf.append("<p>");
- buf.append("<span color=\"header\" font=\"header\">This text is in header font and color.</span>");
- buf.append("</p>");
- buf.append("<p>This line will contain some <b>bold</b> and some <span font=\"code\">source</span> text. ");
- buf.append("We can also add <img href=\"image\"/> an image. ");
- buf.append("</p>");
- buf.append("<li>A default (bulleted) list item.</li>");
- buf.append("<li>Another bullet list item.</li>");
- buf.append("<li style=\"text\" value=\"1.\">A list item with text.</li>");
- buf.append("<li style=\"text\" value=\"2.\">Another list item with text</li>");
- buf.append("<li style=\"image\" value=\"image\">List item with an image bullet</li>");
- buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"3.\">A list item with text.</li>");
- buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"4.\">A list item with text.</li>");
- buf.append("<p> leading blanks; more white \n\n new lines <br/><br/><br/> \n more <b> bb </b> white . </p>");
- buf.append("</form>");
- SWTBotFormText text = bot.formText();
- assertNotNull(text);
- System.out.println(text.widget.getSelectionText());
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
index 25a59ffd..78f08013 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
@@ -10,20 +10,33 @@
*******************************************************************************/
package org.eclipse.swtbot.forms.finder.test.widgets;
+import static org.eclipse.swtbot.swt.finder.SWTBotAssert.assertMatchesRegex;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withRegex;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink;
+import org.eclipse.ui.forms.widgets.Hyperlink;
import org.junit.Test;
-public class SWTBotHyperlinkTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotHyperlinkTest extends AbstractSWTBotFormsTest {
@Test
public void findHyperlink() throws Exception {
- SWTBotHyperlink link = bot.hyperlink();
+ String text = "This is an example of a form that is much longer and will need to wrap.";
+ SWTBotHyperlink link = bot.hyperlink(text);
assertNotNull(link);
- assertEquals("This is an example of a form that is much longer and will need to wrap.", link.getText());
+ assertEquals(text, link.getText());
+ assertEquals(Hyperlink.class, link.widget.getClass());
}
-
+
+ @Test
+ public void canFindHyperlinkWithRegex() throws Exception {
+ String text = "example of a form .* is much longer";
+ SWTBotHyperlink link = new SWTBotHyperlink((Hyperlink) bot.widget(withRegex(text)));
+ assertNotNull(link);
+ assertMatchesRegex(text, link.getText());
+ assertEquals(Hyperlink.class, link.widget.getClass());
+ }
+
}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
index 1e1e2d30..62d1cc8a 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
@@ -10,20 +10,52 @@
*******************************************************************************/
package org.eclipse.swtbot.forms.finder.test.widgets;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withRegex;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.junit.Test;
-public class SWTBotImageHyperlinkTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotImageHyperlinkTest extends AbstractSWTBotFormsTest {
@Test
- public void findImageHyperlink() throws Exception {
- SWTBotImageHyperlink link = bot.imageHyperlink("Image link with no image");
+ public void findImageHyperlinkWithNoImage() throws Exception {
+ String text = "Image link with no image";
+ SWTBotImageHyperlink link = bot.imageHyperlink(text);
+ assertNotNull(link);
+ assertEquals(text, link.getText());
+ assertEquals(ImageHyperlink.class, link.widget.getClass());
+ }
+
+ @Test
+ public void canFindImageHyperlinkWithNoImageByRegex() throws Exception {
+ String text = "link with no";
+ SWTBotImageHyperlink link = new SWTBotImageHyperlink((ImageHyperlink) bot.widget(withRegex(text)));
+
assertNotNull(link);
assertEquals("Image link with no image", link.getText());
+ assertEquals(ImageHyperlink.class, link.widget.getClass());
+ }
+
+
+ @Test
+ public void findImageHyperlinkWithImage() throws Exception {
+ String text = "Link with image and text";
+ SWTBotImageHyperlink link = bot.imageHyperlink(text);
+ assertNotNull(link);
+ assertEquals(text, link.getText());
+ assertEquals(ImageHyperlink.class, link.widget.getClass());
}
+ @Test
+ public void canFindImageHyperlinkWithImageByRegex() throws Exception {
+ String text = "with image";
+ SWTBotImageHyperlink link = new SWTBotImageHyperlink((ImageHyperlink) bot.widget(withRegex(text)));
+
+ assertNotNull(link);
+ assertEquals("Link with image and text", link.getText());
+ assertEquals(ImageHyperlink.class, link.widget.getClass());
+ }
}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java
deleted file mode 100644
index 6c4651d2..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotScrolledFormText;
-import org.junit.Test;
-
-public class SWTBotScrolledFormTextTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findsScrolledFormText() throws Exception {
- String title = "Hello, Eclipse Forms";
- SWTBotScrolledFormText text = bot.scrolledFormText();
- assertNotNull(text);
- text.setFocus();
- System.out.println(text.widget.getFormText().getSelectionText());
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java
deleted file mode 100644
index 9c8fbbea..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotSection;
-import org.junit.Test;
-
-public class SWTBotSectionTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findSection() throws Exception {
- String title = "Section title";
- SWTBotSection section = bot.section(title);
- assertNotNull(section);
- assertEquals(title, section.getText());
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java
deleted file mode 100644
index 1e2bbf7c..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotTreeNode;
-import org.junit.Test;
-
-public class SWTBotTreeNodeTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findTreeNode() throws Exception {
- SWTBotTreeNode node = bot.treeNode();
- assertNotNull(node);
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java
deleted file mode 100644
index 311894e9..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test.widgets;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotTwistie;
-import org.junit.Test;
-
-public class SWTBotTwistieTest extends AbstractSWTBotFormsTestCase {
-
- @Test
- public void findTwistie() throws Exception {
- SWTBotTwistie twistie = bot.twistie();
- assertNotNull(twistie);
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/.settings/org.moreunit.prefs b/org.eclipse.swtbot.forms.finder/.settings/org.moreunit.prefs
new file mode 100644
index 00000000..cf129735
--- /dev/null
+++ b/org.eclipse.swtbot.forms.finder/.settings/org.moreunit.prefs
@@ -0,0 +1,6 @@
+#Tue Mar 01 21:55:27 PST 2011
+eclipse.preferences.version=1
+org.moreunit.prefixes=
+org.moreunit.test_type=junit4
+org.moreunit.unitsourcefolder=org.eclipse.swtbot.forms.finder\:src\:org.eclipse.swtbot.forms.finder.test\:src
+org.moreunit.useprojectsettings=true
diff --git a/org.eclipse.swtbot.forms.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.forms.finder/META-INF/MANIFEST.MF
index cd3b9247..438ad17e 100644
--- a/org.eclipse.swtbot.forms.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.forms.finder/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.swtbot.forms.finder
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.swtbot.swt.finder
Import-Package: org.apache.log4j;version="[1.2.13,1.3.0)",
@@ -15,7 +15,7 @@ Import-Package: org.apache.log4j;version="[1.2.13,1.3.0)",
org.eclipse.ui.forms.events,
org.eclipse.ui.forms.widgets,
org.hamcrest;version="1.1.0"
-Export-Package: org.eclipse.swtbot.forms.finder.finders,
+Export-Package: org.eclipse.swtbot.forms.finder,
org.eclipse.swtbot.forms.finder.widgets
Bundle-Vendor: Eclipse SWTBot
Bundle-Name: SWTBot Forms (Incubation)
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/SWTFormsBot.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/SWTFormsBot.java
new file mode 100644
index 00000000..f4605f7d
--- /dev/null
+++ b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/SWTFormsBot.java
@@ -0,0 +1,324 @@
+// Generated source. DO NOT MODIFY.
+// To add new widgets, please see README file in the generator plugin.
+package org.eclipse.swtbot.forms.finder;
+
+
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink;
+import org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder;
+import org.eclipse.swtbot.swt.finder.finders.ControlFinder;
+import org.eclipse.swtbot.swt.finder.finders.Finder;
+import org.eclipse.swtbot.swt.finder.finders.MenuFinder;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+import org.hamcrest.Matcher;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.inGroup;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
+
+
+/**
+ * SWTFormsBot is a {@link SWTBot} with capabilities for testing eclipse forms.
+ *
+ * @see {@link SWTBot} - SWTBot for usage examples.
+ */
+public class SWTFormsBot extends SWTBot {
+
+ /**
+ * Constructs a bot.
+ */
+ public SWTFormsBot() {
+ this(new ControlFinder(), new MenuFinder());
+ }
+
+ /**
+ * Constructs a bot that will match the contents of the given parentWidget.
+ *
+ * @param parent the parent
+ */
+ public SWTFormsBot(Widget parent) {
+ this(new ChildrenControlFinder(parent), new MenuFinder());
+ }
+ /**
+ * Constructs an instance of the bot using the given control finder and menu finder.
+ *
+ * @param controlFinder the {@link ControlFinder} used to identify and find controls.
+ * @param menuFinder the {@link MenuFinder} used to find menu items.
+ */
+ public SWTFormsBot(ControlFinder controlFinder, MenuFinder menuFinder) {
+ this(new Finder(controlFinder, menuFinder));
+ }
+
+ /**
+ * Constructs a bot with the given finder.
+ *
+ * @param finder the finder.
+ */
+ public SWTFormsBot(Finder finder) {
+ super(finder);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlink(String mnemonicText) {
+ return hyperlink(mnemonicText, 0);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlink(String mnemonicText, int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class), withMnemonic(mnemonicText));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param key the key set on the widget.
+ * @param value the value for the key.
+ * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlinkWithId(String key, String value) {
+ return hyperlinkWithId(key, value, 0);
+ }
+
+ /**
+ * @param key the key set on the widget.
+ * @param value the value for the key.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlinkWithId(String key, String value, int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(key, value));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
+ * @return a {@link SWTBotHyperlink} with the specified <code>value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlinkWithId(String value) {
+ return hyperlinkWithId(value, 0);
+ }
+
+ /**
+ * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlinkWithId(String value, int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(value));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param inGroup the inGroup on the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlinkInGroup(String inGroup) {
+ return hyperlinkInGroup(inGroup, 0);
+ }
+
+ /**
+ * @param inGroup the inGroup on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlinkInGroup(String inGroup, int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class), inGroup(inGroup));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @return a {@link SWTBotHyperlink} with the specified <code>none</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlink() {
+ return hyperlink(0);
+ }
+
+ /**
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>none</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlink(int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param inGroup the inGroup on the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotHyperlink hyperlinkInGroup(String mnemonicText, String inGroup) {
+ return hyperlinkInGroup(mnemonicText, inGroup, 0);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param inGroup the inGroup on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotHyperlink hyperlinkInGroup(String mnemonicText, String inGroup, int index) {
+ Matcher matcher = allOf(widgetOfType(Hyperlink.class), withMnemonic(mnemonicText), inGroup(inGroup));
+ return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlink(String mnemonicText) {
+ return imageHyperlink(mnemonicText, 0);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlink(String mnemonicText, int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withMnemonic(mnemonicText));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param key the key set on the widget.
+ * @param value the value for the key.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value) {
+ return imageHyperlinkWithId(key, value, 0);
+ }
+
+ /**
+ * @param key the key set on the widget.
+ * @param value the value for the key.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value, int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(key, value));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlinkWithId(String value) {
+ return imageHyperlinkWithId(value, 0);
+ }
+
+ /**
+ * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlinkWithId(String value, int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(value));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param inGroup the inGroup on the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlinkInGroup(String inGroup) {
+ return imageHyperlinkInGroup(inGroup, 0);
+ }
+
+ /**
+ * @param inGroup the inGroup on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlinkInGroup(String inGroup, int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), inGroup(inGroup));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlink() {
+ return imageHyperlink(0);
+ }
+
+ /**
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlink(int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param inGroup the inGroup on the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ public SWTBotImageHyperlink imageHyperlinkInGroup(String mnemonicText, String inGroup) {
+ return imageHyperlinkInGroup(mnemonicText, inGroup, 0);
+ }
+
+ /**
+ * @param mnemonicText the mnemonicText on the widget.
+ * @param inGroup the inGroup on the widget.
+ * @param index the index of the widget.
+ * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>.
+ * @throws WidgetNotFoundException if the widget is not found or is disposed.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public SWTBotImageHyperlink imageHyperlinkInGroup(String mnemonicText, String inGroup, int index) {
+ Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withMnemonic(mnemonicText), inGroup(inGroup));
+ return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
+ }
+
+
+
+}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/finders/SWTFormsBot.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/finders/SWTFormsBot.java
deleted file mode 100644
index ab2c0b02..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/finders/SWTFormsBot.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.finders;
-
-import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
-import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
-import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId;
-import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
-
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotExpandableComposite;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotFormText;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotScrolledFormText;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotSection;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotTreeNode;
-import org.eclipse.swtbot.forms.finder.widgets.SWTBotTwistie;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder;
-import org.eclipse.swtbot.swt.finder.finders.ControlFinder;
-import org.eclipse.swtbot.swt.finder.finders.MenuFinder;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-import org.eclipse.ui.forms.widgets.ScrolledFormText;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TreeNode;
-import org.eclipse.ui.forms.widgets.Twistie;
-import org.hamcrest.Matcher;
-
-/**
- * SWTFormsBot is a {@link SWTBot} with capabilities for testing Eclipse forms.
- *
- * @author Chris Aniszczyk <caniszczyk@gmail.com>
- * @version $Id$
- */
-public class SWTFormsBot extends SWTBot {
-
- public SWTFormsBot() {
- super(new ControlFinder(), new MenuFinder());
- }
-
- /**
- * Constructs a bot that will match the contents of the given parentWidget.
- *
- * @param parent the parent
- */
- public SWTFormsBot(Widget parent) {
- super(new ChildrenControlFinder(parent), new MenuFinder());
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>.
- */
- public SWTBotHyperlink hyperlink(String mnemonicText) {
- return hyperlink(mnemonicText, 0);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @param index the index of the widget.
- * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotHyperlink hyperlink(String mnemonicText, int index) {
- Matcher matcher = allOf(widgetOfType(Hyperlink.class), withMnemonic(mnemonicText));
- return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>.
- */
- public SWTBotHyperlink hyperlinkWithId(String key, String value) {
- return hyperlinkWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotHyperlink hyperlinkWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(key, value));
- return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotHyperlink} with the specified <code>value</code>.
- */
- public SWTBotHyperlink hyperlinkWithId(String value) {
- return hyperlinkWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotHyperlink} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotHyperlink hyperlinkWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(value));
- return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
- }
-
-
- /**
- * @return a {@link SWTBotHyperlink} with the specified <code>none</code>.
- */
- public SWTBotHyperlink hyperlink() {
- return hyperlink(0);
- }
-
- /**
- * @param index the index of the widget.
- * @return a {@link SWTBotHyperlink} with the specified <code>none</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotHyperlink hyperlink(int index) {
- Matcher matcher = allOf(widgetOfType(Hyperlink.class));
- return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>.
- */
- public SWTBotImageHyperlink imageHyperlink(String mnemonicText) {
- return imageHyperlink(mnemonicText, 0);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @param index the index of the widget.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotImageHyperlink imageHyperlink(String mnemonicText, int index) {
- Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withMnemonic(mnemonicText));
- return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>.
- */
- public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value) {
- return imageHyperlinkWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(key, value));
- return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>.
- */
- public SWTBotImageHyperlink imageHyperlinkWithId(String value) {
- return imageHyperlinkWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotImageHyperlink imageHyperlinkWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(value));
- return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
- }
-
-
- /**
- * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>.
- */
- public SWTBotImageHyperlink imageHyperlink() {
- return imageHyperlink(0);
- }
-
- /**
- * @param index the index of the widget.
- * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotImageHyperlink imageHyperlink(int index) {
- Matcher matcher = allOf(widgetOfType(ImageHyperlink.class));
- return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>mnemonicText</code>.
- */
- public SWTBotExpandableComposite expandableComposite(String mnemonicText) {
- return expandableComposite(mnemonicText, 0);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @param index the index of the widget.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>mnemonicText</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotExpandableComposite expandableComposite(String mnemonicText, int index) {
- Matcher matcher = allOf(widgetOfType(ExpandableComposite.class), withMnemonic(mnemonicText));
- return new SWTBotExpandableComposite((ExpandableComposite) widget(matcher, index), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>key/value</code>.
- */
- public SWTBotExpandableComposite expandableCompositeWithId(String key, String value) {
- return expandableCompositeWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotExpandableComposite expandableCompositeWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(ExpandableComposite.class), withId(key, value));
- return new SWTBotExpandableComposite((ExpandableComposite) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>value</code>.
- */
- public SWTBotExpandableComposite expandableCompositeWithId(String value) {
- return expandableCompositeWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotExpandableComposite} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotExpandableComposite expandableCompositeWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(ExpandableComposite.class), withId(value));
- return new SWTBotExpandableComposite((ExpandableComposite) widget(matcher, index), matcher);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @return a {@link SWTBotSection} with the specified <code>mnemonicText</code>.
- */
- public SWTBotSection section(String mnemonicText) {
- return section(mnemonicText, 0);
- }
-
- /**
- * @param mnemonicText the mnemonicText on the widget.
- * @param index the index of the widget.
- * @return a {@link SWTBotSection} with the specified <code>mnemonicText</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotSection section(String mnemonicText, int index) {
- Matcher matcher = allOf(widgetOfType(Section.class), withMnemonic(mnemonicText));
- return new SWTBotSection((Section) widget(matcher, index), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotSection} with the specified <code>key/value</code>.
- */
- public SWTBotSection sectionWithId(String key, String value) {
- return sectionWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotSection} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotSection sectionWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(Section.class), withId(key, value));
- return new SWTBotSection((Section) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotSection} with the specified <code>value</code>.
- */
- public SWTBotSection sectionWithId(String value) {
- return sectionWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotSection} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotSection sectionWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(Section.class), withId(value));
- return new SWTBotSection((Section) widget(matcher, index), matcher);
- }
-
- /**
- * @return a {@link SWTBotFormText}.
- */
- public SWTBotFormText formText() {
- Matcher matcher = allOf(widgetOfType(FormText.class));
- return new SWTBotFormText((FormText) widget(matcher, 0), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotFormText} with the specified <code>key/value</code>.
- */
- public SWTBotFormText formTextWithId(String key, String value) {
- return formTextWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotFormText} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotFormText formTextWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(FormText.class), withId(key, value));
- return new SWTBotFormText((FormText) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotFormText} with the specified <code>value</code>.
- */
- public SWTBotFormText formTextWithId(String value) {
- return formTextWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotFormText} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotFormText formTextWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(FormText.class), withId(value));
- return new SWTBotFormText((FormText) widget(matcher, index), matcher);
- }
-
- /**
- * @return a {@link SWTBotScrolledFormText}.
- */
- public SWTBotScrolledFormText scrolledFormText() {
- Matcher matcher = allOf(widgetOfType(ScrolledFormText.class));
- return new SWTBotScrolledFormText((ScrolledFormText) widget(matcher, 0), matcher);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @return a {@link SWTBotScrolledFormText} with the specified <code>key/value</code>.
- */
- public SWTBotScrolledFormText scrolledFormTextWithId(String key, String value) {
- return scrolledFormTextWithId(key, value, 0);
- }
-
- /**
- * @param key the key set on the widget.
- * @param value the value for the key.
- * @param index the index of the widget.
- * @return a {@link SWTBotScrolledFormText} with the specified <code>key/value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotScrolledFormText scrolledFormTextWithId(String key, String value, int index) {
- Matcher matcher = allOf(widgetOfType(ScrolledFormText.class), withId(key, value));
- return new SWTBotScrolledFormText((ScrolledFormText) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotScrolledFormText} with the specified <code>value</code>.
- */
- public SWTBotScrolledFormText scrolledFormTextWithId(String value) {
- return scrolledFormTextWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotScrolledFormText} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotScrolledFormText scrolledFormTextWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(ScrolledFormText.class), withId(value));
- return new SWTBotScrolledFormText((ScrolledFormText) widget(matcher, index), matcher);
- }
-
- /**
- * @return a {@link SWTBotTwistie} with the specified <code>none</code>.
- */
- public SWTBotTwistie twistie() {
- return twistie(0);
- }
-
- /**
- * @param index the index of the widget.
- * @return a {@link SWTBotTwistie} with the specified <code>none</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotTwistie twistie(int index) {
- Matcher matcher = allOf(widgetOfType(Twistie.class));
- return new SWTBotTwistie((Twistie) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotTwistie} with the specified <code>value</code>.
- */
- public SWTBotTwistie twistieWithId(String value) {
- return twistieWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotTwistie} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotTwistie twistieWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(Twistie.class), withId(value));
- return new SWTBotTwistie((Twistie) widget(matcher, index), matcher);
- }
-
- // TODO
-
- /**
- * @return a {@link SWTBotTreeNode} with the specified <code>none</code>.
- */
- public SWTBotTreeNode treeNode() {
- return treeNode(0);
- }
-
- /**
- * @param index the index of the widget.
- * @return a {@link SWTBotTreeNode} with the specified <code>none</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotTreeNode treeNode(int index) {
- Matcher matcher = allOf(widgetOfType(TreeNode.class));
- return new SWTBotTreeNode((TreeNode) widget(matcher, index), matcher);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @return a {@link SWTBotTreeNode} with the specified <code>value</code>.
- */
- public SWTBotTreeNode treeNodeWithId(String value) {
- return treeNodeWithId(value, 0);
- }
-
- /**
- * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}.
- * @param index the index of the widget.
- * @return a {@link SWTBotTreeNode} with the specified <code>value</code>.
- */
- @SuppressWarnings("unchecked")
- public SWTBotTreeNode treeNodeWithId(String value, int index) {
- Matcher matcher = allOf(widgetOfType(TreeNode.class), withId(value));
- return new SWTBotTreeNode((TreeNode) widget(matcher, index), matcher);
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotExpandableComposite.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotExpandableComposite.java
deleted file mode 100644
index 0a2efc18..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotExpandableComposite.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.BoolResult;
-import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link ExpandableComposite} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = ExpandableComposite.class, preferredName = "expandableComposite", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotExpandableComposite extends AbstractSWTBotControl<ExpandableComposite> {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotExpandableComposite(ExpandableComposite w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotExpandableComposite(ExpandableComposite w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- public boolean isExpanded() {
- return syncExec(new BoolResult() {
- public Boolean run() {
- return widget.isExpanded();
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotFormText.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotFormText.java
deleted file mode 100644
index b8ebc2dc..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotFormText.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.StringResult;
-import org.eclipse.swtbot.swt.finder.results.VoidResult;
-import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link FormText} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = FormText.class, preferredName = "formText", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotFormText extends AbstractSWTBotControl<FormText> {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotFormText(FormText w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotFormText(FormText w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- public String selectionText() {
- return syncExec(new StringResult() {
- public String run() {
- return widget.getSelectionText();
- }
- });
- }
-
- public String selectedLinkText() {
- return syncExec(new StringResult() {
- public String run() {
- return widget.getSelectedLinkText();
- }
- });
- }
-
- public void setText(final String text, final boolean parseTags, final boolean expandURLs) {
- syncExec(new VoidResult() {
- public void run() {
- widget.setText(text, parseTags, expandURLs);
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotImageHyperlink.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotImageHyperlink.java
index d6227019..742ae730 100644
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotImageHyperlink.java
+++ b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotImageHyperlink.java
@@ -34,7 +34,7 @@ import org.hamcrest.SelfDescribing;
* @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
* @version $Id$
*/
-@SWTBotWidget(clasz = ImageHyperlink.class, preferredName = "imagehyperlink", referenceBy = { ReferenceBy.MNEMONIC })
+@SWTBotWidget(clasz = ImageHyperlink.class, preferredName = "imageHyperlink", referenceBy = { ReferenceBy.MNEMONIC })
public class SWTBotImageHyperlink extends AbstractSWTBotControl<ImageHyperlink> {
/**
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotScrolledFormText.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotScrolledFormText.java
deleted file mode 100644
index db1fe7e1..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotScrolledFormText.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.StringResult;
-import org.eclipse.swtbot.swt.finder.results.VoidResult;
-import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
-import org.eclipse.ui.forms.widgets.ScrolledFormText;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link ScrolledFormText} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = ScrolledFormText.class, preferredName = "scrolledFormText", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotScrolledFormText extends AbstractSWTBotControl<ScrolledFormText> {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotScrolledFormText(ScrolledFormText w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotScrolledFormText(ScrolledFormText w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- public String selectionText() {
- return syncExec(new StringResult() {
- public String run() {
- return widget.getFormText().getSelectionText();
- }
- });
- }
-
- public String selectedLinkText() {
- return syncExec(new StringResult() {
- public String run() {
- return widget.getFormText().getSelectedLinkText();
- }
- });
- }
-
- public void setText(final String text, final boolean parseTags, final boolean expandURLs) {
- syncExec(new VoidResult() {
- public void run() {
- widget.getFormText().setText(text, parseTags, expandURLs);
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotSection.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotSection.java
deleted file mode 100644
index 258523c3..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotSection.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.BoolResult;
-import org.eclipse.swtbot.swt.finder.results.StringResult;
-import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
-import org.eclipse.ui.forms.widgets.Section;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link Section} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = Section.class, preferredName = "section", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotSection extends AbstractSWTBotControl<Section> {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotSection(Section w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotSection(Section w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- public String description() {
- return syncExec(new StringResult() {
- public String run() {
- return widget.getDescription();
- }
- });
- }
-
- public boolean isExpanded() {
- return syncExec(new BoolResult() {
- public Boolean run() {
- return widget.isExpanded();
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotToggleHyperlink.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotToggleHyperlink.java
deleted file mode 100644
index 3b7777db..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotToggleHyperlink.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.BoolResult;
-import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
-import org.eclipse.ui.forms.widgets.ToggleHyperlink;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link ToggleHyperlink} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-public abstract class SWTBotToggleHyperlink extends AbstractSWTBotControl<ToggleHyperlink> {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotToggleHyperlink(ToggleHyperlink w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotToggleHyperlink(ToggleHyperlink w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- /**
- * Click on the hyperlink.
- *
- * @since 1.0
- */
- public abstract SWTBotToggleHyperlink click();
-
- protected void sendNotifications() {
- notify(SWT.MouseEnter);
- notify(SWT.MouseMove);
- notify(SWT.Activate);
- notify(SWT.MouseDown);
- notify(SWT.MouseUp);
- notify(SWT.Selection);
- notify(SWT.MouseHover);
- notify(SWT.MouseMove);
- notify(SWT.MouseExit);
- notify(SWT.Deactivate);
- notify(SWT.FocusOut);
- }
- public boolean isExpanded() {
- return syncExec(new BoolResult() {
- public Boolean run() {
- return widget.isExpanded();
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTreeNode.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTreeNode.java
deleted file mode 100644
index 31e96766..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTreeNode.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.VoidResult;
-import org.eclipse.swtbot.swt.finder.utils.MessageFormat;
-import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
-import org.eclipse.ui.forms.widgets.TreeNode;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link TreeNode} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = TreeNode.class, preferredName = "treeNode", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotTreeNode extends SWTBotToggleHyperlink {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotTreeNode(TreeNode w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotTreeNode(TreeNode w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- @Override
- public SWTBotToggleHyperlink click() {
- log.debug(MessageFormat.format("Clicking on {0}", SWTUtils.getText(widget))); //$NON-NLS-1$
- internalToggle();
- sendNotifications();
- log.debug(MessageFormat.format("Clicked on {0}", SWTUtils.getText(widget))); //$NON-NLS-1$
- return this;
- }
-
- private void internalToggle() {
- syncExec(new VoidResult() {
- public void run() {
- widget.setExpanded(!widget.isExpanded());
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTwistie.java b/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTwistie.java
deleted file mode 100644
index 724e95ce..00000000
--- a/org.eclipse.swtbot.forms.finder/src/org/eclipse/swtbot/forms/finder/widgets/SWTBotTwistie.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.widgets;
-
-import org.eclipse.swtbot.swt.finder.ReferenceBy;
-import org.eclipse.swtbot.swt.finder.SWTBotWidget;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.results.VoidResult;
-import org.eclipse.swtbot.swt.finder.utils.MessageFormat;
-import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
-import org.eclipse.ui.forms.widgets.Twistie;
-import org.hamcrest.SelfDescribing;
-
-/**
- * This represents a {@link Twistie} widget.
- *
- * @author Chris Aniszczyk &lt;caniszczyk [at] gmail [dot] com&gt;
- * @version $Id$
- */
-@SWTBotWidget(clasz = Twistie.class, preferredName = "twistie", referenceBy = { ReferenceBy.TEXT })
-public class SWTBotTwistie extends SWTBotToggleHyperlink {
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotTwistie(Twistie w) throws WidgetNotFoundException {
- super(w);
- }
-
- /**
- * Constructs a new instance with the given widget.
- *
- * @param w the widget.
- * @param description the description of the widget, this will be reported by {@link #toString()}
- * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
- */
- public SWTBotTwistie(Twistie w, SelfDescribing description) throws WidgetNotFoundException {
- super(w, description);
- }
-
- @Override
- public SWTBotToggleHyperlink click() {
- log.debug(MessageFormat.format("Clicking on {0}", SWTUtils.getText(widget))); //$NON-NLS-1$
- internalToggle();
- sendNotifications();
- log.debug(MessageFormat.format("Clicked on {0}", SWTUtils.getText(widget))); //$NON-NLS-1$
- return this;
- }
-
- private void internalToggle() {
- syncExec(new VoidResult() {
- public void run() {
- widget.setExpanded(!widget.isExpanded());
- }
- });
- }
-
-}
diff --git a/org.eclipse.swtbot.forms/feature.xml b/org.eclipse.swtbot.forms/feature.xml
index 23ae1df7..b59b5c4c 100644
--- a/org.eclipse.swtbot.forms/feature.xml
+++ b/org.eclipse.swtbot.forms/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.forms"
label="SWTBot for Eclipse Forms Testing (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org"
plugin="org.eclipse.swtbot.eclipse.ui">
@@ -23,7 +23,7 @@
</url>
<includes
- id="org.eclipse.swtbot.eclipse"
+ id="org.eclipse.swtbot"
version="0.0.0"/>
<requires>
diff --git a/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
index 2905acda..1d798c5c 100644
--- a/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Generator Test Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.generator.test
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.swtbot.swt.finder,
org.hamcrest,
diff --git a/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF b/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
index 52181990..8c709f32 100644
--- a/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Code Generator Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.generator
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
@@ -10,6 +10,7 @@ Export-Package: org.eclipse.swtbot.generator
Import-Package: com.thoughtworks.qdox;version="1.6.3",
org.eclipse.swt.widgets,
org.eclipse.swtbot.eclipse.finder,
+ org.eclipse.swtbot.forms.finder.widgets,
org.eclipse.swtbot.swt.finder,
org.eclipse.swtbot.swt.finder.utils,
org.hamcrest.generator.config;version="1.1.0"
diff --git a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/HamcrestFactoryWriter.java b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/HamcrestFactoryWriter.java
index 3599308c..4a53e1ea 100644
--- a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/HamcrestFactoryWriter.java
+++ b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/HamcrestFactoryWriter.java
@@ -15,6 +15,8 @@ import java.io.PrintWriter;
import java.util.Set;
import java.util.TreeSet;
+import org.eclipse.swtbot.swt.finder.utils.FileUtils;
+
/**
* @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
* @version $Id$
@@ -26,10 +28,12 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
private final PrintWriter output;
private final String newLine = "\n"; //$NON-NLS-1$
+ private final String superClass;
- public HamcrestFactoryWriter(String packageName, String shortClassName, FileWriter fileWriter) {
+ public HamcrestFactoryWriter(String packageName, String shortClassName, String superClass, FileWriter fileWriter) {
this.packageName = packageName;
this.shortClassName = shortClassName;
+ this.superClass = superClass;
output = new PrintWriter(fileWriter);
}
@@ -46,50 +50,20 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
public void beginClassDefinition() {
output.append(newLine);
output.append(newLine);
- output.append("/**\n" + //$NON-NLS-1$
- " * This class contains convenience API to find widgets in SWTBot.\n" + //$NON-NLS-1$
- " * Most users would start off as follows: \n" + //$NON-NLS-1$
- " * \n" + //$NON-NLS-1$
- " * <pre>\n" + //$NON-NLS-1$
- " * SWTBot bot = new SWTBot();\n" + //$NON-NLS-1$
- " * \n" + //$NON-NLS-1$
- " * bot.button(&quot;hello world&quot;).click();\n" + //$NON-NLS-1$
- " * \n" + //$NON-NLS-1$
- " * // in case you have two edit buttons in two different groups\n" + //$NON-NLS-1$
- " * // say an edit button in the &quot;Address&quot; section,\n" + //$NON-NLS-1$
- " * // and another in &quot;Bank Account&quot; section, you can do the following\n" + //$NON-NLS-1$
- " * // to click on the &quot;Edit&quot; button on the &quot;Bank Account&quot; section.\n" + //$NON-NLS-1$
- " * // This is the recommended way to use SWTBot, instead of finding widgets based on its index.\n" + //$NON-NLS-1$
- " * bot.buttonInGroup(&quot;Edit&quot;, &quot;Bank Account&quot;).click();\n" + //$NON-NLS-1$
- " * </pre>\n" + //$NON-NLS-1$
- " * \n" + //$NON-NLS-1$
- " * For finding widgets using custom matchers:\n" + //$NON-NLS-1$
- " * \n" + //$NON-NLS-1$
- " * <pre>\n" + //$NON-NLS-1$
- " * SWTBot bot = new SWTBot();\n" + //$NON-NLS-1$
- " * //\n" + //$NON-NLS-1$
- " * // find a button within the currently active shell:\n" + //$NON-NLS-1$
- " * //\n" + //$NON-NLS-1$
- " * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher)); // or\n" + //$NON-NLS-1$
- " * SWTBotButton button = new SWTBotButton((Button)bot.widget(aMatcher, 3)); // for the 4th widget\n" + //$NON-NLS-1$
- " * //\n" + //$NON-NLS-1$
- " * // to find a button within a particular parent composite:\n" + //$NON-NLS-1$
- " * //\n" + //$NON-NLS-1$
- " * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite)); //or\n" + //$NON-NLS-1$
- " * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite, 3)); //for the 4th widget\n" + //$NON-NLS-1$
- " * </pre>\n" + //$NON-NLS-1$
- " *\n" + //$NON-NLS-1$
- " * @version $Id$\n" + //$NON-NLS-1$
- " */\n"); //$NON-NLS-1$
- output.append("public class ").append(shortClassName).append(" extends SWTBotFactory {").append(newLine).append(newLine); //$NON-NLS-1$ //$NON-NLS-2$
+
+ output.append(FileUtils.read("templates/" + shortClassName + "/javadoc").trim()); //$NON-NLS-1$
+ output.append(newLine);
+ output.append("public class ").append(shortClassName).append(" extends "+ superClass + " {").append(newLine).append(newLine); //$NON-NLS-1$ //$NON-NLS-2$
}
public void writeFooter() {
- output.append(" private Matcher<? extends List> withLabel(String label) {\n"
- + " return WidgetMatcherFactory.withLabel(label, finder);\n"
- + " }\n\n");
+ output.append(newLine);
+ output.append(FileUtils.read("templates/" + shortClassName + "/additionalMethods")); //$NON-NLS-1$
+
+ output.append(newLine);
+
output.append('}').append(newLine);
}
@@ -108,29 +82,8 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
private void writeImports(Set<String> imports) {
imports = new TreeSet<String>(imports);
+ imports.addAll(FileUtils.readlines("templates/" + shortClassName + "/imports"));
- imports.add("import org.eclipse.swt.SWT"); //$NON-NLS-1$
-
- imports.add("import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMessage"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.inGroup"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withStyle"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withTooltip"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType"); //$NON-NLS-1$
- imports.add("import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.finders.ControlFinder"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.finders.Finder"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.finders.MenuFinder"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton"); //$NON-NLS-1$
- imports.add("import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory"); //$NON-NLS-1$
- imports.add("import org.eclipse.swt.widgets.Widget"); //$NON-NLS-1$
-
- imports.add("import org.hamcrest.Matcher"); //$NON-NLS-1$
for (String importz : imports) {
output.append(importz).append(";").append(newLine); //$NON-NLS-1$
@@ -142,7 +95,7 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
output.append(" /**\n" +
" * Constructs a bot.\n" +
" */\n" +
- " public SWTBot() {\n" +
+ " public " + shortClassName + "() {\n" +
" this(new ControlFinder(), new MenuFinder());\n" +
" }\n" +
"\n" +
@@ -151,7 +104,7 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
" * \n" +
" * @param parent the parent\n" +
" */\n" +
- " public SWTBot(Widget parent) {\n" +
+ " public " + shortClassName + "(Widget parent) {\n" +
" this(new ChildrenControlFinder(parent), new MenuFinder());\n" +
" }\n" +
" /**\n" +
@@ -160,7 +113,7 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
" * @param controlFinder the {@link ControlFinder} used to identify and find controls.\n" +
" * @param menuFinder the {@link MenuFinder} used to find menu items.\n" +
" */\n" +
- " public SWTBot(ControlFinder controlFinder, MenuFinder menuFinder) {\n" +
+ " public " + shortClassName + "(ControlFinder controlFinder, MenuFinder menuFinder) {\n" +
" this(new Finder(controlFinder, menuFinder));\n" +
" }\n" +
"\n" +
@@ -169,7 +122,7 @@ public class HamcrestFactoryWriter implements HamcrestWriter {
" * \n" +
" * @param finder the finder.\n" +
" */\n" +
- " public SWTBot(Finder finder) {\n" +
+ " public " + shortClassName + "(Finder finder) {\n" +
" super(finder);\n" +
" }\n\n");
}
diff --git a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/SWTBotGeneratorMain.java b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/SWTBotGeneratorMain.java
index 3d95a758..a37e709c 100644
--- a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/SWTBotGeneratorMain.java
+++ b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/SWTBotGeneratorMain.java
@@ -20,7 +20,8 @@ public class SWTBotGeneratorMain {
public static void main(String[] args) {
try {
- XmlConfigurator.main("widgets.xml", "org.eclipse.swtbot.swt.finder.SWTBot", new File("../org.eclipse.swtbot.swt.finder/src" ));
+ XmlConfigurator.main("widgets.xml", "org.eclipse.swtbot.swt.finder.SWTBot", "SWTBotFactory", new File("../org.eclipse.swtbot.swt.finder/src" ));
+ XmlConfigurator.main("widgets-forms.xml", "org.eclipse.swtbot.forms.finder.SWTFormsBot", "SWTBot", new File("../org.eclipse.swtbot.forms.finder/src" ));
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/XmlConfigurator.java b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/XmlConfigurator.java
index a5d7ad4b..7a851c13 100644
--- a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/XmlConfigurator.java
+++ b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/XmlConfigurator.java
@@ -59,7 +59,7 @@ public class XmlConfigurator {
sugarConfiguration.addImports(new SWTBotGeneratorFactoryReader(className));
}
- public static void main(String configFile, String fullClassName, File outputDir) throws Exception {
+ public static void main(String configFile, String fullClassName, String superClass, File outputDir) throws Exception {
String fileName = fullClassName.replace('.', File.separatorChar) + ".java"; //$NON-NLS-1$
int dotIndex = fullClassName.lastIndexOf("."); //$NON-NLS-1$
@@ -76,7 +76,7 @@ public class XmlConfigurator {
SugarGenerator sugarGenerator = new SugarGenerator();
try {
- sugarGenerator.addWriter(new HamcrestFactoryWriter(packageName, shortClassName, new FileWriter(outputFile)));
+ sugarGenerator.addWriter(new HamcrestFactoryWriter(packageName, shortClassName, superClass, new FileWriter(outputFile)));
sugarGenerator.addWriter(new QuickReferenceWriter(System.out));
XmlConfigurator xmlConfigurator = new XmlConfigurator(sugarGenerator, XmlConfigurator.class.getClassLoader());
diff --git a/org.eclipse.swtbot.generator/templates/SWTBot/additionalMethods b/org.eclipse.swtbot.generator/templates/SWTBot/additionalMethods
new file mode 100644
index 00000000..6aed077e
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTBot/additionalMethods
@@ -0,0 +1,3 @@
+ private Matcher<? extends Widget> withLabel(String label) {
+ return WidgetMatcherFactory.withLabel(label, finder);
+ }
diff --git a/org.eclipse.swtbot.generator/templates/SWTBot/imports b/org.eclipse.swtbot.generator/templates/SWTBot/imports
new file mode 100644
index 00000000..c746a2cc
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTBot/imports
@@ -0,0 +1,19 @@
+import org.eclipse.swt.SWT
+import org.eclipse.swt.widgets.Widget
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException
+import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder
+import org.eclipse.swtbot.swt.finder.finders.ControlFinder
+import org.eclipse.swtbot.swt.finder.finders.Finder
+import org.eclipse.swtbot.swt.finder.finders.MenuFinder
+import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton
+import org.hamcrest.Matcher
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.inGroup
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMessage
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withStyle
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withTooltip
diff --git a/org.eclipse.swtbot.generator/templates/SWTBot/javadoc b/org.eclipse.swtbot.generator/templates/SWTBot/javadoc
new file mode 100644
index 00000000..247ad31c
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTBot/javadoc
@@ -0,0 +1,35 @@
+/**
+ * This class contains convenience API to find widgets in SWTBot.
+ * Most users would start off as follows:
+ *
+ * <pre>
+ * SWTBot bot = new SWTBot();
+ *
+ * bot.button(&quot;hello world&quot;).click();
+ *
+ * // in case you have two edit buttons in two different groups
+ * // say an edit button in the &quot;Address&quot; section,
+ * // and another in &quot;Bank Account&quot; section, you can do the following
+ * // to click on the &quot;Edit&quot; button on the &quot;Bank Account&quot; section.
+ * // This is the recommended way to use SWTBot, instead of finding widgets based on its index.
+ * bot.buttonInGroup(&quot;Edit&quot;, &quot;Bank Account&quot;).click();
+ * </pre>
+ *
+ * For finding widgets using custom matchers:
+ *
+ * <pre>
+ * SWTBot bot = new SWTBot();
+ * //
+ * // find a button within the currently active shell:
+ * //
+ * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher)); // or
+ * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, 3)); // for the 4th widget
+ * //
+ * // to find a button within a particular parent composite:
+ * //
+ * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite)); //or
+ * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite, 3)); //for the 4th widget
+ * </pre>
+ *
+ * @version $Id$
+ */ \ No newline at end of file
diff --git a/org.eclipse.swtbot.generator/templates/SWTFormsBot/additionalMethods b/org.eclipse.swtbot.generator/templates/SWTFormsBot/additionalMethods
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTFormsBot/additionalMethods
diff --git a/org.eclipse.swtbot.generator/templates/SWTFormsBot/imports b/org.eclipse.swtbot.generator/templates/SWTFormsBot/imports
new file mode 100644
index 00000000..0bc719e2
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTFormsBot/imports
@@ -0,0 +1,13 @@
+import org.eclipse.swt.widgets.Widget
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException
+import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder
+import org.eclipse.swtbot.swt.finder.finders.ControlFinder
+import org.eclipse.swtbot.swt.finder.finders.Finder
+import org.eclipse.swtbot.swt.finder.finders.MenuFinder
+import org.hamcrest.Matcher
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.inGroup
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic
+import org.eclipse.swtbot.swt.finder.SWTBot \ No newline at end of file
diff --git a/org.eclipse.swtbot.generator/templates/SWTFormsBot/javadoc b/org.eclipse.swtbot.generator/templates/SWTFormsBot/javadoc
new file mode 100644
index 00000000..186ad8b0
--- /dev/null
+++ b/org.eclipse.swtbot.generator/templates/SWTFormsBot/javadoc
@@ -0,0 +1,5 @@
+/**
+ * SWTFormsBot is a {@link SWTBot} with capabilities for testing eclipse forms.
+ *
+ * @see {@link SWTBot} - SWTBot for usage examples.
+ */ \ No newline at end of file
diff --git a/org.eclipse.swtbot.generator/widgets-forms.xml b/org.eclipse.swtbot.generator/widgets-forms.xml
new file mode 100644
index 00000000..c28b4037
--- /dev/null
+++ b/org.eclipse.swtbot.generator/widgets-forms.xml
@@ -0,0 +1,4 @@
+<widgets>
+ <widget class="org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink" />
+ <widget class="org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink" />
+</widgets> \ No newline at end of file
diff --git a/org.eclipse.swtbot.go/META-INF/MANIFEST.MF b/org.eclipse.swtbot.go/META-INF/MANIFEST.MF
index adb2e391..5959d637 100644
--- a/org.eclipse.swtbot.go/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.go/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Go Convenience Plugin (Incubation)
Bundle-SymbolicName: org.eclipse.swtbot.go
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Require-Bundle: org.eclipse.swtbot.eclipse.core;visibility:=reexport,
org.eclipse.swtbot.eclipse.finder;visibility:=reexport,
org.eclipse.swtbot.swt.finder;visibility:=reexport,
diff --git a/org.eclipse.swtbot.ide/feature.xml b/org.eclipse.swtbot.ide/feature.xml
index 371bf49c..fb921cf8 100644
--- a/org.eclipse.swtbot.ide/feature.xml
+++ b/org.eclipse.swtbot.ide/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.ide"
label="SWTBot IDE Features (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org"
plugin="org.eclipse.swtbot.eclipse.ui">
diff --git a/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_3 b/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_3
deleted file mode 100644
index ca05e6a9..00000000
--- a/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_3
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: SWTBot JUnit 4.x Runners (incubation)
-Bundle-SymbolicName: org.eclipse.swtbot.junit4_x
-Bundle-Version: 2.0.3.qualifier
-Bundle-Vendor: Eclipse.org - SWTBot
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.swtbot.swt.finder.junit
-Import-Package: org.apache.log4j;version="1.2.12",
- org.eclipse.swt.widgets,
- org.eclipse.swtbot.swt.finder,
- org.eclipse.swtbot.swt.finder.utils,
- org.junit.internal.runners;version="4.3.1",
- org.junit.runner.notification;version="4.3.1",
- org.junit.runners;version="4.3.1"
diff --git a/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_5 b/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_5
index bc2463ac..b95e9aa0 100644
--- a/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_5
+++ b/org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_5
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot JUnit 4.x Runners (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.junit4_x
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.swtbot.swt.finder.junit
diff --git a/org.eclipse.swtbot.junit4_x/_build.properties.junit4_5 b/org.eclipse.swtbot.junit4_x/_build.properties.junit4_5
index 8f6c474a..8d76440f 100644
--- a/org.eclipse.swtbot.junit4_x/_build.properties.junit4_5
+++ b/org.eclipse.swtbot.junit4_x/_build.properties.junit4_5
@@ -8,12 +8,10 @@
# Contributors:
# Ketan Padegaonkar - initial API and implementation
###############################################################################
-source.. = junit4_5/,\
- src/
+source.. = src/
output.. = bin/
bin.includes = META-INF/MANIFEST.MF,\
.,\
- junit4_5/,\
src/,\
about.html,\
LICENSE.EPL
diff --git a/org.eclipse.swtbot.junit4_x/_classpath.junit4_5 b/org.eclipse.swtbot.junit4_x/_classpath.junit4_5
index 17f499e7..64c5e31b 100644
--- a/org.eclipse.swtbot.junit4_x/_classpath.junit4_5
+++ b/org.eclipse.swtbot.junit4_x/_classpath.junit4_5
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="junit4_5"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java b/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java
deleted file mode 100644
index 034e8a25..00000000
--- a/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SWTBot Committers 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:
- * Hans Schwaebli - initial API and implementation (Bug 273403)
- *******************************************************************************/
-package org.eclipse.swtbot.swt.finder.junit;
-
-import org.junit.runner.notification.RunListener;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.Suite;
-
-/**
- * A suite runner that captures screenshots on test failures. Clients are not supposed to subclass this. Typical usage is:
- *
- * <pre>
- * &#064;RunWith(SWTBotJUnit4Suite.class)
- * &#064;SuiteClasses( { FooTest.class, BarTest.class })
- * public class MySuite {
- * }
- * </pre>
- *
- * @author Hans Schwaebli (Bug 273403)
- * @version $Id:
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- * @deprecated Please use {@link Suite} instead. <code>@RunWith(Suite.class)</code>
- */
-public final class SWTBotJUnit4Suite extends Suite {
-
- public SWTBotJUnit4Suite(Class<?> klass) throws Exception {
- super(klass);
- System.err.println("This class has been deprecated, please use org.junit.runners.Suite.class instead.");
- }
-
- public SWTBotJUnit4Suite(Class<?> klass, Class<?>[] annotatedClasses) throws Exception {
- super(klass, annotatedClasses);
- System.err.println("This class has been deprecated, please use org.junit.runners.Suite.class instead.");
- }
-
- /**
- * Decorates the run method of the super class with a screenshot capturer.
- *
- * @see org.junit.runners.Suite#run(RunNotifier)
- */
- public void run(RunNotifier notifier) {
- RunListener failureSpy = new ScreenshotCaptureListener();
- notifier.removeListener(failureSpy); // remove existing listeners that could be added by suite or class runners
- notifier.addListener(failureSpy);
- try {
- super.run(notifier);
- } finally {
- notifier.removeListener(failureSpy);
- }
- }
-
-}
diff --git a/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java b/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java
deleted file mode 100644
index a1966f76..00000000
--- a/org.eclipse.swtbot.junit4_x/junit4_3/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SWTBot Committers 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:
- * Hans Schwaebli - initial API and implementation (Bug 259787)
- * Toby Weston - initial API and implementation (Bug 259787)
- *******************************************************************************/
-package org.eclipse.swtbot.swt.finder.junit;
-
-import org.junit.internal.runners.TestClassRunner;
-import org.junit.runner.notification.RunListener;
-import org.junit.runner.notification.RunNotifier;
-
-
-/**
- * A runner that captures screenshots on test failures. If you wish to launch your application for your tests use
- * {@link SWTBotApplicationLauncherClassRunner}. Clients are supposed to subclass this. Typical usage is:
- *
- * <pre>
- * &#064;RunWith(SWTBotJunit4ClassRunner.class)
- * public class FooTest {
- * &#064;Test
- * public void canSendEmail() {
- * }
- * }
- * </pre>
- *
- * @author Hans Schwaebli (Bug 259787)
- * @author Toby Weston (Bug 259787)
- * @version $Id$
- * @see SWTBotApplicationLauncherClassRunner
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class SWTBotJunit4ClassRunner extends TestClassRunner {
-
- /**
- * Creates a SWTBotRunner to run {@code klass}
- *
- * @throws Exception if the test class is malformed.
- */
- public SWTBotJunit4ClassRunner(Class<?> klass) throws Exception {
- super(klass);
- }
-
- public void run(RunNotifier notifier) {
- RunListener failureSpy = new ScreenshotCaptureListener();
- notifier.removeListener(failureSpy); // remove existing listeners that could be added by suite or class runners
- notifier.addListener(failureSpy);
- try {
- super.run(notifier);
- } finally {
- notifier.removeListener(failureSpy);
- }
- }
-
-}
diff --git a/org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java b/org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java
index 8ededb5b..8ededb5b 100644
--- a/org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java
+++ b/org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJUnit4Suite.java
diff --git a/org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java b/org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java
index d601d65f..d601d65f 100644
--- a/org.eclipse.swtbot.junit4_x/junit4_5/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java
+++ b/org.eclipse.swtbot.junit4_x/src/org/eclipse/swtbot/swt/finder/junit/SWTBotJunit4ClassRunner.java
diff --git a/org.eclipse.swtbot.releng/allElements.xml b/org.eclipse.swtbot.releng/allElements.xml
index 459457ac..c78891c3 100644
--- a/org.eclipse.swtbot.releng/allElements.xml
+++ b/org.eclipse.swtbot.releng/allElements.xml
@@ -41,6 +41,11 @@
<ant antfile="${genericTargets}" target="${target}">
<property name="type" value="feature" />
+ <property name="id" value="org.eclipse.swtbot.forms" />
+ </ant>
+
+ <ant antfile="${genericTargets}" target="${target}">
+ <property name="type" value="feature" />
<property name="id" value="org.eclipse.swtbot.test" />
</ant>
@@ -80,4 +85,8 @@
<target name="assemble.org.eclipse.swtbot.ide">
<ant antfile="${assembleScriptName}" dir="${buildDirectory}" />
</target>
+
+ <target name="assemble.org.eclipse.swtbot.forms">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}" />
+ </target>
</project>
diff --git a/org.eclipse.swtbot.releng/build.properties.template b/org.eclipse.swtbot.releng/build.properties.template
index b2b7229d..6802d407 100644
--- a/org.eclipse.swtbot.releng/build.properties.template
+++ b/org.eclipse.swtbot.releng/build.properties.template
@@ -118,8 +118,8 @@ flattenDependencies = true
#Parallel compilation, requires flattenedDependencies=true
parallelCompilation = true
-parallelThreadCount =
-parallelThreadsPerProcessor =
+parallelThreadCount = 3
+parallelThreadsPerProcessor = 2
#Set to true if you want the output to be ready for an update jar (no site.xml generated)
#outputUpdateJars = false
diff --git a/org.eclipse.swtbot.releng/build.xml b/org.eclipse.swtbot.releng/build.xml
index 13f1cd58..9c2ceccb 100644
--- a/org.eclipse.swtbot.releng/build.xml
+++ b/org.eclipse.swtbot.releng/build.xml
@@ -4,7 +4,7 @@
<exec executable="hostname" outputproperty="hostname" />
<property file="host-conf/build.${hostname}.properties" />
- <!-- in case users provide an eclipse.version, load it before anything else! -->
+ <!-- in case users provide an eclipse.version, load it before anything else! -->
<property file="build-conf/e${eclipse.version}.properties" />
<!-- Load up the basic properties -->
<property file="build.developer.properties" />
@@ -27,7 +27,7 @@
<property file="build.default.properties" />
<import file="check-prerequisites.xml" />
- <property name="plugin.version.primary" value="2.0.3" />
+ <property name="plugin.version.primary" value="2.0.5" />
<!-- automagically generate build numbers from git -->
<property name="git.version" value="1" />
@@ -95,6 +95,7 @@
<!-- list all your features here -->
<include name="${feature.id}/**" />
<include name="${feature.id.test}/**" />
+ <include name="org.eclipse.swtbot.forms/**" />
<include name="org.eclipse.swtbot.eclipse/**" />
<include name="org.eclipse.swtbot.eclipse.test.junit3/**" />
<include name="org.eclipse.swtbot.eclipse.test.junit4/**" />
@@ -114,11 +115,13 @@
<!-- include plugins here -->
<include name="${plugin.prefix}*/**" />
<include name="org.eclipse.swt.examples/**" />
+ <include name="org.eclipse.ui.forms.examples/**" />
<include name="org.apache.*/**" />
<!-- remember to exclude features in case you are using wildcards -->
<exclude name="org.eclipse.swtbot.releng/**" />
<exclude name="${feature.id}/**" />
<exclude name="${feature.id.test}/**" />
+ <exclude name="org.eclipse.swtbot.forms/**" />
<exclude name="org.eclipse.swtbot.eclipse/**" />
<exclude name="org.eclipse.swtbot.eclipse.gef/**" />
<exclude name="org.eclipse.swtbot.eclipse.test.junit3/**" />
@@ -158,21 +161,7 @@
<copy file="../org.eclipse.swtbot.junit4_x/_classpath.junit4_5" tofile="../org.eclipse.swtbot.junit4_x/.classpath" overwrite="true" />
</target>
- <target name="make-substitutions-4.3" if="isJunit4.3">
- <!-- make substitutions in the eclipse-ui plugin. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=274083#c5 -->
- <copy file="../org.eclipse.swtbot.eclipse.ui/_build.properties.eclipse_3_4" tofile="../org.eclipse.swtbot.eclipse.ui/build.properties" overwrite="true" />
- <copy file="../org.eclipse.swtbot.eclipse.ui/META-INF/_MANIFEST.MF_eclipse_3_4" tofile="../org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF" overwrite="true" />
- <copy file="../org.eclipse.swtbot.eclipse.ui/_classpath.eclipse_3_4" tofile="../org.eclipse.swtbot.eclipse.ui/.classpath" overwrite="true" />
-
- <!-- make substitutions in the junit plugin -->
- <copy file="../org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF_junit4_3" tofile="../org.eclipse.swtbot.junit4_x/META-INF/MANIFEST.MF" overwrite="true" />
- <copy file="../org.eclipse.swtbot.junit4_x/_build.properties.junit4_3" tofile="../org.eclipse.swtbot.junit4_x/build.properties" overwrite="true" />
- <copy file="../org.eclipse.swtbot.junit4_x/_classpath.junit4_3" tofile="../org.eclipse.swtbot.junit4_x/.classpath" overwrite="true" />
- </target>
-
-
-
- <target name="make-substitutions" depends="guess-junit-version, make-substitutions-4.5, make-substitutions-4.8, make-substitutions-4.3" />
+ <target name="make-substitutions" depends="guess-junit-version, make-substitutions-4.5, make-substitutions-4.8" />
<target name="extract-eclipse">
<condition property="setupTarget" value="setup-zip">
@@ -229,11 +218,7 @@
<mkdir dir="${buildDirectory}/features" />
</target>
- <target name="delete-3.4-classes" if="isJunit4.3">
- <delete file="${buildDirectory}/plugins/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/BrowserAuthenticationListener.java" />
- </target>
-
- <target name="pde-build" depends="copy-all, delete-3.4-classes" description="runs the pde build">
+ <target name="pde-build" depends="copy-all" description="runs the pde build">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="${basedir}">
<arg value="-application" />
@@ -393,6 +378,7 @@
<copy todir="artifacts/to-upload" includeemptydirs="false">
<fileset dir="artifacts">
<include name="org.eclipse.swtbot-${all.buildId}.zip" />
+ <include name="org.eclipse.swtbot.forms-${all.buildId}.zip" />
<include name="org.eclipse.swtbot.eclipse-${all.buildId}.zip" />
<include name="org.eclipse.swtbot.eclipse.test.junit3-${all.buildId}.zip" />
<include name="org.eclipse.swtbot.eclipse.test.junit4-${all.buildId}.zip" />
@@ -418,6 +404,7 @@
</zip>
<copy-test-reports plugin.id="org.eclipse.swtbot.swt.finder.test" />
+ <copy-test-reports plugin.id="org.eclipse.swtbot.forms.finder.test" />
<copy-test-reports plugin.id="org.eclipse.swtbot.generator.test" />
<copy-test-reports plugin.id="org.eclipse.swtbot.eclipse.finder.test" />
diff --git a/org.eclipse.swtbot.releng/check-prerequisites.xml b/org.eclipse.swtbot.releng/check-prerequisites.xml
index 089d745f..7c7e8c6a 100644
--- a/org.eclipse.swtbot.releng/check-prerequisites.xml
+++ b/org.eclipse.swtbot.releng/check-prerequisites.xml
@@ -81,12 +81,8 @@
<condition property="isJunit4.5">
<contains string="${junit4-build-version}" substring="4.5" />
</condition>
- <condition property="isJunit4.3">
- <contains string="${junit4-build-version}" substring="4.3" />
- </condition>
<fail unless="junit4-build-version" message="Could not find org.junit4 in target eclipse" />
<echo>Plugin version of org.junit is "${junit4-build-version}"</echo>
- <echo>isJunit4.3: ${isJunit4.3}</echo>
<echo>isJunit4.5: ${isJunit4.5}</echo>
<echo>isJunit4.8: ${isJunit4.8}</echo>
</target>
diff --git a/org.eclipse.swtbot.releng/javadoc.xml b/org.eclipse.swtbot.releng/javadoc.xml
index b5fd17be..877b023f 100644
--- a/org.eclipse.swtbot.releng/javadoc.xml
+++ b/org.eclipse.swtbot.releng/javadoc.xml
@@ -2,9 +2,6 @@
<project default="javadoc">
<target name="javadoc">
- <condition property="junit.dir" value="junit4_3">
- <isset property="isJunit4.3" />
- </condition>
<property name="junit.dir" value="junit4_5"/>
<delete dir="artifacts/apidocs" />
@@ -16,6 +13,9 @@
org.eclipse.swtbot.eclipse.gef.finder.matchers,
org.eclipse.swtbot.eclipse.gef.finder.widgets,
+ org.eclipse.swtbot.forms.finder,
+ org.eclipse.swtbot.forms.finder.widgets,
+
org.eclipse.swtbot.eclipse.finder,
org.eclipse.swtbot.eclipse.finder.exceptions,
org.eclipse.swtbot.eclipse.finder.finders,
@@ -36,6 +36,7 @@
org.eclipse.swtbot.swt.finder.widgets">
<sourcepath>
<dirset dir="../">
+ <include name="org.eclipse.swtbot.forms.finder/src" />
<include name="org.eclipse.swtbot.swt.finder/src" />
<include name="org.eclipse.swtbot.eclipse.finder/src" />
<include name="org.eclipse.swtbot.eclipse.gef.finder/src" />
diff --git a/org.eclipse.swtbot.releng/make-release.rb b/org.eclipse.swtbot.releng/make-release.rb
index 9cb6c7c4..6940da51 100755
--- a/org.eclipse.swtbot.releng/make-release.rb
+++ b/org.eclipse.swtbot.releng/make-release.rb
@@ -14,10 +14,10 @@ class Release
exit(-1)
end
- @now = Time.now.utc
+ @now = Time.at(`git log -1 --format='%ct'`.to_i).utc
@version = args.first
puts "Fetching revision available on the download site..."
- uri = URI.parse("http://download.eclipse.org/technology/swtbot/ganymede/dev-build/RELEASE_NOTES.txt")
+ uri = URI.parse("http://download.eclipse.org/technology/swtbot/helios/dev-build/RELEASE_NOTES.txt")
puts "Reading #{uri}"
@available_revision = open(uri).readlines.grep(/ rev\(.*\) /).first.gsub(/RELEASE NOTES v(.*) rev\((.*)\) \(.*\)/, '\2').strip
@@ -35,9 +35,9 @@ class Release
FileUtils.rm_rf('to-upload')
FileUtils.rm_rf('target')
- build_swtbot(34, 'ganymede')
build_swtbot(35, 'galileo')
build_swtbot(36, 'helios')
+ build_swtbot(37, 'indigo')
end
def self.release_notes(dir)
@@ -60,7 +60,7 @@ class Release
release_notes("to-upload/#{code_name}/dev-build")
sh("ant materialize-workspace -Declipse.version=#{version} -Dhas.archives=true")
- extra_jvm_opts = "-Dextra.jvm.options=#{ENV['JAVA_OPTS']}" if ENV['JAVA_OPTS']
+ extra_jvm_opts = "-Dextra.jvm.options='#{ENV['JAVA_OPTS']}'" if ENV['JAVA_OPTS']
sh("ant cruise -Declipse.version=#{version} -Dhas.archives=true #{extra_jvm_opts} -Dnow.now=#{@now.strftime('%Y%m%d_%H%M')}")
FileUtils.rm_rf("to-upload/#{code_name}")
FileUtils.mkdir_p("to-upload/#{code_name}")
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.forms.finder.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.forms.finder.test.xml
new file mode 100644
index 00000000..05863654
--- /dev/null
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.forms.finder.test.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<project name="testsuite" default="run" basedir=".">
+ <property name="eclipse-home" value="${basedir}\..\.." />
+ <property name="plugin-under-test" value="org.eclipse.swtbot.forms.finder" />
+ <property name="plugin-name" value="org.eclipse.swtbot.forms.finder.test" />
+ <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit4.headless_${all.buildId}/library.xml"/>
+
+ <property name="build.instrumentation.reports.dir" value="${results.dir}/${plugin-name}/coverage/html" />
+ <property name="build.instrumentation.reports.xml.dir" value="${results.dir}/${plugin-name}/coverage/xml" />
+
+ <property name="cobertura.data.file" value="${basedir}/${plugin-name}.ser" />
+
+ <target name="init">
+ <tstamp />
+ <delete>
+ <fileset dir="${eclipse-home}" includes="org*.xml" />
+ </delete>
+ </target>
+
+ <path id="cobertura.classpath">
+ <fileset dir="${build.base}/../externals/libs/cobertura-1.9.4.1">
+ <include name="cobertura.jar" />
+ <include name="lib/**/*.jar" />
+ </fileset>
+ </path>
+
+ <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
+
+ <target name="instrument">
+ <delete file="${cobertura.data.file}" />
+
+ <cobertura-instrument datafile="${cobertura.data.file}">
+ <fileset dir="${eclipse-home}/plugins">
+ <include name="${plugin-under-test}_${all.buildId}.jar" />
+ </fileset>
+ </cobertura-instrument>
+ </target>
+
+ <target name="suite">
+
+ <condition property="jvmOption" value="-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Dnet.sourceforge.cobertura.datafile=${cobertura.data.file} -Xbootclasspath/p:${build.base}/../externals/libs/cobertura-1.9.4.1/cobertura.jar">
+ <os family="mac" />
+ </condition>
+
+ <property name="jvmOption" value="-Dnet.sourceforge.cobertura.datafile=${cobertura.data.file} -Xbootclasspath/p:${build.base}/../externals/libs/cobertura-1.9.4.1/cobertura.jar" />
+
+
+ <property name="temp-workspace" value="workspace" />
+ <delete dir="${temp-workspace}" quiet="true" />
+
+ <!-- remove junit3 fragment -->
+ <delete dir="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit3.headless_${all.buildId}" />
+ <delete dir="${eclipse-home}/plugins" includes="org.eclipse.swtbot.ant.optional.junit3_${all.buildId}.jar"/>
+
+ <ant target="swtbot-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${temp-workspace}" />
+ <property name="testApplication" value="org.eclipse.ui.ide.workbench" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="org.eclipse.swtbot.forms.finder.test.AllTests" />
+ <property name="vmargs" value=" -Xms128M -Xmx368M -XX:MaxPermSize=256M ${jvmOption} ${extra.jvm.options}" />
+ </ant>
+ </target>
+
+ <target name="test-coverage">
+ <cobertura-report format="html" destdir="${build.instrumentation.reports.dir}" srcdir="${build.base}/plugins/${plugin-under-test}/src" datafile="${cobertura.data.file}" />
+ <cobertura-report format="xml" destdir="${build.instrumentation.reports.xml.dir}" srcdir="${build.base}/plugins/${plugin-under-test}/src" datafile="${cobertura.data.file}" />
+ </target>
+
+ <target name="run" depends="init, instrument, suite, test-coverage">
+ <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="includes" value="*.xml" />
+ <property name="output-file" value="${plugin-name}.xml" />
+ </ant>
+ </target>
+
+</project> \ No newline at end of file
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
index fbb87332..4a388e70 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
@@ -63,7 +63,7 @@
<target name="test">
<mkdir dir="${junit.reports.xml.dir}" />
- <condition property="jvmOption" value="-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts">
+ <condition property="jvmOption" value="-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts ${extra.jvm.options}">
<os family="mac" />
</condition>
diff --git a/org.eclipse.swtbot.releng/test-sandbox/test.xml b/org.eclipse.swtbot.releng/test-sandbox/test.xml
index 16e8af5e..4b184963 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/test.xml
@@ -279,11 +279,15 @@
<runTests testPlugin="org.eclipse.swtbot.eclipse.finder.test" />
</target>
+ <target name="test-forms">
+ <runTests testPlugin="org.eclipse.swtbot.forms.finder.test" />
+ </target>
+
<target name="test-eclipse-ui">
<runTests testPlugin="org.eclipse.swtbot.eclipse.ui.test" />
</target>
- <target name="all" depends="test-finder, test-generator, test-eclipse-finder, test-eclipse-ui" />
+ <target name="all" depends="test-finder, test-forms, test-eclipse-finder, test-eclipse-ui, test-generator" />
</project>
diff --git a/org.eclipse.swtbot.swt.demo/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.demo/META-INF/MANIFEST.MF
index 583ccaba..55ace854 100644
--- a/org.eclipse.swtbot.swt.demo/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.demo/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot Demo Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.swt.demo;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-Activator: org.eclipse.swtbot.swt.demo.Activator
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
index 895b4ace..10a421c8 100644
--- a/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot SWT Control Finder plugin (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.swt.finder.test;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Require-Bundle: org.eclipse.swt,
org.eclipse.jface,
org.eclipse.swt.examples,
diff --git a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadioTest.java b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadioTest.java
index 58de259d..bc6219b2 100644
--- a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadioTest.java
+++ b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadioTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Ketan Padegaonkar and others.
+ * Copyright (c) 2008,2010 Ketan Padegaonkar 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
@@ -10,21 +10,15 @@
*******************************************************************************/
package org.eclipse.swtbot.swt.finder.widgets;
-import static org.eclipse.swtbot.swt.finder.SWTBotTestCase.assertTextContains;
import static org.eclipse.swtbot.swt.finder.SWTBotTestCase.pass;
-import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.util.List;
-
-import org.eclipse.swt.widgets.Text;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.AbstractSWTTestCase;
-import org.eclipse.swtbot.swt.finder.finders.ControlFinder;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.After;
import org.junit.Before;
@@ -38,6 +32,7 @@ public class SWTBotRadioTest extends AbstractSWTTestCase {
private SWTBot bot;
private long oldTimeout;
+ private SWTBotText listeners;
@Before
public void lowerTimeout() {
@@ -51,31 +46,40 @@ public class SWTBotRadioTest extends AbstractSWTTestCase {
}
@Test
- public void clicksCheckBox() throws Exception {
- try {
- List<Text> findControls = new ControlFinder().findControls(widgetOfType(Text.class));
- SWTBotText text = new SWTBotText(findControls.get(0));
- text.setText("");
-
- bot.checkBox("Listen").click();
- bot.button("One").click();
- assertTextContains("Selection [13]: SelectionEvent{Button {One}", text);
- } finally {
- bot.checkBox("Listen").click();
- bot.button("Clear").click();
- }
+ public void clicksRadioButton() throws Exception {
+ bot.radio("Three").click();
+ listeners.setText("");
+
+ bot.radio("One").click();
+ assertEventMatches(listeners, "Activate [26]: ShellEvent{Button {One} time=557343275 data=null doit=true}");
+ assertEventMatches(listeners, "MouseDown [3]: MouseEvent{Button {One} time=557343275 data=null button=1 stateMask=0 x=31 y=13 count=1}");
+ assertEventMatches(listeners, "MouseUp [4]: MouseEvent{Button {One} time=557343275 data=null button=1 stateMask=524288 x=31 y=12 count=1}");
+ assertEventMatches(listeners, "Selection [13]: SelectionEvent{Button {One} time=557343275 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}");
+ }
+
+ @Test
+ public void clickingOneRadioDeselectsOthers() throws Exception {
+ bot.radio("One").click();
+ listeners.setText("");
+ bot.radio("Two").click();
+ assertEventMatches(listeners, "Deactivate [27]: ShellEvent{Button {One} time=557347515 data=null doit=true}");
+ assertEventMatches(listeners, "Activate [26]: ShellEvent{Button {Two} time=557347515 data=null doit=true}");
+ assertEventMatches(listeners, "MouseDown [3]: MouseEvent{Button {Two} time=557347515 data=null button=1 stateMask=0 x=16 y=13 count=1}");
+ assertEventMatches(listeners, "MouseUp [4]: MouseEvent{Button {Two} time=557347515 data=null button=1 stateMask=524288 x=16 y=13 count=1}");
+ assertEventMatches(listeners, "Selection [13]: SelectionEvent{Button {One} time=557347515 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}");
+ assertEventMatches(listeners, "Selection [13]: SelectionEvent{Button {Two} time=557347515 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}");
}
@Test
- public void doesNotMatchRadioButtons() throws Exception {
+ public void doesNotMatchCheckboxButtons() throws Exception {
try {
- assertNull(bot.checkBox("SWT.PUSH").widget);
+ assertNull(bot.radio("SWT.FLAT").widget);
fail("Expecting WidgetNotFoundException");
} catch (WidgetNotFoundException e) {
pass();
}
try {
- assertNull(bot.checkBox("Preferred").widget);
+ assertNull(bot.radio("Horizontal Fill").widget);
fail("Expecting WidgetNotFoundException");
} catch (WidgetNotFoundException e) {
pass();
@@ -85,13 +89,13 @@ public class SWTBotRadioTest extends AbstractSWTTestCase {
@Test
public void doesNotMatchRegularButtons() throws Exception {
try {
- assertNull(bot.checkBox("One").widget);
+ assertNull(bot.radio("Clear").widget);
fail("Expecting WidgetNotFoundException");
} catch (WidgetNotFoundException e) {
pass();
}
try {
- assertNull(bot.checkBox("Change").widget);
+ assertNull(bot.radio("Select Listeners").widget);
fail("Expecting WidgetNotFoundException");
} catch (WidgetNotFoundException e) {
pass();
@@ -120,6 +124,10 @@ public class SWTBotRadioTest extends AbstractSWTTestCase {
super.setUp();
bot = new SWTBot();
bot.tabItem("Button").activate();
+ bot.radio("SWT.RADIO").click();
+ listeners = bot.textInGroup("Listeners");
+ bot.checkBox("Listen").select();
+ bot.button("Clear").click();
}
}
diff --git a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotToggleButtonTest.java b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotToggleButtonTest.java
index 9f358656..5a3aa030 100644
--- a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotToggleButtonTest.java
+++ b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotToggleButtonTest.java
@@ -55,16 +55,15 @@ public class SWTBotToggleButtonTest extends AbstractSWTTestCase {
try {
List<Text> findControls = new ControlFinder().findControls(widgetOfType(Text.class));
SWTBotText text = new SWTBotText(findControls.get(0));
+ bot.checkBox("Listen").select();
text.setText("");
- assertFalse(bot.checkBox("Listen").isChecked());
- bot.checkBox("Listen").click();
assertFalse(bot.toggleButton("One").isPressed());
bot.toggleButton("One").click();
assertTrue(bot.toggleButton("One").isPressed());
assertTextContains("Selection [13]: SelectionEvent{Button {One}", text);
} finally {
- bot.checkBox("Listen").click();
+ bot.checkBox("Listen").deselect();
bot.button("Clear").click();
}
}
diff --git a/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
index 669b9d83..2412f45b 100644
--- a/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SWTBot SWT Control Finder plugin (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.swt.finder;singleton:=true
-Bundle-Version: 2.0.3.qualifier
+Bundle-Version: 2.0.5.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: org.eclipse.swtbot.swt.finder,
@@ -19,7 +19,7 @@ Export-Package: org.eclipse.swtbot.swt.finder,
Bundle-Vendor: Eclipse.org - SWTBot
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-BuddyPolicy: registered
-Import-Package: junit.framework;version="4.3.0",
+Import-Package: junit.framework;version="4.5.0",
org.apache.log4j;version="[1.2.13,1.3.0)",
org.eclipse.jface.bindings.keys,
org.eclipse.swt,
@@ -29,4 +29,4 @@ Import-Package: junit.framework;version="4.3.0",
org.eclipse.swt.graphics,
org.eclipse.swt.widgets,
org.hamcrest;version="1.1.0",
- org.junit;version="4.3.0"
+ org.junit;version="4.5.0"
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBot.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBot.java
index 6c528bba..4fe206da 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBot.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBot.java
@@ -95,7 +95,7 @@ import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withTo
* // find a button within the currently active shell:
* //
* SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher)); // or
- * SWTBotButton button = new SWTBotButton((Button)bot.widget(aMatcher, 3)); // for the 4th widget
+ * SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, 3)); // for the 4th widget
* //
* // to find a button within a particular parent composite:
* //
@@ -4502,7 +4502,8 @@ public class SWTBot extends SWTBotFactory {
return new SWTBotExpandBar((ExpandBar) widget(matcher, index), matcher);
}
- private Matcher<? extends List> withLabel(String label) {
+
+ private Matcher<? extends Widget> withLabel(String label) {
return WidgetMatcherFactory.withLabel(label, finder);
}
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/FileUtils.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/FileUtils.java
index 9882d2ee..ccb37ead 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/FileUtils.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/FileUtils.java
@@ -10,18 +10,11 @@
*******************************************************************************/
package org.eclipse.swtbot.swt.finder.utils;
-import java.io.BufferedWriter;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
+import java.io.*;
import java.net.URL;
import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
/**
* Provides utilities to read and write to files.
@@ -89,6 +82,34 @@ public class FileUtils {
return buffer.toString();
}
+ public static List<String> readlines(String file) {
+ try {
+ return readlines(new FileInputStream(file));
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static List<String> readlines(InputStream in) {
+ return readlines(new InputStreamReader(in, Charset.forName("UTF-8")));
+ }
+
+ private static List<String> readlines(Reader in) {
+ BufferedReader reader = new BufferedReader(in);
+ ArrayList<String> lines = new ArrayList<String>();
+
+ try {
+ while (reader.ready()) {
+ lines.add(reader.readLine());
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ close(in);
+ }
+ return lines;
+ }
+
/**
* @param text the contents to write to the file.
* @param file the file to write to.
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/BrowserAuthenticationListenerDelegate.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/BrowserAuthenticationListenerDelegate.java
deleted file mode 100644
index 012706d4..00000000
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/BrowserAuthenticationListenerDelegate.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Ketan Padegaonkar 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:
- * Ketan Padegaonkar - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.swt.finder.widgets;
-
-import java.lang.reflect.Method;
-
-import org.apache.log4j.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swtbot.swt.finder.utils.Credentials;
-
-/**
- * Makes you cringe in your stomach. A workaround for java not being a real programming language. Wrapper for
- * BrowserAuthenticationListener that should only be used when {@link org.eclipse.swt.browser.AuthenticationListener} is
- * available. Requires SWT > v3.5.
- *
- * @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
- */
-class BrowserAuthenticationListenerDelegate {
-
- private Object delegate;
-
- BrowserAuthenticationListenerDelegate() {
- if (SWT.getVersion() >= 3500) {
- try {
- this.delegate = Class.forName("org.eclipse.swtbot.swt.finder.widgets.BrowserAuthenticationListener").newInstance();
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- } else {
- Logger log = Logger.getLogger(BrowserAuthenticationListenerDelegate.class);
- log.warn("You are running a version of SWT lower than v3.5. Browser authentication may not be available.");
- }
- }
-
- Credentials getCredentials() {
- if (this.delegate == null) {
- return null;
- }
- try {
- Method method = delegate.getClass().getMethod("getCredentials");
- return (Credentials) method.invoke(this.delegate);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- void setCredentials(Credentials credentials) {
- if (this.delegate == null) {
- return;
- }
- try {
- Method method = delegate.getClass().getMethod("setCredentials", Credentials.class);
- method.invoke(this.delegate, credentials);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- void init(Browser widget) {
- if (this.delegate == null) {
- return;
- }
- try {
- Method method = delegate.getClass().getMethod("init", Browser.class);
- method.invoke(this.delegate, widget);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotBrowser.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotBrowser.java
index 098fa20d..18308eab 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotBrowser.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotBrowser.java
@@ -34,8 +34,8 @@ import org.hamcrest.SelfDescribing;
@SWTBotWidget(clasz = Browser.class, preferredName = "browser", referenceBy = { ReferenceBy.LABEL })
public class SWTBotBrowser extends AbstractSWTBotControl<Browser> {
- private final InternalProgressListener progressListener;
- private final static BrowserAuthenticationListenerDelegate authListener = new BrowserAuthenticationListenerDelegate();
+ private final InternalProgressListener progressListener;
+ private final static BrowserAuthenticationListener authListener = new BrowserAuthenticationListener();
/**
* Constructs an instance of this object with the given browser
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadio.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadio.java
index 80ba60de..c3ee7d4b 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadio.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotRadio.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Ketan Padegaonkar and others.
+ * Copyright (c) 2008,2010 Ketan Padegaonkar 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
@@ -19,6 +19,7 @@ import org.eclipse.swtbot.swt.finder.Style;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.results.BoolResult;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.utils.MessageFormat;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
import org.eclipse.swtbot.swt.finder.utils.internal.Assert;
@@ -67,41 +68,54 @@ public class SWTBotRadio extends AbstractSWTBotControl<Button> {
return this;
}
waitForEnabled();
+
log.debug(MessageFormat.format("Clicking on {0}", this)); //$NON-NLS-1$
+
+ final SWTBotRadio otherSelectedButton = otherSelectedButton();
+
+ if (otherSelectedButton != null) {
+ otherSelectedButton.notify(SWT.Deactivate);
+ asyncExec(new VoidResult() {
+ public void run() {
+ otherSelectedButton.widget.setSelection(false);
+ }
+ });
+ }
+
+ notify(SWT.Activate);
+ notify(SWT.MouseDown, createMouseEvent(0, 0, 1, 0, 1));
+ notify(SWT.MouseUp, createMouseEvent(0, 0, 1, SWT.BUTTON1, 1));
asyncExec(new VoidResult() {
public void run() {
- deselectOtherRadioButtons();
- log.debug(MessageFormat.format("Clicking on {0}", this)); //$NON-NLS-1$
widget.setSelection(true);
}
+ });
+ notify(SWT.Selection);
+ if (otherSelectedButton != null) {
+ otherSelectedButton.notify(SWT.Selection);
+ }
+ log.debug(MessageFormat.format("Clicked on {0}", this)); //$NON-NLS-1$
+ return this;
+ }
- /**
- * @see "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet224.java?view=co"
- */
- private void deselectOtherRadioButtons() {
+ private SWTBotRadio otherSelectedButton() {
+ Button button = syncExec(new WidgetResult<Button>() {
+ public Button run() {
if (hasStyle(widget.getParent(), SWT.NO_RADIO_GROUP))
- return;
+ return null;
Widget[] siblings = SWTUtils.siblings(widget);
for (Widget widget : siblings) {
if ((widget instanceof Button) && hasStyle(widget, SWT.RADIO))
- ((Button) widget).setSelection(false);
+ if (((Button) widget).getSelection())
+ return (Button) widget;
}
+ return null;
}
});
- notify(SWT.MouseEnter);
- notify(SWT.MouseMove);
- notify(SWT.Activate);
- notify(SWT.FocusIn);
- notify(SWT.MouseDown);
- notify(SWT.MouseUp);
- notify(SWT.Selection);
- notify(SWT.MouseHover);
- notify(SWT.MouseMove);
- notify(SWT.MouseExit);
- notify(SWT.Deactivate);
- notify(SWT.FocusOut);
- log.debug(MessageFormat.format("Clicked on {0}", this)); //$NON-NLS-1$
- return this;
+
+ if (button != null)
+ return new SWTBotRadio(button);
+ return null;
}
/**
diff --git a/org.eclipse.swtbot.test/feature.xml b/org.eclipse.swtbot.test/feature.xml
index 746fa24a..ac42b23a 100644
--- a/org.eclipse.swtbot.test/feature.xml
+++ b/org.eclipse.swtbot.test/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot.test"
label="SWTBot Tests Feature (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org">
<description url="http://eclipse.org/">
@@ -41,6 +41,10 @@
id="org.eclipse.swtbot.ide"
version="0.0.0"/>
+ <includes
+ id="org.eclipse.swtbot.forms"
+ version="0.0.0"/>
+
<requires>
<import plugin="org.eclipse.swt"/>
<import plugin="org.eclipse.swtbot.swt.finder"/>
@@ -97,7 +101,8 @@
id="org.eclipse.swtbot.eclipse.ui.test"
download-size="0"
install-size="0"
- version="0.0.0"/>
+ version="0.0.0"
+ fragment="true"/>
<plugin
id="org.eclipse.swtbot.ant.optional.junit4"
@@ -136,4 +141,17 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.ui.forms.examples"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swtbot.forms.finder.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
diff --git a/org.eclipse.swtbot.updatesite/build.xml b/org.eclipse.swtbot.updatesite/build.xml
index 193b36f7..d80327a5 100644
--- a/org.eclipse.swtbot.updatesite/build.xml
+++ b/org.eclipse.swtbot.updatesite/build.xml
@@ -3,7 +3,6 @@
<taskdef name="purge" classname="com.dallaway.ant.Purge" classpath="../org.eclipse.swtbot.releng/externals/libs/purge.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml" />
- <property name="num.previous.revisions" value="1" />
<property name="target" value="${basedir}/target" />
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="../org.eclipse.swtbot.releng/externals/libs/ant-contrib-1.0b3.jar" />
@@ -12,141 +11,7 @@
</condition>
<echo>${should.generate.archives}: ${has.archives}</echo>
-
- <target name="purge_old_files">
- <echo>Purging feaures</echo>
- <purge keep="${num.previous.revisions}">
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot_*.jar" />
- </fileset>
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot.eclipse_*.jar" />
- </fileset>
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot.eclipse.gef_*.jar" />
- </fileset>
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot.eclipse.test.junit3_*.jar" />
- </fileset>
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot.eclipse.test.junit4_*.jar" />
- </fileset>
- <fileset dir="${target}/features">
- <include name="org.eclipse.swtbot.ide_*.jar" />
- </fileset>
- </purge>
-
- <echo>Purging plugins</echo>
- <purge keep="${num.previous.revisions}">
-
- <!-- demo -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.swt.demo_*.jar" />
- </fileset>
-
- <!-- gef finder -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.gef.finder_*.jar" />
- </fileset>
-
- <!-- eclipse finder -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.finder_*.jar" />
- </fileset>
-
- <!-- finder -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.swt.finder_*.jar" />
- </fileset>
-
- <!-- eclipse ui and core-->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.ui_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.core_*.jar" />
- </fileset>
-
- <!-- spy -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.spy_*.jar" />
- </fileset>
-
- <!-- recorder -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.swt.recorder_*.jar" />
- </fileset>
-
- <!-- recorder ui -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.swt.recorder.ui_*.jar" />
- </fileset>
-
- <!-- junit comptibility -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.junit4_x*.jar" />
- </fileset>
-
- <!-- apache jars -->
- <fileset dir="${target}/plugins">
- <include name="org.apache.log4j_*.jar" />
- </fileset>
-
- <!-- hamcrest jars -->
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.core_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.core.source*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.integration_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.integration.source_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.library_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.library.source_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.text_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.hamcrest.text.source_*.jar" />
- </fileset>
-
- <!-- swt examples -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swt.examples_*.jar" />
- </fileset>
-
- <!-- headless jars -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.ant.optional.junit4_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.ant.optional.junit3_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.junit4.headless_*.jar" />
- </fileset>
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.eclipse.junit3.headless_*.jar" />
- </fileset>
-
- <!-- convenience plugin -->
- <fileset dir="${target}/plugins">
- <include name="org.eclipse.swtbot.go_*.jar" />
- </fileset>
- </purge>
- </target>
-
+
<target name="-create.features.template">
<basename file="${file}" property="file.name" />
<propertyregex property="all.buildId" input="${file.name}" regexp="${featureId}_(.*).jar" select="\1" />
@@ -159,7 +24,7 @@
</concat>
</target>
- <target name="create_features_list" depends="purge_old_files">
+ <target name="create_features_list">
<for param="file">
<path>
<fileset dir="${target}/features" includes="org.eclipse.swtbot_*.jar" />
@@ -226,7 +91,7 @@
<delete dir="build" />
<delete dir="eclipse" />
<mkdir dir="build" />
- <delete dir="${target}" includes="artifacts*.*, content*.*" />
+ <delete dir="${target}" />
</target>
<target name="-create.jars">
@@ -296,5 +161,5 @@
</java>
</target>
- <target name="all" depends="clean, init, purge_old_files, create_features_list, create_plugins_archive_list, create_site_xml, create-p2-site, copy-to-update-site" />
+ <target name="all" depends="clean, init, create_features_list, create_plugins_archive_list, create_site_xml, create-p2-site, copy-to-update-site" />
</project>
diff --git a/org.eclipse.swtbot.updatesite/site.template.org.eclipse.swtbot.featurelist.xml b/org.eclipse.swtbot.updatesite/site.template.org.eclipse.swtbot.featurelist.xml
index 66b7b44b..72542b14 100644
--- a/org.eclipse.swtbot.updatesite/site.template.org.eclipse.swtbot.featurelist.xml
+++ b/org.eclipse.swtbot.updatesite/site.template.org.eclipse.swtbot.featurelist.xml
@@ -4,6 +4,10 @@
<category name="SWTBot SWT Features (incubation)"/>
</feature>
+ <feature url="${update.site.base.url}/features/org.eclipse.swtbot.forms_${all.buildId}.jar" id="org.eclipse.swtbot.forms" version="${all.buildId}">
+ <category name="SWTBot SWT Features (incubation)"/>
+ </feature>
+
<feature url="${update.site.base.url}/features/org.eclipse.swtbot.eclipse_${all.buildId}.jar" id="org.eclipse.swtbot.eclipse" version="${all.buildId}">
<category name="SWTBot Eclipse Features (incubation)"/>
</feature>
diff --git a/org.eclipse.swtbot/feature.xml b/org.eclipse.swtbot/feature.xml
index 809c0d6b..70965a08 100644
--- a/org.eclipse.swtbot/feature.xml
+++ b/org.eclipse.swtbot/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.swtbot"
label="SWTBot for SWT Testing (incubation)"
- version="2.0.3.qualifier"
+ version="2.0.5.qualifier"
provider-name="Eclipse.org"
plugin="org.eclipse.swtbot.eclipse.ui">
diff --git a/org.eclipse.swtbot.junit4_x/_classpath.junit4_3 b/org.eclipse.ui.forms.examples/.classpath
index f8b5dfc3..2fbb7a23 100644..100755
--- a/org.eclipse.swtbot.junit4_x/_classpath.junit4_3
+++ b/org.eclipse.ui.forms.examples/.classpath
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="junit4_3"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.ui.forms.examples/.cvsignore b/org.eclipse.ui.forms.examples/.cvsignore
new file mode 100755
index 00000000..ba077a40
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/org.eclipse.ui.forms.examples/.project b/org.eclipse.ui.forms.examples/.project
new file mode 100755
index 00000000..0039091b
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/.project
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ui.forms.examples</name>
+ <comment></comment>
+ <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/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 00000000..9d6b2a2f
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,53 @@
+#Mon Nov 30 14:26:46 PST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
diff --git a/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.ui.prefs
new file mode 100755
index 00000000..817d509e
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Mon May 16 16:39:49 EDT 2005
+eclipse.preferences.version=1
+internal.default.compliance=default
diff --git a/org.eclipse.ui.forms.examples/.settings/org.eclipse.pde.prefs b/org.eclipse.ui.forms.examples/.settings/org.eclipse.pde.prefs
new file mode 100755
index 00000000..b4438dad
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,12 @@
+#Mon May 16 16:39:49 EDT 2005
+compilers.p.deprecated=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.ui.forms.examples/META-INF/MANIFEST.MF b/org.eclipse.ui.forms.examples/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..b6b86838
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.ui.forms.examples; singleton:=true
+Bundle-Version: 3.1.100
+Bundle-ClassPath: examples.jar
+Bundle-Activator: org.eclipse.ui.forms.examples.internal.ExamplesPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Export-Package: org.eclipse.ui.forms.examples.internal,
+ org.eclipse.ui.forms.examples.internal.dialogs,
+ org.eclipse.ui.forms.examples.internal.rcp,
+ org.eclipse.ui.forms.examples.views
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.eclipse.ui.forms,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.ide
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/org.eclipse.ui.forms.examples/about.html b/org.eclipse.ui.forms.examples/about.html
new file mode 100755
index 00000000..6f6b96c4
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/about.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>February 24, 2005</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.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.swtbot.junit4_x/_build.properties.junit4_3 b/org.eclipse.ui.forms.examples/build.properties
index b97102f8..8a816c6e 100644..100755
--- a/org.eclipse.swtbot.junit4_x/_build.properties.junit4_3
+++ b/org.eclipse.ui.forms.examples/build.properties
@@ -1,19 +1,19 @@
###############################################################################
-# Copyright (c) 2010 Ketan Padegaonkar and others.
+# Copyright (c) 2003, 2009 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:
-# Ketan Padegaonkar - initial API and implementation
+# IBM Corporation - initial API and implementation
###############################################################################
-source.. = junit4_3/,\
- src/
-output.. = bin/
-bin.includes = META-INF/MANIFEST.MF,\
- .,\
- junit4_3/,\
- src/,\
+source.examples.jar = src/
+bin.includes = plugin.xml,\
+ *.jar,\
+ examples.jar,\
+ icons/,\
about.html,\
- LICENSE.EPL
+ META-INF/,\
+ plugin.properties
+output.examples.jar = bin/
diff --git a/org.eclipse.ui.forms.examples/icons/clear.gif b/org.eclipse.ui.forms.examples/icons/clear.gif
new file mode 100755
index 00000000..6bc10f9d
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/clear.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/close_view.gif b/org.eclipse.ui.forms.examples/icons/close_view.gif
new file mode 100755
index 00000000..1aca259d
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/close_view.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/container_obj.gif b/org.eclipse.ui.forms.examples/icons/container_obj.gif
new file mode 100755
index 00000000..f32c28d0
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/container_obj.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/e_search_menu.gif b/org.eclipse.ui.forms.examples/icons/e_search_menu.gif
new file mode 100755
index 00000000..f0f5d834
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/e_search_menu.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/file_obj.gif b/org.eclipse.ui.forms.examples/icons/file_obj.gif
new file mode 100755
index 00000000..6b86d079
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/file_obj.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/form_banner.gif b/org.eclipse.ui.forms.examples/icons/form_banner.gif
new file mode 100755
index 00000000..aebc0b2a
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/form_banner.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/help.gif b/org.eclipse.ui.forms.examples/icons/help.gif
new file mode 100755
index 00000000..9d70301d
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/help.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/help_topic.gif b/org.eclipse.ui.forms.examples/icons/help_topic.gif
new file mode 100755
index 00000000..9bdd5168
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/help_topic.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/large_image.gif b/org.eclipse.ui.forms.examples/icons/large_image.gif
new file mode 100755
index 00000000..c5c94ee9
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/large_image.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/linkto_help.gif b/org.eclipse.ui.forms.examples/icons/linkto_help.gif
new file mode 100755
index 00000000..86550fe9
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/linkto_help.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/newprj_wiz.gif b/org.eclipse.ui.forms.examples/icons/newprj_wiz.gif
new file mode 100755
index 00000000..dc7d3a73
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/newprj_wiz.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/nw.gif b/org.eclipse.ui.forms.examples/icons/nw.gif
new file mode 100755
index 00000000..d0952a85
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/nw.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/progress.gif b/org.eclipse.ui.forms.examples/icons/progress.gif
new file mode 100755
index 00000000..f6a200fd
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/progress.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/sample.gif b/org.eclipse.ui.forms.examples/icons/sample.gif
new file mode 100755
index 00000000..34fb3c9d
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/sample.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/th_horizontal.gif b/org.eclipse.ui.forms.examples/icons/th_horizontal.gif
new file mode 100755
index 00000000..f4c14a4e
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/th_horizontal.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/th_vertical.gif b/org.eclipse.ui.forms.examples/icons/th_vertical.gif
new file mode 100755
index 00000000..f6858398
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/th_vertical.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/toc_closed.gif b/org.eclipse.ui.forms.examples/icons/toc_closed.gif
new file mode 100755
index 00000000..504acb24
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/toc_closed.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/toc_open.gif b/org.eclipse.ui.forms.examples/icons/toc_open.gif
new file mode 100755
index 00000000..9e665d5c
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/toc_open.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/icons/topic_small.gif b/org.eclipse.ui.forms.examples/icons/topic_small.gif
new file mode 100755
index 00000000..17d8b2e7
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/icons/topic_small.gif
Binary files differ
diff --git a/org.eclipse.ui.forms.examples/plugin.properties b/org.eclipse.ui.forms.examples/plugin.properties
new file mode 100755
index 00000000..94ed361b
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/plugin.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2003, 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
+###############################################################################
+pluginName = Examples of Eclipse Forms
+baseEditor = Simple Form (RCP) Editor
+singleHeaderEditor = Single Header Editor
diff --git a/org.eclipse.ui.forms.examples/plugin.xml b/org.eclipse.ui.forms.examples/plugin.xml
new file mode 100755
index 00000000..df18dd98
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/plugin.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?> <!--
+ Copyright (c) 2005, 2009 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
+ -->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.ui.forms.examples.category"
+ name="Eclipse Forms Examples">
+ </category>
+ <command
+ categoryId="org.eclipse.ui.forms.examples.category"
+ defaultHandler="org.eclipse.ui.forms.examples.internal.rcp.OpenSimpleFormEditorAction"
+ id="org.eclipse.ui.forms.examples.simple"
+ name="Simple Form Editor">
+ </command>
+ <command
+ categoryId="org.eclipse.ui.forms.examples.category"
+ defaultHandler="org.eclipse.ui.forms.examples.internal.rcp.OpenSingleHeaderEditorAction"
+ id="org.eclipse.ui.forms.examples.singleHeader"
+ name="Single Header Editor">
+ </command>
+ <command
+ categoryId="org.eclipse.ui.forms.examples.category"
+ defaultHandler="org.eclipse.ui.forms.examples.internal.dialogs.OpenFormDialog"
+ id="org.eclipse.ui.forms.examples.openDialog"
+ name="Open Form Dialog...">
+ </command>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ name="%baseEditor"
+ default="true"
+ icon="icons/file_obj.gif"
+ class="org.eclipse.ui.forms.examples.internal.rcp.SimpleFormEditor"
+ id="org.eclipse.ui.forms.examples.base-editor">
+ </editor>
+ <editor
+ name="%singleHeaderEditor"
+ default="true"
+ icon="icons/file_obj.gif"
+ class="org.eclipse.ui.forms.examples.internal.rcp.SingleHeaderEditor"
+ id="org.eclipse.ui.forms.examples.single-header-editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:org.eclipse.ui.main.menu">
+ <menu
+ label="Form Editors">
+ <command
+ commandId="org.eclipse.ui.forms.examples.simple"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.ui.forms.examples.singleHeader"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.ui.forms.examples.openDialog"
+ style="push">
+ </command>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.ui.resourcePerspective">
+ <view
+ ratio="0.5"
+ relative="org.eclipse.ui.views.TaskList"
+ relationship="right"
+ id="org.eclipse.ui.forms.examples.views.FormView">
+ </view>
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="Eclipse Forms Examples"
+ id="org.eclipse.ui.forms.examples">
+ </category>
+ <view
+ name="Eclipse Form"
+ icon="icons/sample.gif"
+ category="org.eclipse.ui.forms.examples"
+ class="org.eclipse.ui.forms.examples.views.FormView"
+ id="org.eclipse.ui.forms.examples.views.FormView">
+ </view>
+ </extension>
+</plugin>
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPlugin.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPlugin.java
new file mode 100755
index 00000000..269726d8
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPlugin.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * 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.forms.examples.internal;
+import java.net.URL;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class ExamplesPlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static ExamplesPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private FormColors formColors;
+ public static final String IMG_FORM_BG = "formBg";
+ public static final String IMG_LARGE = "large";
+ public static final String IMG_HORIZONTAL = "horizontal";
+ public static final String IMG_VERTICAL = "vertical";
+ public static final String IMG_SAMPLE = "sample";
+ public static final String IMG_WIZBAN = "wizban";
+ public static final String IMG_LINKTO_HELP = "linkto_help";
+ public static final String IMG_HELP_TOPIC = "help_topic";
+ public static final String IMG_CLOSE = "close";
+ public static final String IMG_HELP_CONTAINER = "container_obj";
+ public static final String IMG_HELP_TOC_OPEN = "toc_open";
+ public static final String IMG_HELP_TOC_CLOSED = "toc_closed";
+ public static final String IMG_HELP_SEARCH = "e_search_menu";
+ public static final String IMG_CLEAR = "clear";
+ public static final String IMG_NW = "nw";
+
+ /**
+ * The constructor.
+ */
+ public ExamplesPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle
+ .getBundle("org.eclipse.ui.forms.examples.internal.ExamplesPluginResources");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ registerImage(registry, IMG_FORM_BG, "form_banner.gif");
+ registerImage(registry, IMG_LARGE, "large_image.gif");
+ registerImage(registry, IMG_HORIZONTAL, "th_horizontal.gif");
+ registerImage(registry, IMG_VERTICAL, "th_vertical.gif");
+ registerImage(registry, IMG_SAMPLE, "sample.gif");
+ registerImage(registry, IMG_WIZBAN, "newprj_wiz.gif");
+ registerImage(registry, IMG_LINKTO_HELP, "linkto_help.gif");
+ registerImage(registry, IMG_HELP_TOPIC, "topic.gif");
+ registerImage(registry, IMG_HELP_CONTAINER, "container_obj.gif");
+ registerImage(registry, IMG_HELP_TOC_CLOSED, "toc_closed.gif");
+ registerImage(registry, IMG_HELP_TOC_OPEN, "toc_open.gif");
+ registerImage(registry, IMG_CLOSE, "close_view.gif");
+ registerImage(registry, IMG_HELP_SEARCH, "e_search_menu.gif");
+ registerImage(registry, IMG_CLEAR, "clear.gif");
+ registerImage(registry, IMG_NW, "nw.gif");
+ }
+
+ private void registerImage(ImageRegistry registry, String key,
+ String fileName) {
+ try {
+ IPath path = new Path("icons/" + fileName);
+ URL url = FileLocator.find(getBundle(), path, null);
+ if (url!=null) {
+ ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ registry.put(key, desc);
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ public FormColors getFormColors(Display display) {
+ if (formColors == null) {
+ formColors = new FormColors(display);
+ formColors.markShared();
+ }
+ return formColors;
+ }
+ /**
+ * Returns the shared instance.
+ */
+ public static ExamplesPlugin getDefault() {
+ return plugin;
+ }
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+ /**
+ * Returns the string from the plugin's resource bundle, or 'key' if not
+ * found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = ExamplesPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null ? bundle.getString(key) : key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+ public void stop(BundleContext context) throws Exception {
+ try {
+ if (formColors != null) {
+ formColors.dispose();
+ formColors = null;
+ }
+ } finally {
+ super.stop(context);
+ }
+ }
+ public Image getImage(String key) {
+ return getImageRegistry().get(key);
+ }
+ public ImageDescriptor getImageDescriptor(String key) {
+ return getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPluginResources.properties b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPluginResources.properties
new file mode 100755
index 00000000..339810c1
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPluginResources.properties
@@ -0,0 +1,10 @@
+###############################################################################
+# Copyright (c) 2003, 2004 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
+###############################################################################
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/FormEditorInput.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/FormEditorInput.java
new file mode 100755
index 00000000..5d7dbc5a
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/FormEditorInput.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.*;
+
+public class FormEditorInput implements IEditorInput {
+ private String name;
+ public FormEditorInput(String name) {
+ this.name = name;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ public boolean exists() {
+ return true;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+ ISharedImages.IMG_OBJ_ELEMENT);
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ public String getName() {
+ return name;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return getName();
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/OpenFormEditorAction.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/OpenFormEditorAction.java
new file mode 100755
index 00000000..02cd146c
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/OpenFormEditorAction.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.forms.examples.internal;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+public abstract class OpenFormEditorAction extends AbstractHandler {
+
+ protected Object openEditor(String inputName, String editorId, IWorkbenchWindow window) {
+ return openEditor(new FormEditorInput(inputName), editorId, window);
+ }
+
+ protected Object openEditor(IEditorInput input, String editorId, IWorkbenchWindow window) {
+ IWorkbenchPage page = window.getActivePage();
+ try {
+ page.openEditor(input, editorId);
+ } catch (PartInitException e) {
+ System.out.println(e);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/OpenFormDialog.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/OpenFormDialog.java
new file mode 100755
index 00000000..5b3df3dd
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/OpenFormDialog.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.dialogs;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class OpenFormDialog extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ SampleFormDialog dialog = new SampleFormDialog(window.getShell());
+ dialog.create();
+ dialog.getShell().setText("Sample Form Dialog");
+ dialog.getShell().setSize(500,500);
+ dialog.getShell().setLocation(100, 300);
+ dialog.open();
+ return null;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
new file mode 100755
index 00000000..5ff3c252
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.ui.forms.examples.internal.dialogs;
+
+import org.eclipse.jface.window.IShellProvider;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.FormDialog;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.examples.internal.rcp.FreeFormPage;
+
+public class SampleFormDialog extends FormDialog {
+
+ public SampleFormDialog(Shell shell) {
+ super(shell);
+ }
+
+ public SampleFormDialog(IShellProvider parentShell) {
+ super(parentShell);
+ }
+
+ protected void createFormContent(IManagedForm mform) {
+ mform.getForm().setText("An example of a simple form dialog");
+ FreeFormPage.createSharedFormContent(mform);
+ mform.getForm().setBackgroundImage(null);
+ mform.getToolkit().decorateFormHeading(mform.getForm().getForm());
+ mform.getForm().setImage(
+ PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_ELEMENT));
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java
new file mode 100755
index 00000000..5b6a15d7
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java
@@ -0,0 +1,370 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 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.forms.examples.internal.rcp;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.HyperlinkSettings;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
+import org.eclipse.ui.forms.IMessageManager;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormText;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * This page shows how to use the message manager to handle errors in a form
+ * page.
+ *
+ * @since 3.3
+ */
+public class ErrorMessagesPage extends FormPage {
+
+ /*
+ private RichMessageToolTipManager richToolTipMessageManager;
+ class RichToolTip extends ToolTip {
+ private IManagedForm mform;
+ private FormText text;
+ private String content;
+
+ public RichToolTip(IManagedForm mform, Control control) {
+ super(control);
+ this.mform = mform;
+ setShift(new Point(10, 10));
+ }
+
+ protected Composite createToolTipContentArea(Event event,
+ Composite parent) {
+ this.text = mform.getToolkit().createFormText(parent, true);
+ configureFormText(mform.getForm().getForm(), text);
+ update();
+ return text;
+ }
+
+ public void update(String content) {
+ if (content == null) {
+ // hide
+ deactivate();
+ } else {
+ activate();
+ this.content = content;
+ update();
+ }
+ }
+
+ private void update() {
+ if (text != null && text.isDisposed())
+ text = null;
+ if (text != null) {
+ if (content != null)
+ text.setText(content, true, false);
+ else
+ text.setText("", false, false);
+ }
+ }
+ }
+
+ class RichMessageToolTipManager implements IMessageToolTipManager {
+ private ArrayList toolTips = new ArrayList();
+ private IManagedForm mform;
+
+ public RichMessageToolTipManager(IManagedForm mform) {
+ this.mform = mform;
+ }
+
+ public void createToolTip(Control control, boolean imageLabel) {
+ ToolTip toolTip = new RichToolTip(mform, control);
+ toolTips.add(toolTip);
+ }
+
+ public void setActive(boolean active) {
+ for (int i = 0; i < toolTips.size(); i++) {
+ RichToolTip toolTip = (RichToolTip) toolTips.get(i);
+ if (active)
+ toolTip.activate();
+ else
+ toolTip.deactivate();
+ }
+ }
+
+ public void update() {
+ IMessage[] messages = mform.getForm().getForm()
+ .getChildrenMessages();
+ String content = mform.getForm().getMessage() == null ? null
+ : createFormTextContent(messages);
+ for (int i = 0; i < toolTips.size(); i++) {
+ RichToolTip toolTip = (RichToolTip) toolTips.get(i);
+ toolTip.update(content);
+ }
+ }
+ }
+
+ */
+
+ /**
+ * @param id
+ * @param title
+ */
+ public ErrorMessagesPage(FormEditor editor) {
+ super(editor, "messageManager", "Message Manager");
+ }
+
+ protected void createFormContent(final IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ final FormToolkit toolkit = managedForm.getToolkit();
+ toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(
+ HyperlinkSettings.UNDERLINE_HOVER);
+ form.setText("Example with message handling");
+ toolkit.decorateFormHeading(form.getForm());
+ form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ String title = e.getLabel();
+ // String details = title;
+ Object href = e.getHref();
+ if (href instanceof IMessage[]) {
+ // details =
+ // managedForm.getMessageManager().createSummary((IMessage[])href);
+ }
+ // int type = form.getForm().getMessageType();
+ /*
+ * switch (type) { case IMessageProvider.NONE: case
+ * IMessageProvider.INFORMATION:
+ * MessageDialog.openInformation(form.getShell(), title,
+ * details); break; case IMessageProvider.WARNING:
+ * MessageDialog.openWarning(form.getShell(), title, details);
+ * break; case IMessageProvider.ERROR:
+ * MessageDialog.openError(form.getShell(), title, details);
+ * break; }
+ */
+ Point hl = ((Control) e.widget).toDisplay(0, 0);
+ hl.x += 10;
+ hl.y += 10;
+ Shell shell = new Shell(form.getShell(), SWT.ON_TOP | SWT.TOOL);
+ shell.setImage(getImage(form.getMessageType()));
+ shell.setText(title);
+ shell.setLayout(new FillLayout());
+ // ScrolledFormText stext = new ScrolledFormText(shell, false);
+ // stext.setBackground(toolkit.getColors().getBackground());
+ FormText text = toolkit.createFormText(shell, true);
+ configureFormText(form.getForm(), text);
+ // stext.setFormText(text);
+ if (href instanceof IMessage[])
+ text.setText(createFormTextContent((IMessage[]) href),
+ true, false);
+ shell.setLocation(hl);
+ // Point size = shell.computeSize(400, SWT.DEFAULT);
+ /*
+ richToolTipMessageManager.setActive(false);
+ shell.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ richToolTipMessageManager.setActive(true);
+ }
+ });
+ */
+ shell.pack();
+ shell.open();
+ }
+ });
+
+ //richToolTipMessageManager = new RichMessageToolTipManager(managedForm);
+ //form.getForm().setMessageToolTipManager(richToolTipMessageManager);
+
+ final IMessageManager mmng = managedForm.getMessageManager();
+
+ TableWrapLayout layout = new TableWrapLayout();
+ form.getBody().setLayout(layout);
+ Section section = toolkit.createSection(form.getBody(),
+ Section.TITLE_BAR);
+ section.setText("Local field messages");
+ Composite sbody = toolkit.createComposite(section);
+ section.setClient(sbody);
+ GridLayout glayout = new GridLayout();
+ glayout.horizontalSpacing = 10;
+ glayout.numColumns = 2;
+ sbody.setLayout(glayout);
+ toolkit.paintBordersFor(sbody);
+ createDecoratedTextField("Field1", toolkit, sbody, mmng);
+ createDecoratedTextField("Field2", toolkit, sbody, mmng);
+ createDecoratedTextField("Field3", toolkit, sbody, mmng);
+ final Button button1 = toolkit.createButton(form.getBody(),
+ "Add general error", SWT.CHECK);
+ button1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (button1.getSelection()) {
+ mmng.addMessage("saveError", "Save Error", null,
+ IMessageProvider.ERROR);
+ } else {
+ mmng.removeMessage("saveError");
+ }
+ }
+ });
+ final Button button2 = toolkit.createButton(form.getBody(),
+ "Add static message", SWT.CHECK);
+ button2.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (button2.getSelection()) {
+ mmng.addMessage("info", "Secondary info", null,
+ IMessageProvider.NONE);
+ } else {
+ mmng.removeMessage("info");
+ }
+ }
+ });
+ final Button button3 = toolkit.createButton(form.getBody(),
+ "Auto update", SWT.CHECK);
+ button3.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ mmng.setAutoUpdate(button3.getSelection());
+ }
+ });
+ button3.setSelection(true);
+ }
+
+ private Image getImage(int type) {
+ switch (type) {
+ case IMessageProvider.ERROR:
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJS_ERROR_TSK);
+ case IMessageProvider.WARNING:
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJS_WARN_TSK);
+ case IMessageProvider.INFORMATION:
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ return null;
+ }
+
+ private void configureFormText(final Form form, FormText text) {
+ text.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ String is = (String)e.getHref();
+ try {
+ int index = Integer.parseInt(is);
+ IMessage [] messages = form.getChildrenMessages();
+ IMessage message =messages[index];
+ Control c = message.getControl();
+ ((FormText)e.widget).getShell().dispose();
+ if (c!=null)
+ c.setFocus();
+ }
+ catch (NumberFormatException ex) {
+ }
+ }
+ });
+ text.setImage("error", getImage(IMessageProvider.ERROR));
+ text.setImage("warning", getImage(IMessageProvider.WARNING));
+ text.setImage("info", getImage(IMessageProvider.INFORMATION));
+ }
+
+ String createFormTextContent(IMessage[] messages) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ pw.println("<form>");
+ for (int i = 0; i < messages.length; i++) {
+ IMessage message = messages[i];
+ pw
+ .print("<li vspace=\"false\" style=\"image\" indent=\"16\" value=\"");
+ switch (message.getMessageType()) {
+ case IMessageProvider.ERROR:
+ pw.print("error");
+ break;
+ case IMessageProvider.WARNING:
+ pw.print("warning");
+ break;
+ case IMessageProvider.INFORMATION:
+ pw.print("info");
+ break;
+ }
+ pw.print("\"> <a href=\"");
+ pw.print(i+"");
+ pw.print("\">");
+ if (message.getPrefix() != null)
+ pw.print(message.getPrefix());
+ pw.print(message.getMessage());
+ pw.println("</a></li>");
+ }
+ pw.println("</form>");
+ pw.flush();
+ return sw.toString();
+ }
+
+ private void createDecoratedTextField(String label, FormToolkit toolkit,
+ Composite parent, final IMessageManager mmng) {
+ toolkit.createLabel(parent, label);
+ final Text text = toolkit.createText(parent, "");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 150;
+ text.setLayoutData(gd);
+ text.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ String s = text.getText();
+ // flag length
+ if (s.length() > 0 && s.length() <= 5) {
+ mmng.addMessage("textLength",
+ "Text is longer than 0 characters", null,
+ IMessageProvider.INFORMATION, text);
+ } else if (s.length() > 5 && s.length() <= 10) {
+ mmng.addMessage("textLength",
+ "Text is longer than 5 characters", null,
+ IMessageProvider.WARNING, text);
+ } else if (s.length() > 10) {
+ mmng.addMessage("textLength",
+ "Text is longer than 10 characters", null,
+ IMessageProvider.ERROR, text);
+ } else {
+ mmng.removeMessage("textLength", text);
+ }
+ // flag type
+ boolean badType = false;
+ for (int i = 0; i < s.length(); i++) {
+ if (!Character.isLetter(s.charAt(i))) {
+ badType = true;
+ break;
+ }
+ }
+ if (badType) {
+ mmng.addMessage("textType",
+ "Text must only contain letters", null,
+ IMessageProvider.ERROR, text);
+ } else {
+ mmng.removeMessage("textType", text);
+ }
+ }
+ });
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java
new file mode 100755
index 00000000..1fb63d94
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+import java.io.*;
+import java.io.InputStream;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.editor.*;
+import org.eclipse.ui.forms.events.*;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.*;
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class FreeFormPage extends FormPage {
+ /**
+ * @param id
+ * @param title
+ */
+ public FreeFormPage(FormEditor editor) {
+ super(editor, "first", "First Page");
+ }
+ public static final void createSharedFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
+ form.setText("Free-form text with links");
+ form.setBackgroundImage(ExamplesPlugin.getDefault().getImage(ExamplesPlugin.IMG_FORM_BG));
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.leftMargin = 10;
+ layout.rightMargin = 10;
+ form.getBody().setLayout(layout);
+ TableWrapData td;
+ Hyperlink link = toolkit.createHyperlink(form.getBody(),
+ "Sample hyperlink with longer text.", SWT.WRAP);
+ link.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ }
+ }
+ });
+ td = new TableWrapData();
+ td.align = TableWrapData.LEFT;
+ link.setLayoutData(td);
+ createExpandable(form, toolkit);
+ createFormTextSection(form, toolkit);
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ createSharedFormContent(managedForm);
+ }
+ private static void createExpandable(final ScrolledForm form, final FormToolkit toolkit) {
+ final ExpandableComposite exp = toolkit.createExpandableComposite(form
+ .getBody(), ExpandableComposite.TREE_NODE
+ // ExpandableComposite.NONE
+ );
+ exp.setActiveToggleColor(toolkit.getHyperlinkGroup()
+ .getActiveForeground());
+ exp.setToggleColor(toolkit.getColors().getColor(IFormColors.SEPARATOR));
+ Composite client = toolkit.createComposite(exp);
+ exp.setClient(client);
+ TableWrapLayout elayout = new TableWrapLayout();
+ client.setLayout(elayout);
+ elayout.leftMargin = elayout.rightMargin = 0;
+ final Button button = toolkit.createButton(client, "Button", SWT.PUSH);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ //openFormWizard(button.getShell(), toolkit.getColors());
+ }
+ });
+ exp.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ form.reflow(true);
+ }
+ });
+ exp.setText("Expandable Section with a longer title");
+ TableWrapData td = new TableWrapData();
+ //td.colspan = 2;
+ td.align = TableWrapData.LEFT;
+ //td.align = TableWrapData.FILL;
+ exp.setLayoutData(td);
+ }
+
+ private static void createFormTextSection(final ScrolledForm form, FormToolkit toolkit) {
+ Section section =
+ toolkit.createSection(
+ form.getBody(),
+ Section.TWISTIE | Section.DESCRIPTION);
+ section.setActiveToggleColor(
+ toolkit.getHyperlinkGroup().getActiveForeground());
+ section.setToggleColor(
+ toolkit.getColors().getColor(IFormColors.SEPARATOR));
+ toolkit.createCompositeSeparator(section);
+ FormText rtext = toolkit.createFormText(section, false);
+ section.setClient(rtext);
+ loadFormText(rtext, toolkit);
+
+ section.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ form.reflow(false);
+ }
+ });
+
+ section.setText("Section title");
+ section.setDescription(
+ "This is a section description that should be rendered below the separator.");
+ TableWrapData td = new TableWrapData();
+ td.align = TableWrapData.FILL;
+ td.grabHorizontal = true;
+ section.setLayoutData(td);
+ }
+
+ private static void loadFormText(final FormText rtext, FormToolkit toolkit) {
+ rtext.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ MessageDialog.openInformation(rtext.getShell(), "Eclipse Forms",
+ "Link activated: href=" + e.getHref());
+ }
+ });
+ rtext.setHyperlinkSettings(toolkit.getHyperlinkGroup());
+ rtext.setImage("image1", ExamplesPlugin.getDefault().getImage(ExamplesPlugin.IMG_LARGE));
+ createCompositeControl(rtext, toolkit);
+ createControl(rtext, toolkit);
+ Menu menu = new Menu(rtext);
+ final MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("&Copy");
+ item.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ rtext.copy();
+ }
+ });
+ //rtext.setMenu(menu);
+ item.setEnabled(false);
+ rtext.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ item.setEnabled(rtext.canCopy());
+ }
+ });
+ InputStream is = FreeFormPage.class.getResourceAsStream("index.xml");
+ if (is!=null) {
+ rtext.setContents(is, true);
+ try {
+ is.close();
+ }
+ catch (IOException e) {
+ }
+ }
+ }
+ private static void createControl(FormText ftext, FormToolkit toolkit) {
+ TreeNode node = new TreeNode(ftext, SWT.NULL);
+ toolkit.adapt(node, true, true);
+ ftext.setControl("node", node);
+ }
+ private static void createCompositeControl(FormText ftext, FormToolkit toolkit) {
+ Composite comp = toolkit.createComposite(ftext);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ comp.setLayout(layout);
+ toolkit.createLabel(comp, "Sample text:");
+ Text text = toolkit.createText(comp, "");
+ text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ toolkit.createButton(comp, "Browse...", SWT.PUSH);
+ ftext.setControl("control1", comp);
+ toolkit.paintBordersFor(comp);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/HeadlessPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/HeadlessPage.java
new file mode 100755
index 00000000..20814f10
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/HeadlessPage.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.ui.forms.examples.internal.rcp;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class HeadlessPage extends FormPage {
+ private int count;
+
+ public HeadlessPage(FormEditor editor, int count) {
+ super(editor, "page"+count, "Page "+count);
+ this.count = count;
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ Composite body = managedForm.getForm().getBody();
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 4;
+ body.setLayout(layout);
+ Label label = toolkit.createLabel(body, "The content of the headless page #"+count);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 4;
+ label.setLayoutData(gd);
+ for (int i=0; i<80; i++) {
+ toolkit.createLabel(body, "Field "+i);
+ Text text = toolkit.createText(body, null);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(gd);
+ }
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/IModelListener.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/IModelListener.java
new file mode 100755
index 00000000..8b432f44
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/IModelListener.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public interface IModelListener {
+ String ADDED="__added";
+ String REMOVED="__removed";
+ String CHANGED = "__changed";
+ void modelChanged(Object[] objects, String type, String property);
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NamedObject.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NamedObject.java
new file mode 100755
index 00000000..d62aa840
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NamedObject.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+
+/**
+ *
+ */
+public class NamedObject {
+ private String name;
+ protected SimpleModel model;
+
+ public NamedObject(String name) {
+ this.name = name;
+ }
+ public void setModel(SimpleModel model) {
+ this.model = model;
+ }
+ public String getName() {
+ return name;
+ }
+ public String toString() {
+ return getName();
+ }
+ public void setName(String name) {
+ this.name = name;
+ model.fireModelChanged(new Object [] {this}, IModelListener.CHANGED, "");
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java
new file mode 100755
index 00000000..c2edd4db
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java
@@ -0,0 +1,581 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 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.forms.examples.internal.rcp;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ControlContribution;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.HyperlinkSettings;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessageManager;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class NewStylePage extends FormPage {
+ private static final String SHORT_TITLE = "Short Title";
+ private static final String LONG_TITLE = "This title is somewhat longer";
+ private static final String SHORT_MESSAGE = "A short {0} message";
+ private static final String LONG_MESSAGE = "This {0} message is longer and will also compete with other header regions";
+ private static final String[] MESSAGE_NAMES = { "text", "info", "warning",
+ "error" };
+
+ /**
+ * @param id
+ * @param title
+ */
+ public NewStylePage(FormEditor editor) {
+ super(editor, "newStyle", "New Style");
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ final FormToolkit toolkit = managedForm.getToolkit();
+ toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(
+ HyperlinkSettings.UNDERLINE_HOVER);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 10;
+ layout.marginWidth = 6;
+ layout.horizontalSpacing = 20;
+ form.getBody().setLayout(layout);
+
+ Section section = toolkit.createSection(form.getBody(),
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
+ Composite client = toolkit.createComposite(section);
+ section.setClient(client);
+ section.setText("Header features");
+ section
+ .setDescription("Use the switches below to control basic heading parameters.");
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ section.setLayoutData(gd);
+ layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ client.setLayout(layout);
+ final Button tbutton = toolkit.createButton(client, "Add title",
+ SWT.CHECK);
+ final Button sbutton = toolkit.createButton(client, "Short title",
+ SWT.RADIO);
+ sbutton.setSelection(true);
+ sbutton.setEnabled(false);
+ gd = new GridData();
+ gd.horizontalIndent = 10;
+ sbutton.setLayoutData(gd);
+ final Button lbutton = toolkit.createButton(client, "Long title",
+ SWT.RADIO);
+ gd = new GridData();
+ gd.horizontalIndent = 10;
+ lbutton.setLayoutData(gd);
+ lbutton.setEnabled(false);
+ tbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateTitle(form, tbutton.getSelection(), sbutton
+ .getSelection());
+ sbutton.setEnabled(tbutton.getSelection());
+ lbutton.setEnabled(tbutton.getSelection());
+ }
+ });
+ sbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateTitle(form, tbutton.getSelection(), sbutton
+ .getSelection());
+ }
+ });
+ lbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateTitle(form, tbutton.getSelection(), sbutton
+ .getSelection());
+ }
+ });
+ final Button ibutton = toolkit.createButton(client, "Add image",
+ SWT.CHECK);
+ ibutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateImage(form, ibutton.getSelection());
+ }
+ });
+
+ final Button tbbutton = toolkit.createButton(client, "Add tool bar",
+ SWT.CHECK);
+
+ final Button albutton = toolkit.createButton(client, "Set tool bar allignment to SWT.BOTTOM",
+ SWT.CHECK);
+ albutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.getForm().setToolBarVerticalAlignment(albutton.getSelection()?SWT.BOTTOM:SWT.TOP);
+ form.reflow(true);
+ }
+ });
+ gd = new GridData();
+ gd.horizontalIndent = 10;
+ albutton.setLayoutData(gd);
+ albutton.setEnabled(false);
+ tbbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ addToolBar(toolkit, form, tbbutton.getSelection());
+ albutton.setEnabled(tbbutton.getSelection());
+ }
+ });
+
+ final Button gbutton = toolkit.createButton(client,
+ "Paint background gradient", SWT.CHECK);
+ gbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ addHeadingGradient(toolkit, form, gbutton.getSelection());
+ }
+ });
+
+ final Button clbutton = toolkit.createButton(client, "Add head client",
+ SWT.CHECK);
+ clbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ addHeadClient(toolkit, form, clbutton.getSelection());
+ }
+ });
+
+ final Button mbutton = toolkit.createButton(client,
+ "Add drop-down menu", SWT.CHECK);
+ mbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ addMenu(toolkit, form, mbutton.getSelection());
+ }
+ });
+
+ final Button dbutton = toolkit.createButton(client, "Add drag support",
+ SWT.CHECK);
+ dbutton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (dbutton.getSelection()) {
+ addDragSupport(form);
+ dbutton.setEnabled(false);
+ }
+ }
+ });
+
+ section = toolkit.createSection(form.getBody(),
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
+ Composite client2 = toolkit.createComposite(section);
+ section.setClient(client2);
+ section.setText("Messages and active state");
+ section
+ .setDescription("Use the buttons below to control messages and active state.");
+ gd = new GridData(GridData.FILL_BOTH);
+ section.setLayoutData(gd);
+
+ layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.numColumns = 4;
+ client2.setLayout(layout);
+
+ final Button shortMessage = toolkit.createButton(client2,
+ "Short message", SWT.RADIO);
+ shortMessage.setSelection(true);
+ gd = new GridData();
+ gd.horizontalSpan = 4;
+ shortMessage.setLayoutData(gd);
+ final Button longMessage = toolkit.createButton(client2, "Long message",
+ SWT.RADIO);
+ gd = new GridData();
+ gd.horizontalSpan = 4;
+ longMessage.setLayoutData(gd);
+
+ final IHyperlinkListener listener = new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ String title = e.getLabel();
+ String details = (String)e.getHref();
+ if (details==null) {
+ details = title;
+ title = null;
+ }
+ switch (form.getForm().getMessageType()) {
+ case IMessageProvider.NONE:
+ case IMessageProvider.INFORMATION:
+ if (title==null)
+ title = "Forms Information";
+ MessageDialog.openInformation(form.getShell(), title, details);
+ break;
+ case IMessageProvider.WARNING:
+ if (title==null)
+ title = "Forms Warning";
+ MessageDialog.openWarning(form.getShell(), title, details);
+ break;
+ case IMessageProvider.ERROR:
+ if (title==null)
+ title = "Forms Error";
+ MessageDialog.openError(form.getShell(), title, details);
+ break;
+ }
+ }
+ };
+
+ final Button hyperMessage = toolkit.createButton(client2,
+ "Message as hyperlink", SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 4;
+ hyperMessage.setLayoutData(gd);
+ hyperMessage.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (hyperMessage.getSelection())
+ form.getForm().addMessageHyperlinkListener(listener);
+ else
+ form.getForm().removeMessageHyperlinkListener(listener);
+ }
+ });
+
+ Control[] children = client.getChildren();
+ ArrayList buttons = new ArrayList();
+ for (int i = 0; i < children.length; i++) {
+ if (children[i] instanceof Button) {
+ Button button = (Button) children[i];
+ if ((button.getStyle() & SWT.CHECK) != 0 && !button.equals(dbutton)) {
+ buttons.add(button);
+ }
+ }
+ }
+ final Button[] checkboxes = (Button[]) buttons.toArray(new Button[buttons.size()]);
+
+ final Button manageMessage = toolkit.createButton(client2,
+ "Use message manager", SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 4;
+ manageMessage.setLayoutData(gd);
+
+ SelectionAdapter mmListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (manageMessage.getSelection() && e.widget instanceof Button)
+ addRemoveMessage((Button) e.widget, form.getMessageManager());
+ }
+ };
+ for (int i = 0; i < checkboxes.length; i++)
+ checkboxes[i].addSelectionListener(mmListener);
+
+ final Button autoUpdate = toolkit.createButton(client2,
+ "Auto update message manager", SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 4;
+ autoUpdate.setLayoutData(gd);
+ autoUpdate.setSelection(true);
+ autoUpdate.setEnabled(false);
+ autoUpdate.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.getMessageManager().setAutoUpdate(autoUpdate.getSelection());
+ }
+ });
+
+ shortMessage.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(getErrorMessage(form.getMessageType(),
+ longMessage.getSelection()), form.getMessageType());
+ }
+ });
+ longMessage.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(getErrorMessage(form.getMessageType(),
+ longMessage.getSelection()), form.getMessageType());
+ }
+ });
+
+ final Button error = toolkit.createButton(client2, "Error", SWT.PUSH);
+ error.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(getErrorMessage(IMessageProvider.ERROR,
+ longMessage.getSelection()), IMessageProvider.ERROR);
+
+ }
+ });
+ final Button warning = toolkit.createButton(client2, "Warning", SWT.PUSH);
+ warning.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(getErrorMessage(IMessageProvider.WARNING,
+ longMessage.getSelection()), IMessageProvider.WARNING);
+ }
+ });
+ final Button info = toolkit.createButton(client2, "Info", SWT.PUSH);
+ info.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(getErrorMessage(IMessageProvider.INFORMATION,
+ longMessage.getSelection()),
+ IMessageProvider.INFORMATION);
+ }
+ });
+ final Button cancel = toolkit.createButton(client2, "Cancel", SWT.PUSH);
+ cancel.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ form.setMessage(null, 0);
+ }
+ });
+ manageMessage.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean selection = manageMessage.getSelection();
+ if (!selection)
+ autoUpdate.setSelection(true);
+ autoUpdate.setEnabled(selection);
+ IMessageManager mm = form.getMessageManager();
+ mm.setAutoUpdate(false);
+ if (selection) {
+ for (int i = 0; i < checkboxes.length; i++) {
+ addRemoveMessage(checkboxes[i], mm);
+ }
+ }
+ else {
+ mm.removeAllMessages();
+ }
+ mm.setAutoUpdate(true);
+ error.setEnabled(!selection);
+ warning.setEnabled(!selection);
+ info.setEnabled(!selection);
+ cancel.setEnabled(!selection);
+ if (selection) {
+ hyperMessage.setSelection(false);
+ form.getForm().removeMessageHyperlinkListener(listener);
+ }
+ hyperMessage.setEnabled(!selection);
+ }
+ });
+
+ final Button busy = toolkit.createButton(client2, "Start Progress",
+ SWT.PUSH);
+ busy.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // IWorkbenchSiteProgressService service =
+ // (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
+
+ if (form.getForm().isBusy()) {
+ form.getForm().setBusy(false);
+ busy.setText("Start Progress");
+ } else {
+ form.getForm().setBusy(true);
+ busy.setText("Stop Progress");
+ }
+ }
+ });
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ busy.setLayoutData(gd);
+ }
+
+ private void addHeadingGradient(FormToolkit toolkit, ScrolledForm form,
+ boolean add) {
+ FormColors colors = toolkit.getColors();
+ Color top = colors.getColor(IFormColors.H_GRADIENT_END);
+ Color bot = colors.getColor(IFormColors.H_GRADIENT_START);
+ if (add)
+ form.getForm().setTextBackground(new Color[] { top, bot },
+ new int[] { 100 }, true);
+ else {
+ form.getForm().setTextBackground(null, null, false);
+ form.getForm().setBackground(colors.getBackground());
+ }
+ form.getForm().setHeadColor(IFormColors.H_BOTTOM_KEYLINE1,
+ add ? colors.getColor(IFormColors.H_BOTTOM_KEYLINE1) : null);
+ form.getForm().setHeadColor(IFormColors.H_BOTTOM_KEYLINE2,
+ add ? colors.getColor(IFormColors.H_BOTTOM_KEYLINE2) : null);
+ form.getForm().setHeadColor(IFormColors.H_HOVER_LIGHT,
+ add ? colors.getColor(IFormColors.H_HOVER_LIGHT) : null);
+ form.getForm().setHeadColor(IFormColors.H_HOVER_FULL,
+ add ? colors.getColor(IFormColors.H_HOVER_FULL) : null);
+ form.getForm().setHeadColor(IFormColors.TB_TOGGLE,
+ add ? colors.getColor(IFormColors.TB_TOGGLE) : null);
+ form.getForm().setHeadColor(IFormColors.TB_TOGGLE_HOVER,
+ add ? colors.getColor(IFormColors.TB_TOGGLE_HOVER) : null);
+ form.getForm().setSeparatorVisible(add);
+ form.reflow(true);
+ form.redraw();
+ }
+
+ private String getErrorMessage(int type, boolean longMessage) {
+ String name = MESSAGE_NAMES[type];
+ if (longMessage)
+ return MessageFormat.format(LONG_MESSAGE, new Object[] { name });
+ else
+ return MessageFormat.format(SHORT_MESSAGE, new Object[] { name });
+ }
+
+ private void updateTitle(ScrolledForm form, boolean addTitle,
+ boolean shortTitle) {
+ if (addTitle) {
+ String text = shortTitle ? SHORT_TITLE : LONG_TITLE;
+ form.setText(text);
+ } else {
+ form.setText(null);
+ }
+ }
+
+ private void updateImage(ScrolledForm form, boolean addImage) {
+ if (addImage)
+ form.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_DEF_VIEW));
+ else
+ form.setImage(null);
+ }
+
+ private void addRemoveMessage(Button button, IMessageManager mm) {
+ if (button.getSelection())
+ mm.addMessage(button, button.getText() + " is checked.", null, IMessageProvider.INFORMATION, button);
+ else
+ mm.removeMessage(button, button);
+ }
+
+ private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
+ if (add) {
+ Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ haction.setChecked(true);
+ haction.setToolTipText("Horizontal orientation");
+ haction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(
+ ExamplesPlugin.IMG_HORIZONTAL));
+ Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ vaction.setChecked(false);
+ vaction.setToolTipText("Vertical orientation");
+ vaction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(
+ ExamplesPlugin.IMG_VERTICAL));
+ ControlContribution save = new ControlContribution("save") {
+ protected Control createControl(Composite parent) {
+ Button saveButton = new Button(parent, SWT.PUSH);
+ saveButton.setText("Save");
+ return saveButton;
+ }
+ };
+ form.getToolBarManager().add(haction);
+ form.getToolBarManager().add(vaction);
+ form.getToolBarManager().add(save);
+ form.getToolBarManager().update(true);
+ } else {
+ form.getToolBarManager().removeAll();
+ }
+ form.reflow(true);
+ }
+
+ private void addMenu(FormToolkit toolkit, ScrolledForm form, boolean add) {
+ if (add) {
+ Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ haction.setChecked(true);
+ haction.setText("Horizontal");
+ haction.setToolTipText("Horizontal orientation");
+ haction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(
+ ExamplesPlugin.IMG_HORIZONTAL));
+ Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ vaction.setChecked(false);
+ vaction.setText("Vertical");
+ vaction.setToolTipText("Vertical orientation");
+ vaction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(
+ ExamplesPlugin.IMG_VERTICAL));
+ form.getForm().getMenuManager().add(haction);
+ form.getForm().getMenuManager().add(vaction);
+ } else {
+ form.getForm().getMenuManager().removeAll();
+ }
+ form.reflow(true);
+ }
+
+ private void addHeadClient(FormToolkit toolkit, ScrolledForm form,
+ boolean add) {
+ if (add) {
+ Composite headClient = new Composite(form.getForm().getHead(),
+ SWT.NULL);
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = 0;
+ glayout.numColumns = 3;
+ headClient.setLayout(glayout);
+ Text t = new Text(headClient, toolkit.getBorderStyle());
+ t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ new Combo(headClient, SWT.NULL);
+ new Combo(headClient, SWT.NULL);
+ toolkit.paintBordersFor(headClient);
+ form.setHeadClient(headClient);
+ } else {
+ Control client = form.getForm().getHeadClient();
+ if (client != null) {
+ client.dispose();
+ form.setHeadClient(null);
+ }
+ }
+ }
+
+ private void addDragSupport(final ScrolledForm form) {
+ int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
+ Transfer[] transferTypes = { TextTransfer.getInstance() };
+ form.getForm().addTitleDragSupport(operations, transferTypes,
+ new DragSourceListener() {
+ public void dragFinished(DragSourceEvent event) {
+ }
+
+ public void dragSetData(DragSourceEvent event) {
+ event.data = form.getForm().getText();
+ }
+
+ public void dragStart(DragSourceEvent event) {
+ event.doit = true;
+ }
+ });
+ form.getForm().addTitleDropSupport(operations, transferTypes,
+ new DropTargetAdapter() {
+ });
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSimpleFormEditorAction.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSimpleFormEditorAction.java
new file mode 100755
index 00000000..91af4810
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSimpleFormEditorAction.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.forms.examples.internal.OpenFormEditorAction;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class OpenSimpleFormEditorAction extends OpenFormEditorAction {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ return openEditor(new SimpleFormEditorInput("Simple Editor"), "org.eclipse.ui.forms.examples.base-editor", window);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSingleHeaderEditorAction.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSingleHeaderEditorAction.java
new file mode 100755
index 00000000..27d3c8b5
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSingleHeaderEditorAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.forms.examples.internal.OpenFormEditorAction;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class OpenSingleHeaderEditorAction extends OpenFormEditorAction {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ return openEditor(new SimpleFormEditorInput("Single Header Editor"),
+ "org.eclipse.ui.forms.examples.single-header-editor", window);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/PageWithSubPages.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/PageWithSubPages.java
new file mode 100755
index 00000000..7aa310bd
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/PageWithSubPages.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.editor.*;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.*;
+/**
+ *
+ */
+public class PageWithSubPages extends FormPage {
+ private CTabFolder tabFolder;
+ private Text text;
+
+ class TextSection {
+ String text;
+ public TextSection(String text) {this.text = text;}
+ }
+ /**
+ * @param id
+ * @param title
+ */
+ public PageWithSubPages(FormEditor editor) {
+ super(editor, "composite", "Composite Page");
+ }
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Form with subpages");
+ form.setBackgroundImage(ExamplesPlugin.getDefault().getImage(
+ ExamplesPlugin.IMG_FORM_BG));
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 10;
+ form.getBody().setLayout(layout);
+ tabFolder = new CTabFolder(form.getBody(), SWT.FLAT|SWT.TOP);
+ toolkit.adapt(tabFolder, true, true);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 0;
+ tabFolder.setLayoutData(gd);
+ Color selectedColor = toolkit.getColors().getColor(IFormColors.SEPARATOR);
+ tabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {50});
+ //tabFolder.setCursor(FormsResources.getHandCursor());
+
+ toolkit.paintBordersFor(tabFolder);
+ createTabs(toolkit);
+ createText(toolkit, form.getBody());
+ tabFolder.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateSelection();
+ }
+ });
+ tabFolder.setSelection(0);
+ updateSelection();
+ }
+ private void createTabs(FormToolkit toolkit) {
+ createTab(toolkit, "Copyright", "Copyright 2004 IBM and others.");
+ createTab(toolkit, "License Agreement", "LICENSE AGREEMENT\n\nUse this feature any way you want.");
+ createTab(toolkit, "Description", "A simple description of the feature");
+ }
+ private void createText(FormToolkit toolkit, Composite parent) {
+ Composite tabContent = toolkit.createComposite(parent);
+ tabContent.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout layout = new GridLayout();
+ tabContent.setLayout(layout);
+ layout.numColumns = 2;
+ layout.marginWidth = 0;
+ GridData gd;
+ text = toolkit.createText(tabContent, "", SWT.MULTI|SWT.WRAP);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.verticalSpan = 2;
+ text.setLayoutData(gd);
+ Button apply = toolkit.createButton(tabContent, "Apply", SWT.PUSH);
+ apply.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL|GridData.VERTICAL_ALIGN_BEGINNING));
+ Button reset = toolkit.createButton(tabContent, "Reset", SWT.PUSH);
+ reset.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL|GridData.VERTICAL_ALIGN_BEGINNING));
+ }
+ private void updateSelection() {
+ CTabItem item = tabFolder.getSelection();
+ TextSection section = (TextSection)item.getData();
+ text.setText(section.text);
+ }
+ private void createTab(FormToolkit toolkit, String title, String content) {
+ CTabItem item = new CTabItem(tabFolder, SWT.NULL);
+ TextSection section = new TextSection(content);
+ item.setText(title);
+ item.setData(section);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java
new file mode 100755
index 00000000..f25a6133
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.*;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.*;
+/**
+ *
+ */
+public class ScrolledPropertiesBlock extends MasterDetailsBlock {
+ private FormPage page;
+ public ScrolledPropertiesBlock(FormPage page) {
+ this.page = page;
+ }
+ /**
+ * @param id
+ * @param title
+ */
+ class MasterContentProvider implements IStructuredContentProvider {
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof SimpleFormEditorInput) {
+ SimpleFormEditorInput input = (SimpleFormEditorInput) page
+ .getEditor().getEditorInput();
+ return input.getModel().getContents();
+ }
+ return new Object[0];
+ }
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ }
+ class MasterLabelProvider extends LabelProvider
+ implements
+ ITableLabelProvider {
+ public String getColumnText(Object obj, int index) {
+ return obj.toString();
+ }
+ public Image getColumnImage(Object obj, int index) {
+ if (obj instanceof TypeOne) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_ELEMENT);
+ }
+ if (obj instanceof TypeTwo) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FILE);
+ }
+ return null;
+ }
+ }
+ protected void createMasterPart(final IManagedForm managedForm,
+ Composite parent) {
+ //final ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ Section section = toolkit.createSection(parent, Section.DESCRIPTION);
+ section.setText("Model Objects");
+ section
+ .setDescription("The list contains objects from the model whose details are editable on the right");
+ section.marginWidth = 10;
+ section.marginHeight = 5;
+ toolkit.createCompositeSeparator(section);
+ Composite client = toolkit.createComposite(section, SWT.WRAP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 2;
+ layout.marginHeight = 2;
+ client.setLayout(layout);
+ Table t = toolkit.createTable(client, SWT.NULL);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 20;
+ gd.widthHint = 100;
+ t.setLayoutData(gd);
+ toolkit.paintBordersFor(client);
+ Button b = toolkit.createButton(client, "Add...", SWT.PUSH);
+ gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ b.setLayoutData(gd);
+ section.setClient(client);
+ final SectionPart spart = new SectionPart(section);
+ managedForm.addPart(spart);
+ TableViewer viewer = new TableViewer(t);
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ managedForm.fireSelectionChanged(spart, event.getSelection());
+ }
+ });
+ viewer.setContentProvider(new MasterContentProvider());
+ viewer.setLabelProvider(new MasterLabelProvider());
+ viewer.setInput(page.getEditor().getEditorInput());
+ }
+ protected void createToolBarActions(IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ sashForm.setOrientation(SWT.HORIZONTAL);
+ form.reflow(true);
+ }
+ };
+ haction.setChecked(true);
+ haction.setToolTipText("Horizontal orientation");
+ haction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry()
+ .getDescriptor(ExamplesPlugin.IMG_HORIZONTAL));
+ Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ sashForm.setOrientation(SWT.VERTICAL);
+ form.reflow(true);
+ }
+ };
+ vaction.setChecked(false);
+ vaction.setToolTipText("Vertical orientation");
+ vaction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(ExamplesPlugin.IMG_VERTICAL));
+ form.getToolBarManager().add(haction);
+ form.getToolBarManager().add(vaction);
+ }
+ protected void registerPages(DetailsPart detailsPart) {
+ detailsPart.registerPage(TypeOne.class, new TypeOneDetailsPage());
+ detailsPart.registerPage(TypeTwo.class, new TypeTwoDetailsPage());
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesPage.java
new file mode 100755
index 00000000..e8f0239c
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesPage.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.*;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.*;
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class ScrolledPropertiesPage extends FormPage {
+ private ScrolledPropertiesBlock block;
+ public ScrolledPropertiesPage(FormEditor editor) {
+ super(editor, "fourth", "Master Details");
+ block = new ScrolledPropertiesBlock(this);
+ }
+ protected void createFormContent(final IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ //FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Form with scrolled sections");
+ form.setBackgroundImage(ExamplesPlugin.getDefault().getImage(
+ ExamplesPlugin.IMG_FORM_BG));
+ block.createContent(managedForm);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java
new file mode 100755
index 00000000..199bcfb6
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.editor.*;
+import org.eclipse.ui.forms.events.*;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.*;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class SecondPage extends FormPage {
+ /**
+ * @param id
+ * @param title
+ */
+ public SecondPage(FormEditor editor) {
+ super(editor, "second", "Section Page");
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Title for the second page");
+ form.setBackgroundImage(ExamplesPlugin.getDefault().getImage(
+ ExamplesPlugin.IMG_FORM_BG));
+ GridLayout layout = new GridLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 2;
+ form.getBody().setLayout(layout);
+ //This call is needed because the section will compute
+ // the bold version based on the parent.
+ Dialog.applyDialogFont(form.getBody());
+ Section s1 = createTableSection(form, toolkit, "First Table Section", true);
+ Section s2 = createTableSection(form, toolkit, "Second Table Section", false);
+ // This call is needed for all the children
+ Dialog.applyDialogFont(form.getBody());
+ s2.descriptionVerticalSpacing = s1.getTextClientHeightDifference();
+ form.reflow(true);
+ }
+
+ private Section createTableSection(final ScrolledForm form,
+ FormToolkit toolkit, String title, boolean addTextClient) {
+ Section section = toolkit.createSection(form.getBody(), Section.TWISTIE
+ | Section.TITLE_BAR);
+ section.setActiveToggleColor(toolkit.getHyperlinkGroup()
+ .getActiveForeground());
+ section.setToggleColor(toolkit.getColors().getColor(
+ IFormColors.SEPARATOR));
+ if (addTextClient) {
+ ToolBar tbar = new ToolBar(section, SWT.FLAT | SWT.HORIZONTAL);
+ ToolItem titem = new ToolItem(tbar, SWT.NULL);
+ titem.setImage(PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_TOOL_CUT));
+ titem = new ToolItem(tbar, SWT.PUSH);
+ titem.setImage(PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_TOOL_COPY));
+ titem = new ToolItem(tbar, SWT.SEPARATOR);
+ titem = new ToolItem(tbar, SWT.PUSH);
+ titem.setImage(PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_TOOL_DELETE));
+ section.setTextClient(tbar);
+ }
+ FormText description = toolkit.createFormText(section, false);
+ description
+ .setText(
+ "<form><p>This description uses FormText widget and as a result can have <b>bold</b> text.</p></form>",
+ true, false);
+ section.setDescriptionControl(description);
+
+ Composite client = toolkit.createComposite(section, SWT.WRAP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+
+ client.setLayout(layout);
+ Table t = toolkit.createTable(client, SWT.NULL);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 200;
+ gd.widthHint = 100;
+ t.setLayoutData(gd);
+ toolkit.paintBordersFor(client);
+ Button b = toolkit.createButton(client, "Add...", SWT.PUSH);
+ gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ b.setLayoutData(gd);
+ section.setText(title);
+ section
+ .setDescription("<form><p>This section has a <b>tree</b> and a button. It also has <a>a link</a> in the description.</p></form>");
+ section.setClient(client);
+ section.setExpanded(true);
+ section.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ form.reflow(false);
+ }
+ });
+ gd = new GridData(GridData.FILL_BOTH);
+ section.setLayoutData(gd);
+ return section;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditor.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditor.java
new file mode 100755
index 00000000..94c95e7a
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditor.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+/**
+ * A simple multi-page form editor that uses Eclipse Forms support.
+ * Example plug-in is configured to create one instance of
+ * form colors that is shared between multiple editor instances.
+ */
+public class SimpleFormEditor extends FormEditor {
+ /**
+ *
+ */
+ public SimpleFormEditor() {
+ }
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#createToolkit(org.eclipse.swt.widgets.Display)
+ */
+ protected FormToolkit createToolkit(Display display) {
+ // Create a toolkit that shares colors between editors.
+ return new FormToolkit(ExamplesPlugin.getDefault().getFormColors(
+ display));
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ protected void addPages() {
+ try {
+ addPage(new NewStylePage(this));
+ addPage(new ErrorMessagesPage(this));
+ addPage(new FreeFormPage(this));
+ addPage(new SecondPage(this));
+ int index = addPage(new Composite(getContainer(), SWT.NULL));
+ setPageText(index, "Composite");
+ addPage(new ThirdPage(this));
+ addPage(new ScrolledPropertiesPage(this));
+ addPage(new PageWithSubPages(this));
+ }
+ catch (PartInitException e) {
+ //
+ }
+ }
+ /*
+ * (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.ISaveablePart#isSaveAsAllowed()
+ */
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditorInput.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditorInput.java
new file mode 100755
index 00000000..b2fd6af5
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditorInput.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+import org.eclipse.ui.forms.examples.internal.FormEditorInput;
+
+public class SimpleFormEditorInput extends FormEditorInput {
+ private SimpleModel model;
+
+ public SimpleFormEditorInput(String name) {
+ super(name);
+ model = new SimpleModel();
+ }
+
+ public SimpleModel getModel() {
+ return model;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleModel.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleModel.java
new file mode 100755
index 00000000..ba1ceab2
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleModel.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+import java.util.ArrayList;
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class SimpleModel {
+ private ArrayList modelListeners;
+ private ArrayList objects;
+ public SimpleModel() {
+ modelListeners = new ArrayList();
+ initialize();
+ }
+ public void addModelListener(IModelListener listener) {
+ if (!modelListeners.contains(listener))
+ modelListeners.add(listener);
+ }
+ public void removeModelListener(IModelListener listener) {
+ modelListeners.remove(listener);
+ }
+ public void fireModelChanged(Object[] objects, String type, String property) {
+ for (int i = 0; i < modelListeners.size(); i++) {
+ ((IModelListener) modelListeners.get(i)).modelChanged(objects,
+ type, property);
+ }
+ }
+ public Object[] getContents() {
+ return objects.toArray();
+ }
+ private void initialize() {
+ objects = new ArrayList();
+ NamedObject[] objects = {
+ new TypeOne("TypeOne instance 1", 2, true, "Some text"),
+ new TypeOne("TypeOne instance 2", 1, false, "Different text"),
+ new TypeOne("TypeOne instance 3", 3, true, "Text"),
+ new TypeOne("TypeOne instance 4", 0, false, "Longer text"),
+ new TypeOne("TypeOne instance 5", 1, true, "Sample"),
+ new TypeTwo("TypeTwo instance 1", false, true),
+ new TypeTwo("TypeTwo instance 2", true, false)};
+ add(objects, false);
+ }
+ public void add(NamedObject[] objs, boolean notify) {
+ for (int i = 0; i < objs.length; i++) {
+ objects.add(objs[i]);
+ objs[i].setModel(this);
+ }
+ if (notify)
+ fireModelChanged(objs, IModelListener.ADDED, "");
+ }
+ public void remove(NamedObject[] objs, boolean notify) {
+ for (int i = 0; i < objs.length; i++) {
+ objects.remove(objs[i]);
+ objs[i].setModel(null);
+ }
+ if (notify)
+ fireModelChanged(objs, IModelListener.REMOVED, "");
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java
new file mode 100755
index 00000000..72457433
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ControlContribution;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * A form editor that has several pages but only one stable header.
+ */
+public class SingleHeaderEditor extends SharedHeaderFormEditor {
+ /**
+ *
+ */
+ public SingleHeaderEditor() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#createToolkit(org.eclipse.swt.widgets.Display)
+ */
+ protected FormToolkit createToolkit(Display display) {
+ // Create a toolkit that shares colors between editors.
+ return new FormToolkit(ExamplesPlugin.getDefault().getFormColors(
+ display));
+ }
+
+ protected void createHeaderContents(IManagedForm headerForm) {
+ final ScrolledForm sform = headerForm.getForm();
+ //sform.setText("Shared header for all the pages");
+ getToolkit().decorateFormHeading(sform.getForm());
+ addToolBar(sform.getForm());
+ sform.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FILE));
+ headerForm.getForm().getDisplay().timerExec(5000, new Runnable() {
+ public void run() {
+ sform.setText("<Another text>");
+ }
+ });
+ //sform.setMessage("Static text", 0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ protected void addPages() {
+ try {
+ addPage(new HeadlessPage(this, 1));
+ addPage(new HeadlessPage(this, 2));
+ addPage(new HeadlessPage(this, 3));
+ } catch (PartInitException e) {
+ //
+ }
+ }
+
+ /*
+ * (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.ISaveablePart#isSaveAsAllowed()
+ */
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ private void addToolBar(Form form) {
+ Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ haction.setChecked(true);
+ haction.setToolTipText("Horizontal orientation");
+ haction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry()
+ .getDescriptor(ExamplesPlugin.IMG_HORIZONTAL));
+ Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
+ public void run() {
+ }
+ };
+ vaction.setChecked(false);
+ vaction.setToolTipText("Vertical orientation");
+ vaction.setImageDescriptor(ExamplesPlugin.getDefault()
+ .getImageRegistry().getDescriptor(ExamplesPlugin.IMG_VERTICAL));
+ ControlContribution save = new ControlContribution("save") {
+ protected Control createControl(Composite parent) {
+ Button saveButton = new Button(parent, SWT.PUSH);
+ saveButton.setText("Save");
+ return saveButton;
+ }
+ };
+ form.getToolBarManager().add(haction);
+ form.getToolBarManager().add(vaction);
+ form.getToolBarManager().add(save);
+ form.getToolBarManager().update(true);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java
new file mode 100755
index 00000000..c48b28c2
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.*;
+import org.eclipse.ui.forms.events.*;
+import org.eclipse.ui.forms.widgets.*;
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class ThirdPage extends FormPage {
+ /**
+ * @param id
+ * @param title
+ */
+ public ThirdPage(FormEditor editor) {
+ super(editor, "third", "Flow Page");
+ }
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ //FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Form with wrapped controls");
+ ColumnLayout layout = new ColumnLayout();
+ layout.topMargin = 0;
+ layout.bottomMargin = 5;
+ layout.leftMargin = 10;
+ layout.rightMargin = 10;
+ layout.horizontalSpacing = 10;
+ layout.verticalSpacing = 10;
+ layout.maxNumColumns = 4;
+ layout.minNumColumns = 1;
+ form.getBody().setLayout(layout);
+ //form.getBody().setBackground(
+ // form.getBody().getDisplay().getSystemColor(SWT.COLOR_GREEN));
+ createSectionWithLinks(managedForm, "Link Section",
+ "An example of a section with links", 2);
+ createSectionWithLinks(managedForm, "Link Section",
+ "An example of a section with links", 2);
+ createMixedSection(managedForm, "Mixed Section",
+ "An example of a section with both links and form controls");
+ createSectionWithLinks(managedForm, "Link Section",
+ "An example of a section with links", 4);
+ createSectionWithControls(managedForm, "Control Section",
+ "An example of a section with form controls");
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 3);
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 5);
+ createMixedSection(managedForm, "Mixed Section",
+ "An example of a section with both links and form controls");
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 2);
+ createSectionWithControls(managedForm, "Control Section",
+ "An example of a section with links");
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 4);
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 2);
+ createMixedSection(managedForm, "Mixed Section",
+ "An example of a section with both links and form controls");
+ createSectionWithLinks(managedForm, "Sample Section",
+ "An example of a section with links", 2);
+ createSectionWithControls(managedForm, "Control Section",
+ "An example of a section with form controls");
+ }
+ private void createSectionWithLinks(IManagedForm mform, String title,
+ String desc, int nlinks) {
+ Composite client = createSection(mform, title, desc, 1);
+ FormToolkit toolkit = mform.getToolkit();
+ for (int i = 1; i <= nlinks; i++)
+ toolkit.createHyperlink(client, "Hyperlink text " + i, SWT.WRAP);
+ }
+ private void createSectionWithControls(IManagedForm mform, String title,
+ String desc) {
+ Composite client = createSection(mform, title, desc, 1);
+ FormToolkit toolkit = mform.getToolkit();
+ toolkit.createButton(client, "A radio button 1", SWT.RADIO);
+ toolkit.createButton(client, "A radio button 2", SWT.RADIO);
+ toolkit.createButton(client, "A radio button with a longer text",
+ SWT.RADIO);
+ toolkit.createButton(client, "A checkbox button", SWT.CHECK);
+ }
+ private void createMixedSection(IManagedForm mform, String title, String desc) {
+ Composite client = createSection(mform, title, desc, 2);
+ FormToolkit toolkit = mform.getToolkit();
+ Hyperlink link = toolkit.createHyperlink(client,
+ "A longer hyperlink text example", SWT.WRAP);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ link.setLayoutData(gd);
+ link = toolkit.createHyperlink(client, "Another hyperlink text",
+ SWT.WRAP);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ link.setLayoutData(gd);
+ toolkit.createLabel(client, "A text label:");
+ Text text = toolkit.createText(client, "", SWT.SINGLE);
+ text.setText("Sample text");
+ text.setEnabled(false);
+ gd = new GridData();
+ gd.widthHint = 150;
+ text.setLayoutData(gd);
+ toolkit.paintBordersFor(client);
+ }
+ private Composite createSection(IManagedForm mform, String title,
+ String desc, int numColumns) {
+ final ScrolledForm form = mform.getForm();
+ FormToolkit toolkit = mform.getToolkit();
+ Section section = toolkit.createSection(form.getBody(), Section.TWISTIE
+ | Section.SHORT_TITLE_BAR | Section.DESCRIPTION | Section.EXPANDED);
+ section.setText(title);
+ section.setDescription(desc);
+ Composite client = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = layout.marginHeight = 0;
+ layout.numColumns = numColumns;
+ client.setLayout(layout);
+ section.setClient(client);
+ section.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ form.reflow(false);
+ }
+ });
+ return client;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOne.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOne.java
new file mode 100755
index 00000000..45dc98c8
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOne.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TypeOne extends NamedObject {
+ public static final String P_CHOICE="choice";
+ public static final String P_FLAG="flag";
+ public static final String P_TEXT="text";
+ public static final String [] CHOICES = {
+ "Choice 1", "Choice 2", "Choice 3", "Choice 4" };
+ private int choice=0;
+ private String text;
+ private boolean flag;
+
+ /**
+ * @param name
+ */
+ public TypeOne(String name, int choice, boolean flag, String text) {
+ super(name);
+ this.flag = flag;
+ this.text = text;
+ this.choice = choice;
+ }
+ public int getChoice() {
+ return choice;
+ }
+ public void setChoice(int choice) {
+ this.choice = choice;
+ model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_CHOICE);
+ }
+ public boolean getFlag() {
+ return flag;
+ }
+ public void setFlag(boolean flag) {
+ this.flag = flag;
+ model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_FLAG);
+ }
+ public String getText() {
+ return text;
+ }
+ public void setText(String text) {
+ this.text = text;
+ model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_TEXT);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOneDetailsPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOneDetailsPage.java
new file mode 100755
index 00000000..94f16813
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOneDetailsPage.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.widgets.*;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TypeOneDetailsPage implements IDetailsPage {
+ private IManagedForm mform;
+ private TypeOne input;
+ private Button [] choices;
+ private Button flag;
+ private Text text;
+ private static final String RTEXT_DATA =
+ "<form><p>An example of a free-form text that should be "+
+ "wrapped below the section with widgets.</p>"+
+ "<p>It can contain simple tags like <a>links</a> and <b>bold text</b>.</p></form>";
+
+ public TypeOneDetailsPage() {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ public void initialize(IManagedForm mform) {
+ this.mform = mform;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ public void createContents(Composite parent) {
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 5;
+ layout.leftMargin = 5;
+ layout.rightMargin = 2;
+ layout.bottomMargin = 2;
+ parent.setLayout(layout);
+
+ FormToolkit toolkit = mform.getToolkit();
+ Section s1 = toolkit.createSection(parent, Section.DESCRIPTION);
+ s1.marginWidth = 10;
+ s1.setText("Type One Details");
+ s1.setDescription("Set the properties of the selected TypeOne object.");
+ TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ s1.setLayoutData(td);
+ toolkit.createCompositeSeparator(s1);
+ Composite client = toolkit.createComposite(s1);
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = toolkit.getBorderStyle()==SWT.BORDER?0:2;
+ glayout.numColumns = 2;
+ client.setLayout(glayout);
+ //client.setBackground(client.getDisplay().getSystemColor(SWT.COLOR_CYAN));
+
+ SelectionListener choiceListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Integer value = (Integer)e.widget.getData();
+ if (input!=null) {
+ input.setChoice(value.intValue());
+ }
+ }
+ };
+ GridData gd;
+ choices = new Button[TypeOne.CHOICES.length];
+ for (int i=0; i<TypeOne.CHOICES.length; i++) {
+ choices[i] = toolkit.createButton(client, TypeOne.CHOICES[i], SWT.RADIO);
+ choices[i].setData(new Integer(i));
+ choices[i].addSelectionListener(choiceListener);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ choices[i].setLayoutData(gd);
+ }
+ createSpacer(toolkit, client, 2);
+ flag = toolkit.createButton(client, "Value of the flag property", SWT.CHECK);
+ flag.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (input!=null)
+ input.setFlag(flag.getSelection());
+ }
+ });
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ flag.setLayoutData(gd);
+ createSpacer(toolkit, client, 2);
+
+ toolkit.createLabel(client, "Text property:");
+ text = toolkit.createText(client, "", SWT.SINGLE);
+ text.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (input!=null)
+ input.setText(text.getText());
+ }
+ });
+ gd = new GridData(GridData.FILL_HORIZONTAL|GridData.VERTICAL_ALIGN_BEGINNING);
+ gd.widthHint = 10;
+ text.setLayoutData(gd);
+
+ createSpacer(toolkit, client, 2);
+
+ FormText rtext = toolkit.createFormText(parent, false);
+ rtext.setText(RTEXT_DATA, true, false);
+ td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ rtext.setLayoutData(td);
+
+ toolkit.paintBordersFor(client);
+ s1.setClient(client);
+ }
+ private void createSpacer(FormToolkit toolkit, Composite parent, int span) {
+ Label spacer = toolkit.createLabel(parent, "");
+ GridData gd = new GridData();
+ gd.horizontalSpan = span;
+ spacer.setLayoutData(gd);
+ }
+ private void update() {
+ for (int i=0; i<TypeOne.CHOICES.length; i++) {
+ choices[i].setSelection(input!=null && input.getChoice()==i);
+ }
+ flag.setSelection(input!=null && input.getFlag());
+ text.setText(input!=null && input.getText()!=null?input.getText():"");
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ IStructuredSelection ssel = (IStructuredSelection)selection;
+ if (ssel.size()==1) {
+ input = (TypeOne)ssel.getFirstElement();
+ }
+ else
+ input = null;
+ update();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#commit()
+ */
+ public void commit(boolean onSave) {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#setFocus()
+ */
+ public void setFocus() {
+ choices[0].setFocus();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#dispose()
+ */
+ public void dispose() {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#isDirty()
+ */
+ public boolean isDirty() {
+ return false;
+ }
+ public boolean isStale() {
+ return false;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#refresh()
+ */
+ public void refresh() {
+ update();
+ }
+ public boolean setFormInput(Object input) {
+ return false;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwo.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwo.java
new file mode 100755
index 00000000..c1093c09
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwo.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.forms.examples.internal.rcp;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TypeTwo extends NamedObject {
+ public static final String P_FLAG1="flag1";
+ public static final String P_FLAG2="flag2";
+ private boolean flag1;
+ private boolean flag2;
+
+ /**
+ * @param name
+ */
+ public TypeTwo(String name, boolean flag1, boolean flag2) {
+ super(name);
+ this.flag1 = flag1;
+ this.flag2 = flag2;
+ }
+ public boolean getFlag1() {
+ return flag1;
+ }
+ public boolean getFlag2() {
+ return flag2;
+ }
+ public void setFlag1(boolean flag1) {
+ this.flag1 = flag1;
+ model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_FLAG1);
+ }
+ public void setFlag2(boolean flag2) {
+ this.flag2 = flag2;
+ model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_FLAG2);
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwoDetailsPage.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwoDetailsPage.java
new file mode 100755
index 00000000..2988e28a
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwoDetailsPage.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * 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.forms.examples.internal.rcp;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.widgets.*;
+
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TypeTwoDetailsPage implements IDetailsPage {
+ private IManagedForm mform;
+ private TypeTwo input;
+ private Button flag1;
+ private Button flag2;
+
+ public TypeTwoDetailsPage() {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ public void initialize(IManagedForm mform) {
+ this.mform = mform;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ public void createContents(Composite parent) {
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 5;
+ layout.leftMargin = 5;
+ layout.rightMargin = 2;
+ //layout.bottomMargin = 2;
+ parent.setLayout(layout);
+
+ FormToolkit toolkit = mform.getToolkit();
+ Section s1 = toolkit.createSection(parent, Section.DESCRIPTION);
+ s1.marginWidth = 10;
+ s1.setText("Type Two Details");
+ s1.setDescription("Set the properties of the selected TypeTwo object.");
+ TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ s1.setLayoutData(td);
+ toolkit.createCompositeSeparator(s1);
+ Composite client = toolkit.createComposite(s1);
+ //client.setBackground(client.getDisplay().getSystemColor(SWT.COLOR_MAGENTA));
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = 0;
+ client.setLayout(glayout);
+
+ flag1 = toolkit.createButton(client, "Value of the flag1 property", SWT.CHECK);
+ flag1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (input!=null)
+ input.setFlag1(flag1.getSelection());
+ }
+ });
+
+ flag2 = toolkit.createButton(client, "Value of the flag2 property", SWT.CHECK);
+ flag2.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (input!=null)
+ input.setFlag2(flag2.getSelection());
+ }
+ });
+ s1.setClient(client);
+ }
+ private void update() {
+ flag1.setSelection(input!=null && input.getFlag1());
+ flag2.setSelection(input!=null && input.getFlag2());
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ IStructuredSelection ssel = (IStructuredSelection)selection;
+ if (ssel.size()==1) {
+ input = (TypeTwo)ssel.getFirstElement();
+ }
+ else
+ input = null;
+ update();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#commit()
+ */
+ public void commit(boolean onSave) {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#setFocus()
+ */
+ public void setFocus() {
+ flag1.setFocus();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#dispose()
+ */
+ public void dispose() {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#isDirty()
+ */
+ public boolean isDirty() {
+ return false;
+ }
+
+ public boolean isStale() {
+ return false;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.IDetailsPage#refresh()
+ */
+ public void refresh() {
+ update();
+ }
+ public boolean setFormInput(Object input) {
+ return false;
+ }
+}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/index.xml b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/index.xml
new file mode 100755
index 00000000..3be639b2
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/index.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?> <!--
+ 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
+ -->
+
+<form>
+<p><control href="node"/></p>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>New addition: controls in the text</p>
+<p><control href="control1" width="300"/></p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+<p>
+To check for updates for features you have installed,
+go to the <a href="action1">My Eclipse 1</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.
+Now we <b>will</b> add an
+<img href="image1"/>
+image here. Just
+ to show how wrapping should apply to images when they are
+ larger than the regular text.
+</p>
+<p>Now we will show an image link: <a href="action1"><img href="image1"/></a></p>
+<p>And this is image and text as a link: <a href="action1"><img href="image1"/>Some link text</a></p>
+<li style="text" value="1.">To check for updates for features you have installed,
+go to the <a href="action2">My Eclipse 2</a> and select
+<b>Available Updates</b> folder. <b>Search page</b> will
+be shown allowing you to initiate and customize the search.</li>
+<li style="text" value="2.">This is the item number 2.</li>
+<li style="text" value="3.">This is the item number 3.</li>
+<li>This is the bullet item.</li>
+<li>This is another bullet item.</li>
+</form> \ No newline at end of file
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/FormView.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/FormView.java
index c01f6087..df7bf120 100644..100755
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/FormView.java
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/FormView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * 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
@@ -7,12 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Chris Aniszczyk <caniszczyk@gmail.com> - modified for SWTBot tests
*******************************************************************************/
-
-package org.eclipse.swtbot.forms.finder.test;
-
-import org.eclipse.jface.dialogs.Dialog;
+package org.eclipse.ui.forms.examples.views;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
@@ -26,6 +22,7 @@ import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.examples.internal.ExamplesPlugin;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -35,20 +32,15 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.ui.part.ViewPart;
-// taken from the org.eclipse.ui.forms.examples plug-in
-public class FormView {
-
- private Composite fComposite;
+public class FormView extends ViewPart {
private FormToolkit toolkit;
private ScrolledForm form;
-
/**
* The constructor.
*/
- public FormView(Composite composite) {
- fComposite = composite;
- createPartControl(fComposite);
+ public FormView() {
}
/**
* This is a callback that will allow us to create the viewer and
@@ -86,12 +78,12 @@ public class FormView {
ImageHyperlink ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL);
ih.setText("Image link with no image");
ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL);
- ih.setImage(JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR));
+ ih.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
ih.setText("Link with image and text");
ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE|ExpandableComposite.CLIENT_INDENT);
ImageHyperlink eci = toolkit.createImageHyperlink(ec, SWT.NULL);
- eci.setImage(JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR));
+ eci.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
ec.setTextClient(eci);
ec.setText("Expandable Composite title");
String ctext = "We will now create a somewhat long text so that "+
@@ -152,7 +144,7 @@ public class FormView {
td = new TableWrapData(TableWrapData.FILL);
td.colspan = 2;
rtext.setLayoutData(td);
- rtext.setImage("image", JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR));
+ rtext.setImage("image", ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
rtext.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE));
rtext.setFont("header", JFaceResources.getHeaderFont());
rtext.setFont("code", JFaceResources.getTextFont());
@@ -209,5 +201,6 @@ public class FormView {
*/
public void dispose() {
toolkit.dispose();
+ super.dispose();
}
}
diff --git a/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/ShowHelpAction.java b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/ShowHelpAction.java
new file mode 100755
index 00000000..2484a370
--- /dev/null
+++ b/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/ShowHelpAction.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.ui.forms.examples.views;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.*;
+
+/**
+ * @author dejan
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class ShowHelpAction implements IWorkbenchWindowActionDelegate {
+ private IWorkbenchWindow window;
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ try {
+ window.getActivePage().showView("org.eclipse.ui.forms.examples.helpView");
+ }
+ catch (PartInitException e) {
+ System.out.println(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+}

Back to the top