Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2006-01-05 00:11:41 +0000
committerDejan Gloszic2006-01-05 00:11:41 +0000
commitf19e9f7a2623eacc1ce71d2b28ed69e394e45fc2 (patch)
tree4e42437d98fd1ce9d14374178714574ef3a5ffc2
parentbfda4e065254d5b116b524c247bbee0b76351d56 (diff)
downloadeclipse.platform.ua-f19e9f7a2623eacc1ce71d2b28ed69e394e45fc2.tar.gz
eclipse.platform.ua-f19e9f7a2623eacc1ce71d2b28ed69e394e45fc2.tar.xz
eclipse.platform.ua-f19e9f7a2623eacc1ce71d2b28ed69e394e45fc2.zip
*** empty log message ***
-rw-r--r--org.eclipse.ua.tests/.classpath6
-rw-r--r--org.eclipse.ua.tests/.project16
-rw-r--r--org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs49
-rw-r--r--org.eclipse.ua.tests/META-INF/MANIFEST.MF17
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllTests.java38
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/plugin/UserAssistanceTestPlugin.java (renamed from org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/CheatSheetTestPlugin.java)12
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/DisplayUtil.java27
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java33
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/Keyboard.java161
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java108
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java33
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetChecker.java41
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetFinder.java104
-rw-r--r--org.eclipse.ua.tests/build.properties15
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetTests.java38
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/AllParserTests.java36
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidTest.java49
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/TolerateTest.java50
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/ValidTest.java78
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java278
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java79
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/IncrementVariableAction.java (renamed from org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/VisitorCustomizeAction.java)24
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java (renamed from org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java)17
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NoopAction.java (renamed from org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/FactoryCustomizeAction.java)19
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ActionTest.java151
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/AllViewTests.java38
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContentTest.java207
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContextHelpTest.java103
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/SubItemsTest.java156
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/URLTest.java376
-rw-r--r--org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml99
-rw-r--r--org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml108
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml22
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/rational/Test2.xml22
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/contexts.xml (renamed from org.eclipse.ua.tests/contexts.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingClass.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingPluginId.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml)4
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidNumber.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidRange.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_BadXML.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_MissingTitle.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_NotDefined.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingCondition.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingSubItem.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml)0
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_ManyDefined.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_MissingDescription.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_NotDefined.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingDescription.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingTitle.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_NotDefined.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingAction.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingCondition.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingSubItem.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingValues.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml)4
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/invalid/SubItemElement_MissingLabel.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld.xml (renamed from org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions.xml (renamed from org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions_serialized.txt94
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems.xml (renamed from org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems_serialized.txt91
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld_serialized.txt91
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestActions.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestActions.xml)38
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip.xml52
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip_serialized.txt75
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestActions_serialized.txt202
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions_serialized.txt68
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml)14
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help_serialized.txt83
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting_serialized.txt165
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml)94
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems_serialized.txt636
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/webapp/TestOpeningURL.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml)10
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters_serialized.txt83
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml)38
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems_serialized.txt176
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr_serialized.txt32
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml)6
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement_serialized.txt32
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr_serialized.txt71
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement_serialized.txt71
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements_serialized.txt28
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr_serialized.txt29
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined_serialized.txt26
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr_serialized.txt51
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml)8
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement_serialized.txt51
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml)4
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr_serialized.txt59
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml)4
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement_serialized.txt59
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr_serialized.txt34
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement.xml (renamed from org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml)2
-rw-r--r--org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement_serialized.txt34
-rw-r--r--org.eclipse.ua.tests/data/intro/platform/serialized.txt534
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroTests.java36
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/AllParserTests.java35
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/PlatformTest.java147
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java84
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java353
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java114
-rw-r--r--org.eclipse.ua.tests/plugin.xml242
-rw-r--r--org.eclipse.ua.tests/readme.txt100
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/CustomizeAction.java92
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionI.java86
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionII.java86
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/LaunchPatternSelectionDialogAction.java39
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenClassNameFilledAction.java130
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaClassWizardWithMain.java77
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaProjectWizard.java56
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenNewJavaProjectWizardWithNameAction.java59
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/PatternGenerator.java247
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/SingletonCustomizeAction.java20
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/CustomizePatternDialog.java157
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/PatternSelectionDialog.java118
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/listeners/PatternItemListener.java51
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/wizards/MyProjectCreationWizard.java43
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java49
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetParserAction.java78
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetViewerSetInputAction.java45
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestOpeningURL.java95
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestStartWebApp.java68
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/DisplayDataDialog.java74
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDataDialog.java83
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDisplayDataAction.java45
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/views/CheatSheetViewerTestView.java84
-rw-r--r--org.eclipse.ua.tests/test.xml51
-rw-r--r--org.eclipse.ui.cheatsheets/.classpath2
153 files changed, 6501 insertions, 2648 deletions
diff --git a/org.eclipse.ua.tests/.classpath b/org.eclipse.ua.tests/.classpath
index 065ac06e1..2f4d1a234 100644
--- a/org.eclipse.ua.tests/.classpath
+++ b/org.eclipse.ua.tests/.classpath
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="base"/>
+ <classpathentry kind="src" path="cheatsheet"/>
+ <classpathentry kind="src" path="intro"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.ua.tests/.project b/org.eclipse.ua.tests/.project
index 05cdc6d1f..0ac8a98a6 100644
--- a/org.eclipse.ua.tests/.project
+++ b/org.eclipse.ua.tests/.project
@@ -1,22 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.ui.tests.cheatsheets</name>
+ <name>org.eclipse.ua.tests</name>
<comment></comment>
<projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.jdt.core</project>
- <project>org.eclipse.jdt.ui</project>
- <project>org.eclipse.jface.text</project>
- <project>org.eclipse.ui</project>
- <project>org.eclipse.ui.cheatsheets</project>
- <project>org.eclipse.ui.editors</project>
- <project>org.eclipse.ui.forms</project>
- <project>org.eclipse.ui.ide</project>
- <project>org.eclipse.ui.intro</project>
- <project>org.eclipse.ui.views</project>
- <project>org.eclipse.ui.workbench.texteditor</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..38020ab06
--- /dev/null
+++ b/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,49 @@
+#Wed Jan 04 18:14:49 EST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=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.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.rawTypeReference=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=ignore
+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=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/org.eclipse.ua.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..a41e6a51b
--- /dev/null
+++ b/org.eclipse.ua.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: User Assistance Test
+Bundle-SymbolicName: org.eclipse.ua.tests;singleton:=true
+Bundle-Version: 3.2.0
+Bundle-Activator: org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.junit,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.help.appserver,
+ org.eclipse.ui,
+ org.eclipse.ui.cheatsheets,
+ org.eclipse.ui.intro
+Eclipse-LazyStart: true
+Bundle-Vendor: Eclipse.org
+Bundle-ClassPath: ua-tests.jar
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllTests.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllTests.java
new file mode 100644
index 000000000..d1b6ec515
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllTests.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.cheatsheet.AllCheatSheetTests;
+import org.eclipse.ua.tests.intro.AllIntroTests;
+
+/*
+ * Tests all user assistance functionality (automated).
+ */
+public class AllTests extends TestSuite {
+
+ /*
+ * Returns the entire test suite.
+ */
+ public static Test suite() {
+ return new AllTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllTests() {
+ addTest(AllCheatSheetTests.suite());
+ addTest(AllIntroTests.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/CheatSheetTestPlugin.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/plugin/UserAssistanceTestPlugin.java
index 2f8e7c74e..1dc5b1663 100644
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/CheatSheetTestPlugin.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/plugin/UserAssistanceTestPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,18 +8,18 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets;
+package org.eclipse.ua.tests.plugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-public class CheatSheetTestPlugin extends AbstractUIPlugin {
+public class UserAssistanceTestPlugin extends AbstractUIPlugin {
//The shared instance.
- private static CheatSheetTestPlugin plugin;
+ private static UserAssistanceTestPlugin plugin;
/**
* The constructor.
*/
- public CheatSheetTestPlugin() {
+ public UserAssistanceTestPlugin() {
super();
plugin = this;
}
@@ -27,7 +27,7 @@ public class CheatSheetTestPlugin extends AbstractUIPlugin {
/**
* Returns the shared instance.
*/
- public static CheatSheetTestPlugin getDefault() {
+ public static UserAssistanceTestPlugin getDefault() {
return plugin;
}
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/DisplayUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/DisplayUtil.java
new file mode 100644
index 000000000..cd7738b90
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/DisplayUtil.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import org.eclipse.swt.widgets.Display;
+
+/*
+ * Utility methods for working with Displays.
+ */
+public class DisplayUtil {
+
+ /*
+ * Flushes and events in the UI thread queue.
+ */
+ public static void flush() {
+ while(Display.getDefault().readAndDispatch()) {
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
new file mode 100644
index 000000000..f0cf48862
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+/*
+ * Utility methods for working with files.
+ */
+public class FileUtil {
+
+ public static String getContents(String path) throws IOException {
+ BufferedReader in = new BufferedReader(new FileReader(path));
+ StringBuffer buf = new StringBuffer();
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ buf.append(line);
+ buf.append("\n");
+ }
+ in.close();
+ return buf.toString();
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/Keyboard.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/Keyboard.java
new file mode 100644
index 000000000..501599e77
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/Keyboard.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+
+/*
+ * Allows pressing of keys programmatically.
+ */
+public class Keyboard {
+
+ /*
+ * Press and hold a key down until keyUp called.
+ */
+ public static void keyDown(char c, int modifiers) {
+ DisplayUtil.flush();
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = c;
+ event.stateMask = modifiers;
+ Display.getDefault().post(event);
+ DisplayUtil.flush();
+ }
+
+ /*
+ * Press and hold a key down until keyUp called.
+ */
+ public static void keyDown(int keyCode, int modifiers) {
+ DisplayUtil.flush();
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.keyCode = keyCode;
+ event.stateMask = modifiers;
+ Display.getDefault().post(event);
+ DisplayUtil.flush();
+ }
+
+ /*
+ * Release a key that was previously called with keyDown.
+ */
+ public static void keyUp(int keyCode, int modifiers) {
+ DisplayUtil.flush();
+ Event event = new Event();
+ event.type = SWT.KeyUp;
+ event.keyCode = keyCode;
+ event.stateMask = modifiers;
+ Display.getDefault().post(event);
+ DisplayUtil.flush();
+ }
+
+ /*
+ * Release a key that was previously called with keyDown.
+ */
+ public static void keyUp(char c, int modifiers) {
+ DisplayUtil.flush();
+ Event event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = c;
+ event.stateMask = modifiers;
+ Display.getDefault().post(event);
+ DisplayUtil.flush();
+ }
+
+ /*
+ * Press and release a key, programmatically.
+ */
+ public static void press(int keyCode) {
+ press(keyCode, SWT.NONE);
+ }
+
+ /*
+ * Press and release a key, programmatically.
+ */
+ public static void press(char c) {
+ press(c, SWT.NONE);
+ }
+
+ /*
+ * Press and release a key with the given modifiers (e.g. Alt, Ctrl).
+ */
+ public static void press(int keyCode, int modifiers) {
+ /*
+ * First press each modifier.
+ */
+ int[] array = separateModifiers(modifiers);
+ for (int i=0;i<array.length;++i) {
+ keyDown(array[i], SWT.NONE);
+ }
+
+ /*
+ * Press and release the key.
+ */
+ keyDown(keyCode, modifiers);
+ keyUp(keyCode, modifiers);
+
+ /*
+ * Release each modifier.
+ */
+ for (int i=0;i<array.length;++i) {
+ keyUp(array[i], SWT.NONE);
+ }
+ }
+
+ /*
+ * Press and release a key with the given modifiers (e.g. Alt, Ctrl).
+ */
+ public static void press(char c, int modifiers) {
+ /*
+ * First press each modifier.
+ */
+ int[] array = separateModifiers(modifiers);
+ for (int i=0;i<array.length;++i) {
+ keyDown(array[i], SWT.NONE);
+ }
+
+ /*
+ * Press and release the key.
+ */
+ keyDown(c, modifiers);
+ keyUp(c, modifiers);
+
+ /*
+ * Release each modifier.
+ */
+ for (int i=0;i<array.length;++i) {
+ keyUp(array[i], SWT.NONE);
+ }
+ }
+
+ /*
+ * Given the modifier flags, returns each modifier separately. For example, if you pass in
+ * (SWT.ALT | SWT.CTRL), it returns { SWT.ALT, SWT.CTRL }, in no particular order.
+ */
+ private static int[] separateModifiers(int modifiers) {
+ List list = new ArrayList();
+ for (int i=0;i<32;++i) {
+ int currentModifier = (1 << i);
+ if ((modifiers & currentModifier) != 0) {
+ list.add(new Integer(currentModifier));
+ }
+ }
+ int[] array = new int[list.size()];
+ for (int i=0;i<array.length;++i) {
+ array[i] = ((Integer)list.get(i)).intValue();
+ }
+ return array;
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
new file mode 100644
index 000000000..51e7cc082
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+
+/*
+ * Utility methods for finding resources.
+ */
+public class ResourceFinder {
+
+ /*
+ * Finds the specified file in the given plugin and returns a URL to it.
+ */
+ public static URL findFile(Plugin plugin, String path) {
+ String fullLocation = plugin.getBundle().getLocation();
+ String location = fullLocation.substring(fullLocation.indexOf('@') + 1);
+ IPath fullPath = new Path(location).append(path);
+ File file = fullPath.toFile();
+
+ /*
+ * If it's a relative path, append it to the install location.
+ */
+ if (!file.exists()) {
+ fullPath = new Path(Platform.getInstallLocation().getURL().toString().substring("file:".length()) + fullPath);
+ file = fullPath.toFile();
+ }
+
+ try {
+ return file.toURL();
+ }
+ catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /*
+ * Finds and returns URLs to all files in the plugin directory under the given
+ * folder with the given suffix. Can also recursively traverse all subfolders.
+ */
+ public static URL[] findFiles(Plugin plugin, String folder, String suffix, boolean recursive) {
+ String fullLocation = plugin.getBundle().getLocation();
+ String location = fullLocation.substring(fullLocation.indexOf('@') + 1);
+ IPath path = new Path(location).append(folder);
+ File file = path.toFile();
+
+ /*
+ * If it's a relative path, append it to the install location.
+ */
+ if (!file.exists()) {
+ path = new Path(Platform.getInstallLocation().getURL().toString().substring("file:".length()) + path);
+ file = path.toFile();
+ }
+
+ File[] files = path.toFile().listFiles();
+ return findFiles(files, suffix, recursive);
+ }
+
+ /*
+ * Finds and returns URLs to all files in the given list that have the given suffix, and
+ * recursively traverses subdirectories if requested.
+ */
+ private static URL[] findFiles(File[] files, String suffix, boolean recursive) {
+ List list = new ArrayList();
+ if (files != null) {
+ for (int i=0;i<files.length;++i) {
+ if (files[i].isDirectory()) {
+ if (recursive) {
+ list.addAll(Arrays.asList(findFiles(files[i].listFiles(), suffix, recursive)));
+ }
+ }
+ else {
+ try {
+ URL url = files[i].toURL();
+ if (url.toString().endsWith(suffix)) {
+ list.add(url);
+ }
+ }
+ catch (MalformedURLException e) {
+ }
+ }
+ }
+ }
+
+ URL[] array = new URL[list.size()];
+ list.toArray(array);
+ return array;
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java
new file mode 100644
index 000000000..054d4dcf0
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+/*
+ * Utility methods for working with Trees.
+ */
+public class TreeUtil {
+
+ /*
+ * Fully expands the given tree.
+ */
+ public static void expandTree(Tree tree) {
+ tree.setFocus();
+ TreeItem[] items = tree.getItems();
+ for (int i=0;i<items.length;++i) {
+ tree.setSelection(new TreeItem[] { items[i] });
+ Keyboard.press(SWT.ARROW_RIGHT);
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetChecker.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetChecker.java
new file mode 100644
index 000000000..557702349
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetChecker.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import junit.framework.Assert;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+
+/*
+ * A utility for checking widget properties.
+ */
+public class WidgetChecker {
+
+ /*
+ * Checks if the control is non-null, not disposed, and is visible. Msg is the
+ * description of the widget (e.g. "The Tree in the cheat sheets dialog").
+ */
+ public static void checkControl(String msg, Control c) {
+ Assert.assertNotNull("The following control was unexpectedly null: " + msg, c);
+ Assert.assertFalse("The following control was unexpectedly disposed: " + msg, c.isDisposed());
+ Assert.assertTrue("The following control was unexpectedly not visible: " + msg, c.isVisible());
+ }
+
+ /*
+ * Checks if the item is non-null and not disposed. Msg is the description of the item
+ * (e.g. "Tree item in the cheat sheets dialog").
+ */
+ public static void checkItem(String msg, Item c) {
+ Assert.assertNotNull("The following item was unexpectedly null: " + msg, c);
+ Assert.assertFalse("The following item was unexpectedly disposed: " + msg, c.isDisposed());
+ }
+}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetFinder.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetFinder.java
new file mode 100644
index 000000000..dec0cb02d
--- /dev/null
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/WidgetFinder.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.util;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Tree;
+
+/*
+ * A utility for finding widgets inside dialogs.
+ */
+public class WidgetFinder {
+
+ /*
+ * Finds all controls of the given type.
+ */
+ public static Control[] findControls(Control c, Class type) {
+ if (c != null) {
+ if (c instanceof Composite) {
+ List allChildren = new ArrayList();
+ Control[] children = ((Composite)c).getChildren();
+ for (int i=0;i<children.length;++i) {
+ Control[] controls = findControls(children[i], type);
+ if (controls != null) {
+ allChildren.addAll(Arrays.asList(controls));
+ }
+ }
+
+ boolean isAssignable = type.isAssignableFrom(c.getClass());
+ Control[] array = new Control[allChildren.size() + (isAssignable ? 1 : 0)];
+ allChildren.toArray(array);
+ if (isAssignable) {
+ array[array.length - 1] = c;
+ }
+ return array;
+ }
+ else if (type.isAssignableFrom(c.getClass())) {
+ return new Control[] { c };
+ }
+ }
+ return new Control[0];
+ }
+
+ /*
+ * Finds all the Trees under the given Control/Composite.
+ */
+ public static Tree[] findTrees(Control c) {
+ Control[] controls = findControls(c, Tree.class);
+ Tree[] trees = new Tree[controls.length];
+ System.arraycopy(controls, 0, trees, 0, controls.length);
+ return trees;
+ }
+
+ /*
+ * Finds all the Labels under the given Control/Composite.
+ */
+ public static Label[] findLabels(Control c) {
+ Control[] controls = findControls(c, Label.class);
+ Label[] labels = new Label[controls.length];
+ System.arraycopy(controls, 0, labels, 0, controls.length);
+ return labels;
+ }
+
+ /*
+ * Finds any widget that has a getText() method that matches the given text.
+ */
+ public static boolean containsText(String text, Control c) {
+ // don't take \r into account when comparing
+ text = text.replaceAll("\r", "");
+
+ Control[] controls = findControls(c, Control.class);
+ for (int i=0;i<controls.length;++i) {
+ try {
+ Method m = controls[i].getClass().getMethod("getText", null);
+ Object obj = m.invoke(controls[i], null);
+ if (obj != null && obj instanceof String) {
+ String widgetText = (String)obj;
+ widgetText = widgetText.replaceAll("\r", "");
+ if (text.equals(widgetText)) {
+ return true;
+ }
+ }
+ }
+ catch (Exception e) {
+ // the method didn't exist; skip this one
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.ua.tests/build.properties b/org.eclipse.ua.tests/build.properties
index 4b096d4e1..a716bfc4f 100644
--- a/org.eclipse.ua.tests/build.properties
+++ b/org.eclipse.ua.tests/build.properties
@@ -9,6 +9,15 @@
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = plugin.xml,\
- *.jar,\
- cheatsheetTests.jar
-source.cheatsheetTests.jar = src/
+ icons/,\
+ contexts.xml,\
+ cheatsheets/,\
+ test.xml,\
+ ua-tests.jar,\
+ data/,\
+ META-INF/
+jars.compile.order = ua-tests.jar
+output.ua-tests.jar = bin/
+source.ua-tests.jar = base/,\
+ cheatsheet/,\
+ intro/
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetTests.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetTests.java
new file mode 100644
index 000000000..3a21b931d
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetTests.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests.cheatsheet;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.cheatsheet.parser.AllParserTests;
+import org.eclipse.ua.tests.cheatsheet.views.AllViewTests;
+
+/*
+ * Tests all cheat sheet functionality (automated).
+ */
+public class AllCheatSheetTests extends TestSuite {
+
+ /*
+ * Returns the entire test suite.
+ */
+ public static Test suite() {
+ return new AllCheatSheetTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllCheatSheetTests() {
+ addTest(AllParserTests.suite());
+ addTest(AllViewTests.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/AllParserTests.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/AllParserTests.java
new file mode 100644
index 000000000..d861c3621
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/AllParserTests.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests.cheatsheet.parser;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/*
+ * Tests all cheat sheet parser functionality (automated).
+ */
+public class AllParserTests extends TestSuite {
+
+ /*
+ * Returns the test suite.
+ */
+ public static Test suite() {
+ return new AllParserTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllParserTests() {
+ addTest(ValidTest.suite());
+ addTest(InvalidTest.suite());
+ addTest(TolerateTest.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidTest.java
new file mode 100644
index 000000000..313a3ae9a
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidTest.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.parser;
+
+import java.net.URL;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheetParser;
+
+/*
+ * Tests the cheat sheets parser on invalid cheat sheets.
+ */
+public class InvalidTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(InvalidTest.class);
+ }
+
+ /*
+ * Test all invalid cheat sheets.
+ */
+ public void testParserInvalid() {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/cheatsheet/invalid", ".xml", true);
+ Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
+ for (int i=0;i<urls.length;++i) {
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet sheet = parser.parse(urls[i]);
+ Assert.assertNull("Tried parsing an invalid rational cheat sheet but parser did not return null: " + urls[i], sheet);
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/TolerateTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/TolerateTest.java
new file mode 100644
index 000000000..282016165
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/TolerateTest.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.parser;
+
+import java.net.URL;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheetParser;
+
+/*
+ * Tests the cheat sheets parser on tolerable cheat sheets. This means they're not strictly correct,
+ * but the parser will tolerate them.
+ */
+public class TolerateTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(TolerateTest.class);
+ }
+
+ /*
+ * Test cheat sheets that are not quite correct, but are tolerated by the parser.
+ */
+ public void testParserTolerate() {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/cheatsheet/valid/tolerate", ".xml", true);
+ Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
+ for (int i=0;i<urls.length;++i) {
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet sheet = parser.parse(urls[i]);
+ Assert.assertNotNull("Tried parsing a tolerable cheat sheet but parser returned null: " + urls[i], sheet);
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/ValidTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/ValidTest.java
new file mode 100644
index 000000000..090d02b26
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/ValidTest.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.parser;
+
+import java.net.URL;
+import java.util.StringTokenizer;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.cheatsheet.util.CheatSheetModelSerializer;
+import org.eclipse.ua.tests.intro.util.IntroModelSerializerTest;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.FileUtil;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheetParser;
+
+/*
+ * Tests the cheat sheets parser on valid cheat sheets.
+ */
+public class ValidTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(ValidTest.class);
+ }
+
+ /*
+ * Test valid cheat sheets.
+ */
+ public void testParserValid() {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/cheatsheet/valid", ".xml", false);
+ Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
+ for (int i=0;i<urls.length;++i) {
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet sheet = parser.parse(urls[i]);
+ Assert.assertNotNull("Tried parsing a valid cheat sheet but parser returned null: " + urls[i], sheet);
+
+ String resultFile = IntroModelSerializerTest.getResultFile(urls[i].toString().substring("file:".length()));
+
+ try {
+ String expected = FileUtil.getContents(resultFile);
+ String actual = CheatSheetModelSerializer.serialize(sheet);
+
+ StringTokenizer tok1 = new StringTokenizer(expected, "\n");
+ StringTokenizer tok2 = new StringTokenizer(actual, "\n");
+
+ /*
+ * Report the line number and line text where it didn't match,
+ * as well as the extension id and expected results file.
+ */
+ int lineNumber = 0;
+ while (tok1.hasMoreTokens() && tok2.hasMoreTokens()) {
+ String a = tok1.nextToken();
+ String b = tok2.nextToken();
+ Assert.assertEquals("Serialized cheat sheet model text for \"" + resultFile + "\" did not match expected result. First difference occured on line " + lineNumber + ".", a, b);
+ ++lineNumber;
+ }
+ }
+ catch(Exception e) {
+ Assert.fail("An error occured while loading expected result file for intro at: " + resultFile + ": " + e);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java
new file mode 100644
index 000000000..1863cb50c
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java
@@ -0,0 +1,278 @@
+/*******************************************************************************
+ * Copyright (c) 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.ua.tests.cheatsheet.util;
+
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
+import org.eclipse.ui.internal.cheatsheets.data.AbstractSubItem;
+import org.eclipse.ui.internal.cheatsheets.data.Action;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.ConditionalSubItem;
+import org.eclipse.ui.internal.cheatsheets.data.Item;
+import org.eclipse.ui.internal.cheatsheets.data.PerformWhen;
+import org.eclipse.ui.internal.cheatsheets.data.RepeatedSubItem;
+import org.eclipse.ui.internal.cheatsheets.data.SubItem;
+
+/*
+ * Serializes cheat sheets as XML.
+ */
+public class CheatSheetModelSerializer {
+
+ /*
+ * Serializes the given cheat sheet model as XML.
+ */
+ public static String serialize(CheatSheet sheet) {
+ StringBuffer buf = new StringBuffer();
+ buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
+ if (sheet == null) {
+ buf.append("<nullCheatSheet/>\n");
+ }
+ else {
+ buf.append("<cheatsheet\n");
+ buf.append(" title=\"" + sheet.getTitle() + "\">\n");
+ buf.append(serialize(sheet.getIntroItem(), " "));
+ buf.append(serialize(sheet.getItems(), " "));
+ buf.append("</cheatsheet>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given Item with the specified indentation.
+ */
+ public static String serialize(Item item, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (item == null) {
+ buf.append(indent + "<nullItem/>\n");
+ }
+ else {
+ buf.append(indent + "<item\n");
+ buf.append(indent + " title=\"" + item.getTitle() + "\"\n");
+ buf.append(indent + " description=\"" + item.getDescription() + "\"\n");
+ buf.append(indent + " Href=\"" + item.getHref() + "\"\n");
+ buf.append(indent + " contextId=\"" + item.getContextId() + "\">\n");
+ buf.append(serialize(item.getAction(), indent + " "));
+ buf.append(serialize(item.getItemExtensions(), indent + " "));
+ buf.append(serialize(item.getPerformWhen(), indent + " "));
+ buf.append(serialize(item.getSubItems(), indent + " "));
+ buf.append(indent + "</item>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given Action with the specified indentation.
+ */
+ public static String serialize(Action action, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (action == null) {
+ buf.append(indent + "<nullAction/>\n");
+ }
+ else {
+ buf.append(indent + "<action\n");
+ buf.append(indent + " class=\"" + action.getActionClass() + "\"\n");
+ buf.append(indent + " pluginId=\"" + action.getPluginID() + "\"\n");
+ buf.append(indent + " when=\"" + action.getWhen() + "\"\n");
+ buf.append(indent + " isConfirm=\"" + action.isConfirm() + "\">\n");
+ buf.append(serialize(action.getParams(), indent + " "));
+ buf.append(indent + "</action>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given String with the specified indentation.
+ */
+ public static String serialize(String string, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (string == null) {
+ buf.append(indent + "<nullString/>\n");
+ }
+ else {
+ buf.append(indent + "<string\n");
+ buf.append(indent + " value=\"" + string + "\">\n");
+ buf.append(indent + "</string>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given AbstractItemExtensionElement with the specified indentation.
+ */
+ public static String serialize(AbstractItemExtensionElement ext, String indent) {
+ StringBuffer buf = new StringBuffer();
+ buf.append(indent + "<itemExtension\n");
+ buf.append(indent + " attributeName=\"" + ext.getAttributeName() + "\">\n");
+ buf.append(indent + "</itemExtension>\n");
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given PerformWhen with the specified indentation.
+ */
+ public static String serialize(PerformWhen performWhen, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (performWhen == null) {
+ buf.append(indent + "<nullPerformWhen/>\n");
+ }
+ else {
+ buf.append(indent + "<performWhen\n");
+ buf.append(indent + " condition=\"" + performWhen.getCondition() + "\">\n");
+ buf.append(serialize(performWhen.getActions(), indent + " "));
+ buf.append(indent + "</performWhen>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given AbstractSubItem with the specified indentation.
+ */
+ public static String serialize(AbstractSubItem subItem, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (subItem == null) {
+ buf.append(indent + "<nullSubItem/>\n");
+ }
+ else {
+ if (subItem instanceof ConditionalSubItem) {
+ ConditionalSubItem c = (ConditionalSubItem)subItem;
+ buf.append(indent + "<conditionalSubItem\n");
+ buf.append(indent + " condition=\"" + c.getCondition() + "\">\n");
+ buf.append(serialize(c.getSubItems(), indent + " "));
+ buf.append(indent + "</conditionalSubItem>\n");
+ }
+ else if (subItem instanceof RepeatedSubItem) {
+ RepeatedSubItem r = (RepeatedSubItem)subItem;
+ buf.append(indent + "<repeatedSubItem\n");
+ buf.append(indent + " values=\"" + r.getValues() + "\">\n");
+ buf.append(serialize(r.getSubItems(), indent + " "));
+ buf.append(indent + "</repeatedSubItem>\n");
+ }
+ else if (subItem instanceof SubItem) {
+ SubItem s = (SubItem)subItem;
+ buf.append(indent + "<subItem\n");
+ buf.append(indent + " label=\"" + s.getLabel() + "\"\n");
+ buf.append(indent + " when=\"" + s.getWhen() + "\"\n");
+ buf.append(indent + " isSkip=\"" + s.isSkip() + "\">\n");
+ buf.append(serialize(s.getAction(), indent + " "));
+ buf.append(serialize(s.getPerformWhen(), indent + " "));
+ buf.append(indent + "</subItem>\n");
+ }
+ else {
+ throw new IllegalArgumentException("Unknown sub item type: " + subItem.getClass());
+ }
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given array with the specified indentation.
+ */
+ public static String serialize(Object[] array, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (array == null) {
+ buf.append(indent + "<nullArray/>\n");
+ }
+ else if (array.length == 0) {
+ buf.append(indent + "<array/>\n");
+ }
+ else {
+ buf.append(indent + "<array>\n");
+ for (int i=0;i<array.length;++i) {
+ Object obj = array[i];
+ if (obj != null) {
+ Class c = obj.getClass();
+ /*
+ * Find a serializer method that knows how to serialize this
+ * object.
+ */
+ boolean found = false;
+ Method[] methods = CheatSheetModelSerializer.class.getMethods();
+ for (int j=0;j<methods.length;++j) {
+ Class[] params = methods[j].getParameterTypes();
+ if (params.length == 2 && params[0].isAssignableFrom(c) && params[1].equals(String.class)) {
+ try {
+ buf.append(methods[j].invoke(null, new Object[] {obj, indent + " "}));
+ }
+ catch(Exception e) {
+ buf.append(indent + " " + e + ", cause: " + e.getCause());
+ e.printStackTrace();
+ }
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ System.err.println("Could not find serializer for: " + c);
+ }
+ }
+ else {
+ buf.append(indent + " <nullObject/>\n");
+ }
+ }
+ buf.append(indent + "</array>\n");
+ }
+ return buf.toString();
+ }
+
+ /*
+ * Serializes the given List with the specified indentation.
+ */
+ public static String serialize(List list, String indent) {
+ StringBuffer buf = new StringBuffer();
+ if (list == null) {
+ buf.append(indent + "<nullList/>\n");
+ }
+ else if (list.isEmpty()) {
+ buf.append(indent + "<list/>\n");
+ }
+ else {
+ buf.append(indent + "<list>\n");
+ Iterator iter = list.iterator();
+ while (iter.hasNext()) {
+ Object obj = iter.next();
+ if (obj != null) {
+ Class c = obj.getClass();
+ /*
+ * Find a serializer method that knows how to serialize this
+ * object.
+ */
+ boolean found = false;
+ Method[] methods = CheatSheetModelSerializer.class.getMethods();
+ for (int i=0;i<methods.length;++i) {
+ Class[] params = methods[i].getParameterTypes();
+ if (params.length == 2 && params[0].isAssignableFrom(c) && params[1].equals(String.class)) {
+ try {
+ buf.append(methods[i].invoke(null, new Object[] {obj, indent + " "}));
+ }
+ catch(Exception e) {
+ buf.append(indent + " " + e + ", cause: " + e.getCause());
+ e.printStackTrace();
+ }
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ System.err.println("Could not find serializer for: " + c);
+ }
+ }
+ else {
+ buf.append(indent + " <nullObject/>\n");
+ }
+ }
+ buf.append(indent + "</list>\n");
+ }
+ return buf.toString();
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java
new file mode 100644
index 000000000..ff613204e
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.cheatsheet.util;
+
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheetParser;
+
+/*
+ * A utility for regenerating the _serialized.txt files that contain the expected
+ * output for the cheat sheet content when serialized. This reads all the cheat
+ * sheet content in the /data/cheatsheet/valid folder, constructs the cheat sheet
+ * model, then serializes the model to a text file, which is stored in the same
+ * directory as the xml file, as <original_name>_serialized.txt.
+ *
+ * These files are used by the JUnit tests to compare the result with the expected
+ * result.
+ *
+ * Usage:
+ *
+ * 1. Run the "org.eclipse.ua.tests.cheatsheet.util.CheatSheetModelSerializerTest" eclipse application.
+ * 2. Right-click in "Package Explorer -> Refresh".
+ *
+ * The new files should appear.
+ */
+public class CheatSheetModelSerializerTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(CheatSheetModelSerializerTest.class);
+ }
+
+ public void testRunSerializer() {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/cheatsheet/valid", ".xml", true);
+ Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
+ for (int i=0;i<urls.length;++i) {
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet sheet = parser.parse(urls[i]);
+ Assert.assertNotNull("Tried parsing a valid cheat sheet but parser returned null: " + urls[i], sheet);
+
+ try {
+ PrintWriter out = new PrintWriter(new FileOutputStream(getResultFile(urls[i].toString().substring("file:/".length()))));
+ out.print(CheatSheetModelSerializer.serialize(sheet));
+ out.close();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*
+ * Generates a filename with path to the result file that will be generated
+ * for the intro xml referred to by the string.
+ */
+ public static String getResultFile(String in) {
+ return in.substring(0, in.lastIndexOf('.')) + "_serialized.txt";
+ }
+}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/VisitorCustomizeAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/IncrementVariableAction.java
index e452d0cfc..7e7f7e3fd 100644
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/VisitorCustomizeAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/IncrementVariableAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,13 +8,23 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
+package org.eclipse.ua.tests.cheatsheet.util;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+import org.eclipse.jface.action.Action;
-public class VisitorCustomizeAction extends CustomizeAction {
- public void run(String[] params, ICheatSheetManager csm) {
- System.out.println("In VisitorCustomizeAction");
- super.run(params, csm);
+/*
+ * An action that increments its own static variable. This is used to test
+ * whether or not cheat sheet actions are being run properly (by checking
+ * the variable after).
+ */
+public class IncrementVariableAction extends Action {
+
+ public static int variable = 0;
+
+ /*
+ * Increments the variable by one.
+ */
+ public void run() {
+ variable++;
}
}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java
index 2da1a8799..7bb233456 100644
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,16 +8,17 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
+package org.eclipse.ua.tests.cheatsheet.util;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.cheatsheets.*;
+import org.eclipse.ui.cheatsheets.ICheatSheetAction;
+import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
public class NavigateAction extends Action implements ICheatSheetAction {
- static void go( String newSheet ) {
- System.out.println( "Test.go newSheet:(" + newSheet + ")" );
+ private static void go(String newSheet) {
final String finalNewSheet = newSheet;
try {
Display.getCurrent().asyncExec( new Runnable() {
@@ -27,12 +28,12 @@ public class NavigateAction extends Action implements ICheatSheetAction {
}
} );
}
- catch( Exception ex ) { }
+ catch(Exception ex) {
+ ex.printStackTrace();
+ }
}
public void run( String[] params, ICheatSheetManager manager ) {
- System.out.println( "Test.run manager:(" + manager.toString() + ")" );
- System.out.println( "Test.run sheetID:(" + manager.getCheatSheetID() + ")" );
go( params[ 0 ] );
}
}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/FactoryCustomizeAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NoopAction.java
index 46b635bbd..8d49758a5 100644
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/FactoryCustomizeAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NoopAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,13 +8,18 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
+package org.eclipse.ua.tests.cheatsheet.util;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+import org.eclipse.jface.action.Action;
-public class FactoryCustomizeAction extends CustomizeAction {
- public void run(String[] params, ICheatSheetManager csm) {
- System.out.println("In FactoryCustomizeAction");
- super.run(params, csm);
+/*
+ * An action that does nothing.
+ */
+public class NoopAction extends Action {
+
+ /*
+ * Do nothing.
+ */
+ public void run() {
}
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ActionTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ActionTest.java
new file mode 100644
index 000000000..0e9299bc2
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ActionTest.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.views;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.Keyboard;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
+
+/*
+ * Tests the cheat sheet actions.
+ */
+public class ActionTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(ActionTest.class);
+ }
+
+ /*
+ * Open the cheat sheets dialog.
+ */
+ protected void setUp() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ }
+
+ /*
+ * Run through the TestActionsWithSkip.xml actions.
+ */
+ public void testSimpleActions() {
+ /*
+ * Open the cheat sheet
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction("org.eclipse.ua.tests.cheatsheet.actions.TestActionsWithSkip");
+ action.run();
+
+ /*
+ * Initialize variable. Two of the actions will increment this.
+ */
+ IncrementVariableAction.variable = 0;
+
+ /*
+ * Complete intro item
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ /*
+ * Complete all other actions
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 1);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 1);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 2);
+ }
+
+ /*
+ * Run through the TestActionsWithSkip.xml actions, skipping some of them and
+ * verifying that they don't get executed.
+ */
+ public void testSkipActions() {
+ /*
+ * Open the cheat sheet
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction("org.eclipse.ua.tests.cheatsheet.actions.TestActionsWithSkip");
+ action.run();
+
+ /*
+ * Initialize variable. Two of the actions will increment this.
+ */
+ IncrementVariableAction.variable = 0;
+
+ /*
+ * Complete intro item
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ /*
+ * Complete all other actions, skipping some of them
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB); // skip (don't increment)
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB); // skip
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 1);
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/AllViewTests.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/AllViewTests.java
new file mode 100644
index 000000000..a2d408969
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/AllViewTests.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests.cheatsheet.views;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/*
+ * Tests all cheat sheet view functionality (automated).
+ */
+public class AllViewTests extends TestSuite {
+
+ /*
+ * Returns the test suite.
+ */
+ public static Test suite() {
+ return new AllViewTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllViewTests() {
+ addTest(ActionTest.suite());
+ addTest(ContentTest.suite());
+ //addTest(ContextHelpTest.suite());
+ addTest(SubItemsTest.suite());
+ addTest(URLTest.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContentTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContentTest.java
new file mode 100644
index 000000000..1801e8b29
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContentTest.java
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.views;
+
+import java.util.Iterator;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.DisplayUtil;
+import org.eclipse.ua.tests.util.Keyboard;
+import org.eclipse.ua.tests.util.WidgetFinder;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
+import org.eclipse.ui.internal.cheatsheets.Messages;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.Item;
+import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
+import org.eclipse.ui.internal.cheatsheets.views.CheatSheetViewer;
+
+/*
+ * Tests the cheat sheets view content.
+ */
+public class ContentTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(ContentTest.class);
+ }
+
+ /*
+ * Make sure the view is not open.
+ */
+ protected void setUp() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ }
+
+ /*
+ * Open all cheat sheets, then close them.
+ */
+ public void testOpenCheatSheets() {
+ IExtensionPoint extPt = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.cheatsheets.cheatSheetContent");
+ IExtension[] extensions = extPt.getExtensions();
+ for (int i=0;i<extensions.length;++i) {
+ IConfigurationElement[] elem = extensions[i].getConfigurationElements();
+ for (int j=0;j<elem.length;++j) {
+ if (elem[j].getName().equals("cheatsheet")) {
+ OpenCheatSheetAction action = new OpenCheatSheetAction(elem[j].getAttribute("id"));
+ action.run();
+ DisplayUtil.flush();
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IViewPart view = page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+ Assert.assertNotNull("The cheat sheet view could not be opened.", view);
+ page.hideView(view);
+ }
+ }
+ }
+ }
+
+ /*
+ * Open the view with no cheat sheet, and make sure it displays the appropriate message.
+ */
+ public void testOpenEmptyView() {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ try {
+ page.showView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+ CheatSheetView view = (CheatSheetView)page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+ Assert.assertNotNull("Unable to open cheat sheet view with no cheat sheet", view);
+ Assert.assertTrue("Did not find the appropriate error string in the cheat sheet view upon opening with no cheat sheet", WidgetFinder.containsText(Messages.INITIAL_VIEW_DIRECTIONS, view.getCheatSheetViewer().getControl()));
+ }
+ catch(Exception e) {
+ Assert.fail("An exception was thrown while trying to open an empty cheat sheet view: " + e);
+ }
+ }
+
+ /*
+ * Try to open a non-existant cheat sheet.
+ */
+ public void testOpenNonExistantSheet() {
+ /*
+ * First make sure the view is closed.
+ */
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ CheatSheetView view = (CheatSheetView)page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+ if (view != null) {
+ page.hideView(view);
+ }
+
+ /*
+ * Try to open an invalid cheat sheet.
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction("this.id.is.not.valid");
+ action.run();
+
+ /*
+ * Confirm the view shows and displays the right error message.
+ */
+ view = (CheatSheetView)page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+ Assert.assertNotNull("Tried opening an invalid cheat sheet, but the view did not show (it should show with an error message)", view);
+
+ Control viewControl = view.getCheatSheetViewer().getControl();
+ Assert.assertTrue("Did not find the correct error message for the cheat sheet view title when opening non-existent cheat sheet", WidgetFinder.containsText(Messages.ERROR_LOADING_CHEATSHEET_CONTENT, viewControl));
+ Assert.assertTrue("Did not find the correct error message for the cheat sheet view body when opening non-existent cheat sheet", WidgetFinder.containsText(Messages.ERROR_CHEATSHEET_DOESNOT_EXIST, viewControl));
+ }
+
+ /*
+ * Run through the cheat sheets.
+ */
+ public void testRunThroughCheatSheets() {
+ IExtensionPoint extPt = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.cheatsheets.cheatSheetContent");
+ IExtension[] extensions = extPt.getExtensions();
+ for (int i=0;i<extensions.length;++i) {
+ IConfigurationElement[] elem = extensions[i].getConfigurationElements();
+ for (int j=0;j<elem.length;++j) {
+ if (elem[j].getName().equals("cheatsheet")) {
+ /*
+ * Open the cheat sheet
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction(elem[j].getAttribute("id"));
+ action.run();
+
+ /*
+ * Find the view
+ */
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ CheatSheetView view = (CheatSheetView)page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+
+ /*
+ * Verify the title
+ */
+ try {
+ String cheatSheetTitle = view.getCheatSheetViewer().getCheatSheet().getTitle();
+ Assert.assertTrue("The cheat sheet's title did not appear anywhere in the cheat sheets view.", WidgetFinder.containsText(cheatSheetTitle, view.getCheatSheetViewer().getControl()));
+ }
+ catch (Exception e) {
+ /*
+ * Something went wrong. Ensure that the error page is shown.
+ */
+ Assert.assertTrue("An error occured, but the error title was not displayed in the cheat sheet view", WidgetFinder.containsText(Messages.ERROR_LOADING_CHEATSHEET_CONTENT, view.getCheatSheetViewer().getControl()));
+ Assert.assertTrue("An error occured, but the error message was not displayed in the cheat sheet view", WidgetFinder.containsText(Messages.ERROR_PAGE_MESSAGE, view.getCheatSheetViewer().getControl()));
+
+ /*
+ * Don't step through this one.
+ */
+ continue;
+ }
+
+ /*
+ * Step through the cheat sheet
+ */
+ CheatSheetViewer viewer = view.getCheatSheetViewer();
+ CheatSheet sheet = viewer.getCheatSheet();
+
+ /*
+ * Verify the initial item, it is open by default.
+ */
+ Item intro = sheet.getIntroItem();
+ Assert.assertTrue("Could not find the intro cheat sheet item title in the cheat sheet view: \"" + intro.getTitle() + "\"", WidgetFinder.containsText(intro.getTitle(), viewer.getControl()));
+
+ // no way to get text from a FormText
+ //Assert.assertTrue("Could not find the intro cheat sheet item descriptions in the cheat sheet view: \"" + intro.getDescription() + "\"", WidgetFinder.containsText(intro.getDescription(), viewer.getControl()));
+
+ Keyboard.press(SWT.ARROW_LEFT);
+ Keyboard.press(SWT.ARROW_DOWN);
+
+ /*
+ * Verify all other items
+ */
+ Iterator iter = sheet.getItems().iterator();
+ while (iter.hasNext()) {
+ Item item = (Item)iter.next();
+ Keyboard.press(SWT.ARROW_RIGHT);
+ Assert.assertTrue("Could not find one of the cheat sheet item titles in the cheat sheet view: \"" + item.getTitle() + "\"", WidgetFinder.containsText(item.getTitle(), viewer.getControl()));
+
+ // no way to get text from a FormText
+ //Assert.assertTrue("Could not find one of the cheat sheet item descriptions in the cheat sheet view: \"" + item.getDescription() + "\"", WidgetFinder.containsText(item.getDescription(), viewer.getControl()));
+
+ Keyboard.press(SWT.ARROW_LEFT);
+ Keyboard.press(SWT.ARROW_DOWN);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContextHelpTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContextHelpTest.java
new file mode 100644
index 000000000..7faf136a4
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/ContextHelpTest.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.views;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.Keyboard;
+import org.eclipse.ua.tests.util.WidgetFinder;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
+import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
+
+/*
+ * Tests the cheat sheets view content.
+ */
+public class ContextHelpTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(ContextHelpTest.class);
+ }
+
+ /*
+ * Make sure cheat sheet and help view are not open.
+ */
+ protected void setUp() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ page.hideView(page.findView("org.eclipse.help.ui.HelpView"));
+ }
+
+ /*
+ * Close all the views when finished.
+ */
+ protected void tearDown() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ page.hideView(page.findView("org.eclipse.help.ui.HelpView"));
+ }
+
+ /*
+ * Tests the context help for a cheat sheet.
+ */
+ public void testContextHelp() {
+ /*
+ * Open the cheat sheet
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction("org.eclipse.ua.tests.infopop.help");
+ action.run();
+
+ IWorkbenchWindow window = CheatSheetPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
+ Shell workbenchShell = window.getShell();
+ IWorkbenchPage page = window.getActivePage();
+ Assert.assertFalse("Unexpectedly found the infopop text before starting the test. It should not be present yet; halting test.", WidgetFinder.containsText("Infopop test successful>! The \"contextId\" was specified correctly in the cheat sheets content file.", workbenchShell));
+
+ /*
+ * Complete intro item
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ /*
+ * Complete all other actions
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ IViewPart helpView = page.findView("org.eclipse.help.ui.HelpView");
+ Assert.assertNotNull("Opened context help, but the help view did not appear", helpView);
+ Assert.assertTrue("The help view was not visible after opening context help (it was in the background)", page.isPartVisible(helpView));
+ Assert.assertTrue("Could not find the infopop text that was supposed to appear", WidgetFinder.containsText("Infopop test successful! The \"contextId\" was specified correctly in the cheat sheets content file.", workbenchShell));
+ Assert.assertTrue("Could not find the infopop link that was supposed to appear", WidgetFinder.containsText("abcdefg", workbenchShell));
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/SubItemsTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/SubItemsTest.java
new file mode 100644
index 000000000..4198631ec
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/SubItemsTest.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.views;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.Keyboard;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
+
+/*
+ * Tests cheat sheet sub-items.
+ */
+public class SubItemsTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(SubItemsTest.class);
+ }
+
+ /*
+ * Make sure the cheat sheet view is closed before starting.
+ */
+ protected void setUp() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ }
+
+ /*
+ * Close the cheat sheet view.
+ */
+ protected void tearDown() throws Exception {
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+ }
+
+ /*
+ * Run through the TestSubItems.xml actions.
+ */
+ public void testSubItems() {
+ /*
+ * Open the cheat sheet
+ */
+ OpenCheatSheetAction action = new OpenCheatSheetAction("org.eclipse.ua.tests.cheatsheet.subitems");
+ action.run();
+
+ /*
+ * Initialize variable. Two of the actions will increment this.
+ */
+ IncrementVariableAction.variable = 0;
+
+ /*
+ * Complete intro item
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r');
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ /*
+ * Complete all other actions
+ */
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub1 : complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 0);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub2: perform action
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 1);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub3: complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 1);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub4: perform action
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 2);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub5: complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 2);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub6: perform action
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 3);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub7: complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 3);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub8: perform action
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub9: skip
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub10: skip
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub11: perform action (no-op)
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // sub12: complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+
+ Keyboard.press(SWT.TAB);
+ Keyboard.press(SWT.TAB);
+ Keyboard.press('\r'); // All Done!: complete
+
+ Assert.assertEquals("IncrementVariableAction.variable was not the expected value", IncrementVariableAction.variable, 4);
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/URLTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/URLTest.java
new file mode 100644
index 000000000..e7c70a12a
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/views/URLTest.java
@@ -0,0 +1,376 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.cheatsheet.views;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.help.internal.appserver.WebappManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.Keyboard;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ua.tests.util.WidgetFinder;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
+import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
+import org.eclipse.ui.internal.cheatsheets.Messages;
+import org.eclipse.ui.internal.cheatsheets.data.Action;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheet;
+import org.eclipse.ui.internal.cheatsheets.data.CheatSheetParser;
+import org.eclipse.ui.internal.cheatsheets.data.Item;
+import org.eclipse.ui.internal.cheatsheets.data.PerformWhen;
+import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
+import org.eclipse.ui.internal.cheatsheets.views.CheatSheetViewer;
+
+/*
+ * Tests the cheat sheets view content.
+ */
+public class URLTest extends TestCase {
+
+ private static final String WEB_APP_NAME = "cheatsheets.test";
+
+ private String fHostName;
+ private int fPort;
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(URLTest.class);
+ }
+
+ /*
+ * Hide the view and turn on the web server that will serve the cheat sheets.
+ */
+ protected void setUp() throws Exception {
+ /*
+ * Make sure the view is closed.
+ */
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+
+ WebappManager.start(WEB_APP_NAME, "org.eclipse.ua.tests", new Path("data/cheatsheet/valid"));
+ fHostName = WebappManager.getHost();
+ fPort = WebappManager.getPort();
+ }
+
+ protected void tearDown() throws Exception {
+ /*
+ * Make sure the view is closed.
+ */
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.hideView(page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView"));
+
+ /*
+ * Stop the app server when done.
+ */
+ WebappManager.stop(WEB_APP_NAME);
+ }
+
+ /*
+ * Tests trying to open an invalid URL.
+ */
+ public void testInvalidURLParsing() {
+ try {
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet sheet = parser.parse(new URL("http://ladsfkjaafkewryugakewf:12345/asdfasdf/asfdasfa"));
+ Assert.assertNull("Tried parsing a cheat sheet from an invalid URL, but got a non-null CheatSheet!", sheet);
+ }
+ catch (MalformedURLException e) {
+ Assert.fail("Got a MalformedURLException in URL test");
+ }
+ }
+
+ /*
+ * Check to make sure that the parsed cheat sheet via URL is the same as via file.
+ */
+ public void testURLParsing() {
+ final String PATH = "data/cheatsheet/valid";
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), PATH, ".xml", true);
+ Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
+
+ for (int i=0;i<urls.length;++i) {
+ String path = urls[i].getPath();
+ String relative = path.substring(path.indexOf(PATH) + PATH.length() + 1);
+ String urlString = "http://" + fHostName + ":" + fPort + "/" + WEB_APP_NAME + "/" + relative;
+ URL url = null;
+ try {
+ url = new URL(urlString);
+ }
+ catch (MalformedURLException e) {
+ Assert.fail("Got a MalformedURLException in URL test: " + urlString);
+ }
+
+ CheatSheetParser parser = new CheatSheetParser();
+ CheatSheet local = parser.parse(urls[i]);
+ CheatSheet remote = parser.parse(url);
+
+ verifyEquals("Cheat sheets parsed via URL and directly did not match", local, remote);
+ }
+ }
+
+ /*
+ * Test the cheat sheet view content with URL (TestOpeningURL.xml).
+ */
+ public void testViewWithURL() {
+ /*
+ * Open the cheat sheet
+ */
+ try {
+ OpenCheatSheetAction action = new OpenCheatSheetAction("url.cheatsheet.id", "My URL Cheat Sheet", new URL("http://" + fHostName + ":" + fPort + "/" + WEB_APP_NAME + "/TestOpeningURL.xml"));
+ action.run();
+ }
+ catch(Exception e) {
+ Assert.fail("An exception was thrown while opening the cheat sheet with a URL: " + e);
+ }
+
+ /*
+ * Find the view
+ */
+ IWorkbenchPage page = UserAssistanceTestPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ CheatSheetView view = (CheatSheetView)page.findView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
+
+ /*
+ * Verify the title
+ */
+ String cheatSheetTitle = view.getCheatSheetViewer().getCheatSheet().getTitle();
+ Assert.assertTrue("The URL-loaded cheat sheet's title did not appear anywhere in the cheat sheets view.", WidgetFinder.containsText(cheatSheetTitle, view.getCheatSheetViewer().getControl()));
+
+ /*
+ * Step through the cheat sheet
+ */
+ CheatSheetViewer viewer = view.getCheatSheetViewer();
+ CheatSheet sheet = viewer.getCheatSheet();
+
+ /*
+ * Verify the initial item, it is open by default.
+ */
+ Item intro = sheet.getIntroItem();
+ Assert.assertTrue("Could not find the intro URL-loaded cheat sheet item title in the cheat sheet view: \"" + intro.getTitle() + "\"", WidgetFinder.containsText(intro.getTitle(), viewer.getControl()));
+
+ // no way to get text from a FormText
+ //Assert.assertTrue("Could not find the intro URL-loaded cheat sheet item descriptions in the cheat sheet view: \"" + intro.getDescription() + "\"", WidgetFinder.containsText(intro.getDescription(), viewer.getControl()));
+
+ Keyboard.press(SWT.ARROW_LEFT);
+ Keyboard.press(SWT.ARROW_DOWN);
+
+ /*
+ * Verify all other items
+ */
+ Iterator iter = sheet.getItems().iterator();
+ while (iter.hasNext()) {
+ Item item = (Item)iter.next();
+ Keyboard.press(SWT.ARROW_RIGHT);
+ Assert.assertTrue("Could not find one of the URL-loaded cheat sheet item titles in the cheat sheet view: \"" + item.getTitle() + "\"", WidgetFinder.containsText(item.getTitle(), viewer.getControl()));
+
+ // no way to get text from a FormText
+ //Assert.assertTrue("Could not find one of the URL-loaded cheat sheet item descriptions in the cheat sheet view: \"" + item.getDescription() + "\"", WidgetFinder.containsText(item.getDescription(), viewer.getControl()));
+
+ Keyboard.press(SWT.ARROW_LEFT);
+ Keyboard.press(SWT.ARROW_DOWN);
+ }
+
+ }
+
+ /*
+ * Verifies that the two cheat sheets are identical in their content.
+ */
+ private static void verifyEquals(String msg, CheatSheet a, CheatSheet b) {
+ // to make it more readable
+ if (!msg.endsWith(": ")) {
+ msg = msg + ": ";
+ }
+
+ if (a == b) {
+ return;
+ }
+ else if (a == null || b == null) {
+ Assert.fail(msg + "One of the cheat sheets was null");
+ }
+ else {
+ // both non-null
+ Assert.assertEquals(msg + "Titles didn't match", a.getTitle(), b.getTitle());
+ verifyEquals(msg, a.getIntroItem(), b.getIntroItem());
+
+ List la = a.getItems();
+ List lb = b.getItems();
+ Assert.assertEquals("The number of items was different", la.size(), lb.size());
+
+ for (int i=0;i<la.size();++i) {
+ verifyEquals(msg, (Item)la.get(i), (Item)lb.get(i));
+ }
+ }
+ }
+
+ /*
+ * Verifies that two items are identical in their content.
+ */
+ private static void verifyEquals(String msg, Item a, Item b) {
+ // to make it more readable
+ if (!msg.endsWith(": ")) {
+ msg = msg + ": ";
+ }
+
+ if (a == b) {
+ return;
+ }
+ else if (a == null | b == null) {
+ Assert.fail(msg + "One of the items was null while its corresponding item in the other cheat sheet was not");
+ }
+ else {
+ // both non-null
+ Assert.assertEquals("Item titles didn't match", a.getTitle(), b.getTitle());
+ Assert.assertEquals("Item descriptions didn't match", a.getDescription(), b.getDescription());
+ Assert.assertEquals("Item context IDs didn't match", a.getContextId(), b.getContextId());
+ Assert.assertEquals("Item help links didn't match", a.getHref(), b.getHref());
+ Assert.assertEquals("Item dynamic flags didn't match", a.isDynamic(), b.isDynamic());
+ Assert.assertEquals("Item skip flags didn't match", a.isSkip(), b.isSkip());
+
+ verifyEquals(msg, a.getAction(), b.getAction());
+
+ List la = a.getItemExtensions();
+ List lb = b.getItemExtensions();
+
+ // if one is null, make sure both are null
+ if (la == null || lb == null) {
+ Assert.assertTrue("One of the item extension lists was null, while the other was not", la == lb);
+ }
+ else {
+ Assert.assertEquals("The number of item extensions was different", la.size(), lb.size());
+
+ Iterator ia = la.iterator();
+ Iterator ib = lb.iterator();
+ while (ia.hasNext()) {
+ AbstractItemExtensionElement[] aa = (AbstractItemExtensionElement[])ia.next();
+ AbstractItemExtensionElement[] ab = (AbstractItemExtensionElement[])ib.next();
+
+ // if one is null, make sure both are null
+ if (la == null || lb == null) {
+ Assert.assertTrue("One of the item extension lists was null, while the other was not", la == lb);
+ }
+ else {
+ Assert.assertEquals("The number of elements in one of the item extensions was different", aa.length, ab.length);
+ for (int i=0;i<aa.length;++i) {
+ verifyEquals(msg, aa[i], ab[i]);
+ }
+ }
+ }
+ }
+ verifyEquals(msg, a.getPerformWhen(), b.getPerformWhen());
+ }
+ }
+
+ /*
+ * Verifies that two actions are identical.
+ */
+ private static void verifyEquals(String msg, Action a, Action b) {
+ // to make it more readable
+ if (!msg.endsWith(": ")) {
+ msg = msg + ": ";
+ }
+
+ if (a == b) {
+ return;
+ }
+ else if (a == null | b == null) {
+ Assert.fail(msg + "One of the actions was null while its peer in the other cheat sheet was not");
+ }
+ else {
+ // both non-null
+ Assert.assertEquals("Action confirm flags didn't match", a.isConfirm(), b.isConfirm());
+ Assert.assertEquals("Action classes didn't match", a.getActionClass(), b.getActionClass());
+ Assert.assertEquals("Action plugin IDs didn't match", a.getPluginID(), b.getPluginID());
+ Assert.assertEquals("Action When expressions didn't match", a.getWhen(), b.getWhen());
+
+ String[] pa = a.getParams();
+ String[] pb = b.getParams();
+
+ if (pa == null || pb == null) {
+ Assert.assertTrue("One of the action params arrays was null, the other wasn't", pa == pb);
+ }
+ else {
+ Assert.assertEquals("Number of action params was different", pa.length, pb.length);
+ for (int i=0;i<pa.length;++i) {
+ Assert.assertEquals("One of the action params was different", pa[i], pb[i]);
+ }
+ }
+ }
+ }
+
+ /*
+ * Verifies that two item extensions are identical.
+ */
+ private static void verifyEquals(String msg, AbstractItemExtensionElement a, AbstractItemExtensionElement b) {
+ // to make it more readable
+ if (!msg.endsWith(": ")) {
+ msg = msg + ": ";
+ }
+
+ if (a == b) {
+ return;
+ }
+ else if (a == null | b == null) {
+ Assert.fail(msg + "One of the item extensions was null while its peer in the other cheat sheet was not");
+ }
+ else {
+ // both non-null
+ Assert.assertEquals("Item extension attribute names didn't match", a.getAttributeName(), b.getAttributeName());
+ }
+ }
+
+ /*
+ * Verifies that two PerformWhens are identical.
+ */
+ private static void verifyEquals(String msg, PerformWhen a, PerformWhen b) {
+ // to make it more readable
+ if (!msg.endsWith(": ")) {
+ msg = msg + ": ";
+ }
+
+ if (a == b) {
+ return;
+ }
+ else if (a == null | b == null) {
+ Assert.fail(msg + "One of the PerformWhens was null while its peer in the other cheat sheet was not");
+ }
+ else {
+ // both non-null
+ Assert.assertEquals("PerformWhen conditions did not match", a.getCondition(), b.getCondition());
+
+ verifyEquals(msg, a.getAction(), b.getAction());
+ verifyEquals(msg, a.getSelectedAction(), b.getSelectedAction());
+
+ List la = a.getActions();
+ List lb = b.getActions();
+
+ // if one is null, make sure both are null
+ if (la == null || lb == null) {
+ Assert.assertTrue("One of the PerformWhen's actions lists was null, while the other was not", la == lb);
+ }
+ Assert.assertEquals("The number of PerformWhen's actions was different", la.size(), lb.size());
+
+ Iterator ia = la.iterator();
+ Iterator ib = lb.iterator();
+ while (ia.hasNext()) {
+ verifyEquals(msg, (Action)ia.next(), (Action)ib.next());
+ }
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml b/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml
deleted file mode 100644
index 493bc27a0..000000000
--- a/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<cheatsheet title="Java Pattern Demo">
-
- <intro
- href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-Welcome to the Pattern cheat sheet.
-This cheat sheet will help you to build a sample application using patterns.
- </description>
-</intro>
-
- <item
- title="Select a pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"/>
- <description>
-Launch the wizard to begin. You can select a pattern to create. There
-are a few different patterns that you can try out, follow the steps in the
-cheat sheet to help guide you through building the patterns.
- </description>
-</item>
-
- <item
- title="Customize your pattern">
- <description>
-Now that you have chosen the pattern that you would like to create, customize your options.
- </description>
- <perform-when condition="${pattern}">
- <action
- when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
- <action
- when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
- <action
- when="Visitor"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
- </perform-when>
- </item>
-
- <item
- href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
- title="Create the Java project that will contain your pattern code">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenNewJavaProjectWizardWithNameAction"/>
- <description>
-Continue by creating your java project.
- </description>
-</item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
- title="Create the Java classes for your pattern">
- <description>
-Now create each of the java classes that are required for your pattern.
-You already specified some things about them in step 2, now customize
-them if you wish, or just create them.
- </description>
- <repeated-subitem values="${files}">
- <subitem label="Create class ${this}">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
- param1="${this}"
- param2="${project}"/>
- </subitem>
- </repeated-subitem>
- </item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
- title="Generate a test class for your pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
- param1="TestPattern"
- param2="${project}"/>
- <description>
-Create a class to test your pattern.
- </description>
-</item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
- title="Run the test">
- <description>
-Select your test class, and select the run as application option in the
-toolbar to test it. When you are finished you can indicate that you have finished
-by pressing the completed button. Hope you enjoyed using this new cheat sheet!
- </description>
-</item>
-
-</cheatsheet>
-
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml b/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml
deleted file mode 100644
index b4976532f..000000000
--- a/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<cheatsheet title="Java Pattern Demo">
-
- <intro
- href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-Welcome to the Pattern cheat sheet.
-This cheat sheet will help you to build a sample application using patterns.
- </description>
-</intro>
-
- <item
- title="Select a pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"/>
- <description>
-Launch the wizard to begin. You can select a pattern to create. There
-are a few different patterns that you can try out, follow the steps in the
-cheat sheet to help guide you through building the patterns.
- </description>
-</item>
-
- <item
- title="Customize your pattern">
- <description>
-Now that you have chosen the pattern that you would like to create, customize your options.
- </description>
- <conditional-subitem condition="${pattern}">
- <subitem
- when="Factory"
- label="Customize the Factory Pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
- </subitem>
- <subitem
- when="Singleton"
- label="Customize the Singleton Pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
- </subitem>
- <subitem
- when="Visitor"
- label="Customize the Visitor Pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
- </subitem>
- </conditional-subitem>
- </item>
-
- <item
- href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
- title="Create the Java project that will contain your pattern code">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenNewJavaProjectWizardWithNameAction"/>
- <description>
-Continue by creating your java project.
- </description>
-</item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
- title="Create the Java classes for your pattern">
- <description>
-Now create each of the java classes that are required for your pattern.
-You already specified some things about them in step 2, now customize
-them if you wish, or just create them.
- </description>
- <repeated-subitem values="${files}">
- <subitem label="Create class ${this}">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
- param1="${this}"
- param2="${project}"/>
- </subitem>
- </repeated-subitem>
- </item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
- title="Generate a test class for your pattern">
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
- param1="TestPattern"
- param2="${project}"/>
- <description>
-Create a class to test your pattern.
- </description>
-</item>
-
- <item
- href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
- title="Run the test">
- <description>
-Select your test class, and select the run as application option in the
-toolbar to test it. When you are finished you can indicate that you have finished
-by pressing the completed button. Hope you enjoyed using this new cheat sheet!
- </description>
-</item>
-
-</cheatsheet>
-
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml b/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml
deleted file mode 100644
index 1e57d31d8..000000000
--- a/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<cheatsheet title="Rational Test1">
-
- <intro>
- <description>
-Simple test 1.
- </description>
-</intro>
-
- <item
- title="Launch test2"
- skip="true">
- <description>
-Goto test2
- </description>
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NavigateAction"
- param1="rational.Test2"/>
-</item>
-
-</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/rational/Test2.xml b/org.eclipse.ua.tests/cheatsheets/tests/rational/Test2.xml
deleted file mode 100644
index 28defaae9..000000000
--- a/org.eclipse.ua.tests/cheatsheets/tests/rational/Test2.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<cheatsheet title="Rational Test2">
-
- <intro>
- <description>
-Simple test 2.
- </description>
-</intro>
-
- <item
- title="Launch test1"
- skip="true">
- <description>
-Goto test1
- </description>
- <action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NavigateAction"
- param1="rational.Test1"/>
-</item>
-
-</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/contexts.xml b/org.eclipse.ua.tests/data/cheatsheet/contexts.xml
index 09aabf404..937df5975 100644
--- a/org.eclipse.ua.tests/contexts.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/contexts.xml
@@ -4,6 +4,6 @@
<!-- Actions -->
<context id="test_cheatsheets">
<description>Infopop test <b>successful</b>! The &quot;contextId&quot; was specified correctly in the cheat sheets content file.</description>
- <topic label="Test a help link, show Workbench Concepts" href="/org.eclipse.platform.doc.user/concepts/concepts-2.htm"/>
+ <topic label="abcdefg" href="/org.eclipse.platform.doc.user/concepts/concepts-2.htm"/>
</context>
</contexts>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingClass.xml
index 4065e2103..50a88ec71 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingClass.xml
@@ -16,4 +16,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
pluginId="org.eclipse.ui.cheatsheets"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingPluginId.xml
index 863b675e0..e29db4816 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_MissingPluginId.xml
@@ -13,7 +13,7 @@ Simple test
Did it work? Of course not, it is suppose to cause a parsing error.
</description>
<action
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidNumber.xml
index e65e04d1f..b0407f5a9 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidNumber.xml
@@ -14,8 +14,8 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
<action
paramA="testing"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidRange.xml
index 301cffc8f..0644183e3 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ActionElement_ParamInvalidRange.xml
@@ -14,8 +14,8 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
<action
param20="testing"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_BadXML.xml
index 7f9e3c19f..f14e359d7 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_BadXML.xml
@@ -18,4 +18,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
Just an extra element but using bad XML.
</extraa>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_MissingTitle.xml
index ed1d7977a..4f9b860b4 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_MissingTitle.xml
@@ -13,4 +13,4 @@ Simple test
Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_NotDefined.xml
index 811df7db1..1d8179371 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/CheatSheetElement_NotDefined.xml
@@ -13,4 +13,4 @@ Simple test
Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</testcheatsheet> \ No newline at end of file
+</testcheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingCondition.xml
index 487a15695..a48246a86 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingCondition.xml
@@ -19,7 +19,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -28,7 +28,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -37,10 +37,10 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingSubItem.xml
index 8d72ad685..8d72ad685 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ConditionalSubItem_MissingSubItem.xml
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_ManyDefined.xml
index db3a4b0f3..bd6833dec 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_ManyDefined.xml
@@ -24,4 +24,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_MissingDescription.xml
index 8ca495a19..2d1f576f1 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_MissingDescription.xml
@@ -11,4 +11,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_NotDefined.xml
index f6f7813f7..ff8654b4f 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/IntroElement_NotDefined.xml
@@ -8,4 +8,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingDescription.xml
index 5c56d8624..1e8a65fcd 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingDescription.xml
@@ -11,4 +11,4 @@ Simple test
title="Just a simple test">
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingTitle.xml
index 6198d0e0a..f902b0b2f 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_MissingTitle.xml
@@ -13,4 +13,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_NotDefined.xml
index 17d4d8a1e..99db55358 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/ItemElement_NotDefined.xml
@@ -7,4 +7,4 @@ Simple test
</description>
</intro>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingAction.xml
index 8a3a51216..90f38298c 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingAction.xml
@@ -16,4 +16,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</perform-when>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingCondition.xml
index a9598c842..5bf351e46 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/PerformWhen_MissingCondition.xml
@@ -15,17 +15,17 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<perform-when>
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingSubItem.xml
index 82fd178f1..3cd841c6c 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingSubItem.xml
@@ -16,4 +16,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</repeated-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingValues.xml
index 1b8ebc924..a71b963f0 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/RepeatedSubItem_MissingValues.xml
@@ -15,7 +15,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<repeated-subitem>
<subitem label="Create class ${this}">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
param1="${this}"
param2="${project}"/>
@@ -23,4 +23,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</repeated-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml b/org.eclipse.ua.tests/data/cheatsheet/invalid/SubItemElement_MissingLabel.xml
index fa05fa840..370a46986 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/invalid/SubItemElement_MissingLabel.xml
@@ -15,4 +15,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<subitem/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld.xml
index 029441d44..55415dec4 100644
--- a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld.xml
@@ -25,7 +25,7 @@ workbench. When you have done this, press the "click when done" button below.
title="Create a java project"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"/>
<description>
The first thing you will need is a Java Project.
@@ -38,7 +38,7 @@ If you already have a java project in your workspace that you would like to use,
title="Create your HelloWorld class">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
<description>
You should now have a Java Project in your workspace.
@@ -67,4 +67,4 @@ Congratulations! You have built your hello world application and it worked!
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions.xml
index 40343ee03..d77dd33e1 100644
--- a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions.xml
@@ -26,7 +26,7 @@ workbench. When you have done this, press the "click when done" button below.
title="Create a java project"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"/>
<description>
The first thing you will need is a Java Project.
@@ -39,7 +39,7 @@ If you already have a java project in your workspace that you would like to use,
title="Create your HelloWorld class">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
<description>
You should now have a Java Project in your workspace.
@@ -69,4 +69,4 @@ Congratulations! You have built your hello world application and it worked!
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions_serialized.txt
new file mode 100644
index 000000000..def146a50
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithExtensions_serialized.txt
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Hello World Demo with Extensions">
+ <item
+ title="Introduction"
+ description="Welcome to the hello world cheat sheet.
+This cheat sheet will help you to build the famous "hello world" application and try it out. You will create a java project, and a java class that will print "hello world" in the console when run.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Open the Java Perspective"
+ description="To begin, open the Java Perspective in the Eclipse workbench.
+You may do this by clicking window->open perspective->Java in the toolbar at the top of the
+workbench. When you have done this, press the "click when done" button below."
+ Href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ contextId="null">
+ <nullAction/>
+ <list>
+ <array/>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Create a java project"
+ description="The first thing you will need is a Java Project.
+If you already have a java project in your workspace that you would like to use, you may skip this step by pressing the "skip" button. If not, you may press the "click to perform" button to spawn the New Java Project wizard."
+ Href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Create your HelloWorld class"
+ description="You should now have a Java Project in your workspace.
+The next step in building your hello world application is to create your HelloWorld class. You may do this by either pressing the "click to perform" button below to launch the New Java Class wizard, or you may use the Eclipse tools to do it, by using the file->new->Class action.
+When you use the wizard, make sure that you specify that you would like to have a "main" method added. Name your class "HelloWorld". If you use the button below it will be pre-filled for you.
+If you do not use the "click to perform" button below, press the "click when done" button to advance to the next step in building your hello world app."
+ Href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Add a System.out.println line in your main method"
+ description="Now that you have your HelloWorld class,
+In the "public static void main" method, add the following statement: System.out.println("Hello world!"); and save your changes. Press the "click when done" button below when finished."
+ Href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test your application"
+ description="The final moment has arrived! You are ready to test your HelloWorld class.
+Select your class in the package explorer (the java tree view on the left of the workbench window in the Java Perspective.). When your HelloWorld class is selected, press the down arrow beside the running man icon in the toolbar and select run as->application. Hello world! should be printed in your "Console" view.
+Congratulations! You have built your hello world application and it worked!"
+ Href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ contextId="null">
+ <nullAction/>
+ <list>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems.xml
index 6c1a562f2..62b0ed851 100644
--- a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems.xml
@@ -30,14 +30,14 @@ If you already have a java project in your workspace that you would like to use,
label="Create a java project"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"/>
</subitem>
<subitem
label="Create your HelloWorld class">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
</subitem>
</item>
@@ -61,4 +61,4 @@ Congratulations! You have built your hello world application and it worked!
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems_serialized.txt
new file mode 100644
index 000000000..2ebfaa173
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorldWithSubitems_serialized.txt
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Hello World Demo with Subitems">
+ <item
+ title="Introduction"
+ description="Welcome to the hello world cheat sheet.
+This cheat sheet will help you to build the famous "hello world" application and try it out. You will create a java project, and a java class that will print "hello world" in the console when run.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Open the Java Perspective"
+ description="To begin, open the Java Perspective in the Eclipse workbench.
+You may do this by clicking window->open perspective->Java in the toolbar at the top of the
+workbench. When you have done this, press the "click when done" button below."
+ Href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Create java resources"
+ description="The first thing you will need is a Java Project.
+If you already have a java project in your workspace that you would like to use, you may skip this step by pressing the "skip" button. If not, you may press the "click to perform" button to spawn the New Java Project wizard."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="Create a java project"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Create your HelloWorld class"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </item>
+ <item
+ title="Add a System.out.println line in your main method"
+ description="Now that you have your HelloWorld class,
+In the "public static void main" method, add the following statement: System.out.println("Hello world!"); and save your changes. Press the "click when done" button below when finished."
+ Href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test your application"
+ description="The final moment has arrived! You are ready to test your HelloWorld class.
+Select your class in the package explorer (the java tree view on the left of the workbench window in the Java Perspective.). When your HelloWorld class is selected, press the down arrow beside the running man icon in the toolbar and select run as->application. Hello world! should be printed in your "Console" view.
+Congratulations! You have built your hello world application and it worked!"
+ Href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld_serialized.txt
new file mode 100644
index 000000000..07ffdfdaa
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/HelloWorld_serialized.txt
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Hello World Demo">
+ <item
+ title="Introduction"
+ description="<form><p>
+Welcome to the <b>hello world</b> cheat sheet.<br/>
+This cheat sheet will help you to build the famous &quot;hello world&quot; application and try it out. You will create a java project, and a java class that will print &quot;hello world&quot; in the console when run.<br/>
+Let&apos;s get started!
+ </p></form>"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Open the Java Perspective"
+ description="To begin, open the Java Perspective in the Eclipse workbench.
+You may do this by clicking window->open perspective->Java in the toolbar at the top of the
+workbench. When you have done this, press the "click when done" button below."
+ Href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Create a java project"
+ description="The first thing you will need is a Java Project.
+If you already have a java project in your workspace that you would like to use, you may skip this step by pressing the "skip" button. If not, you may press the "click to perform" button to spawn the New Java Project wizard."
+ Href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Create your HelloWorld class"
+ description="You should now have a Java Project in your workspace.
+The next step in building your hello world application is to create your HelloWorld class. You may do this by either pressing the "click to perform" button below to launch the New Java Class wizard, or you may use the Eclipse tools to do it, by using the file->new->Class action.
+When you use the wizard, make sure that you specify that you would like to have a "main" method added. Name your class "HelloWorld". If you use the button below it will be pre-filled for you.
+If you do not use the "click to perform" button below, press the "click when done" button to advance to the next step in building your hello world app."
+ Href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Add a System.out.println line in your main method"
+ description="Now that you have your HelloWorld class,
+In the "public static void main" method, add the following statement: System.out.println("Hello world!"); and save your changes. Press the "click when done" button below when finished."
+ Href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test your application"
+ description="The final moment has arrived! You are ready to test your HelloWorld class.
+Select your class in the package explorer (the java tree view on the left of the workbench window in the Java Perspective.). When your HelloWorld class is selected, press the down arrow beside the running man icon in the toolbar and select run as->application. Hello world! should be printed in your "Console" view.
+Congratulations! You have built your hello world application and it worked!"
+ Href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestActions.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActions.xml
index cd1adeca6..2c8f99cf8 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestActions.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActions.xml
@@ -36,8 +36,8 @@ Let's get started!
<item
title="Test 4">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
<description>
Test with action.
</description>
@@ -47,8 +47,8 @@ Let's get started!
title="Test 5"
skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
<description>
Test with action and skip=false.
</description>
@@ -58,8 +58,8 @@ Let's get started!
title="Test 6"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
<description>
Test action and skip=true.
</description>
@@ -68,8 +68,8 @@ Let's get started!
<item
title="Test 7">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="false"/>
<description>
Test action and confirm=false.
@@ -79,8 +79,8 @@ Let's get started!
<item
title="Test 8">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="true"/>
<description>
Test action and confirm=true.
@@ -91,8 +91,8 @@ Let's get started!
title="Test 9"
skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="false"/>
<description>
Test action, skip=false and confirm=false.
@@ -103,8 +103,8 @@ Let's get started!
title="Test 10"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="false"/>
<description>
Test action, skip=true and confirm=false.
@@ -115,8 +115,8 @@ Let's get started!
title="Test 11"
skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="true"/>
<description>
Test action, skip=false and confirm=true.
@@ -127,8 +127,8 @@ Let's get started!
title="Test 12"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
confirm="true"/>
<description>
Test action, skip=true and confirm=true.
@@ -142,4 +142,4 @@ Let's get started!
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip.xml
new file mode 100644
index 000000000..57fd66a79
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<cheatsheet title="Test 1">
+
+<intro>
+ <description>
+ This is a cheat sheet with actions preprogrammed to set certain values on certain static fields,
+ so that the test can verify that the action was run.
+ </description>
+</intro>
+
+<item
+ title="Step 1">
+ <description>
+ No actions for this one.
+ </description>
+</item>
+
+<item
+ title="Step 2"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
+ <description>
+ Action increments a static variable.
+ </description>
+</item>
+
+<item
+ title="Step 3"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
+ <description>
+ Action does nothing.
+ </description>
+</item>
+
+<item
+ title="Step 4"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
+ <description>
+ Action increments a static variable.
+ </description>
+</item>
+
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip_serialized.txt
new file mode 100644
index 000000000..68e97c2a2
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActionsWithSkip_serialized.txt
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test 1">
+ <item
+ title="Introduction"
+ description="This is a cheat sheet with actions preprogrammed to set certain values on certain static fields,
+ so that the test can verify that the action was run."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Step 1"
+ description="No actions for this one."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Step 2"
+ description="Action increments a static variable."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Step 3"
+ description="Action does nothing."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Step 4"
+ description="Action increments a static variable."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestActions_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActions_serialized.txt
new file mode 100644
index 000000000..355163600
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestActions_serialized.txt
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test Actions">
+ <item
+ title="Introduction"
+ description="Welcome to the Test Actions cheat sheet.
+This cheat sheet will test the various setting combinations for actions.
+Let's get started!"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Test 1"
+ description="Test with no action."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 2"
+ description="Test with no action and skip=false."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 3"
+ description="Test with no action and skip=true."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 4"
+ description="Test with action."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 5"
+ description="Test with action and skip=false."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 6"
+ description="Test action and skip=true."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 7"
+ description="Test action and confirm=false."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 8"
+ description="Test action and confirm=true."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 9"
+ description="Test action, skip=false and confirm=false."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 10"
+ description="Test action, skip=true and confirm=false."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 11"
+ description="Test action, skip=false and confirm=true."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test 12"
+ description="Test action, skip=true and confirm=true."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="All done!"
+ description="Did the test work?"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions.xml
index 94c64b9dc..9affda475 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions.xml
@@ -38,4 +38,4 @@ workbench. When you have done this, press the "click when done" button below.
Test launching single list cheat sheet selection.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions_serialized.txt
new file mode 100644
index 000000000..1798eddf7
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestCSActions_serialized.txt
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Hello World Demo">
+ <item
+ title="Introduction"
+ description="Welcome to the hello world cheat sheet.
+This cheat sheet will help you to build the famous "hello world" application and try it out. You will create a java project, and a java class that will print "hello world" in the console when run.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Open the Java Perspective"
+ description="To begin, open the Java Perspective in the Eclipse workbench.
+You may do this by clicking window->open perspective->Java in the toolbar at the top of the
+workbench. When you have done this, press the "click when done" button below."
+ Href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ contextId="null">
+ <nullAction/>
+ <list>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Select a cheat sheet"
+ description="Test launching category based cheat sheet selection."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.internal.cheatsheets.actions.CheatSheetCategoryBasedSelectionAction"
+ pluginId="org.eclipse.ui.cheatsheets"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Select a cheat sheet in another way"
+ description="Test launching single list cheat sheet selection."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.internal.cheatsheets.actions.CheatSheetSelectionAction"
+ pluginId="org.eclipse.ui.cheatsheets"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help.xml
index b8848e4b0..697aed17f 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<cheatsheet title="Testing Infopop and Help Links">
+<cheatsheet title="Testing Context Help and Help Links">
<intro
href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
<description>
-This cheat sheet will test infopop and help link.
+This cheat sheet will test context help and help link.
Let's get started!
</description>
</intro>
@@ -34,18 +34,18 @@ This item should not have a help link.
<item
title="Display the gathered data and additional parameters"
- contextId="org.eclipse.ui.tests.cheatsheets.test_cheatsheets">
+ contextId="org.eclipse.ua.tests.test_cheatsheets">
<description>
-Try the help link, you should see an infopop with some sample text.
+Try the help link, you should see context help with some sample text.
</description>
</item>
<item
title="Display the gathered data and additional parameters"
href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
- contextId="org.eclipse.ui.tests.cheatsheets.test_cheatsheets">
+ contextId="org.eclipse.ua.tests.test_cheatsheets">
<description>
-Try the help link, you should see the same infopop again.
+Try the help link, you should see the same context help again.
</description>
</item>
@@ -64,4 +64,4 @@ This item should not have a help link.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help_serialized.txt
new file mode 100644
index 000000000..ea74cc953
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestContext_Help_serialized.txt
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Testing Context Help and Help Links">
+ <item
+ title="Introduction"
+ description="This cheat sheet will test context help and help link.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Test help link"
+ description="Try the help link, you should see the concepts for the help system."
+ Href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test item without help link"
+ description="This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Display the gathered data and additional parameters"
+ description="Try the help link, you should see context help with some sample text."
+ Href="null"
+ contextId="org.eclipse.ua.tests.test_cheatsheets">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Display the gathered data and additional parameters"
+ description="Try the help link, you should see the same context help again."
+ Href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
+ contextId="org.eclipse.ua.tests.test_cheatsheets">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test item without help link"
+ description="This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link.
+This item should not have a help link."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting.xml
index 50d8dcdf2..c63646cf4 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting.xml
@@ -49,4 +49,4 @@ quote: &quot;
<item title="Item with one greater than between breaks"><description><br/>&gt;<br/></description></item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting_serialized.txt
new file mode 100644
index 000000000..22f5a562a
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDescriptionFormatting_serialized.txt
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Testing Infopop and Help Links">
+ <item
+ title="Introduction"
+ description="This cheat sheet will test infopop and help link.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Item with simple text"
+ description="Some simple text to test the decription formating."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with a line break"
+ description="<form><p>
+Line one
+<br/>
+Line two with a special &lt; char in the middle.
+</p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with all the special charaters"
+ description="<form><p>
+&lt; - less than
+<br/>
+<b>Special characters</b><br/>
+less than: &lt;
+<br/>
+greater than: &gt;
+<br/>
+ampersand: &amp;
+<br/>
+apostrophe: &apos;
+<br/>
+quote: &quot;
+<br/>
+</p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one less than"
+ description="<form><p><b>&lt;</b></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one greater than"
+ description=">"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one bold less than"
+ description="<form><p><b>&lt;</b></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one bold greater than"
+ description="<form><p><b>&gt;</b></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one less than before a break"
+ description="<form><p>&lt;<br/></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one less than after a break"
+ description="<form><p><br/>&lt;</p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one less than between breaks"
+ description="<form><p><br/>&lt;<br/></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one greater than before a break"
+ description="<form><p>&gt;<br/></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one greater than after a break"
+ description="<form><p><br/>&gt;</p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Item with one greater than between breaks"
+ description="<form><p><br/>&gt;<br/></p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems.xml
index aa55c7177..24aafc525 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems.xml
@@ -12,7 +12,7 @@ Let's get started!
<item
title="Select a pattern">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"/>
<description>
Launch the wizard to begin. You can select a pattern to create. There
@@ -60,7 +60,7 @@ Now that you have chosen the pattern that you would like to create, customize yo
skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -69,7 +69,7 @@ Now that you have chosen the pattern that you would like to create, customize yo
skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -78,7 +78,7 @@ Now that you have chosen the pattern that you would like to create, customize yo
skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
@@ -93,8 +93,8 @@ Try the help link, you should see the concepts for the help system.
<subitem label="sub 1" skip="true"/>
<subitem label="sub 2" skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<conditional-subitem condition="${pattern}">
<subitem
@@ -103,7 +103,7 @@ Try the help link, you should see the concepts for the help system.
skip="false">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -111,7 +111,7 @@ Try the help link, you should see the concepts for the help system.
label="Customize the Singleton Pattern"
skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -119,7 +119,7 @@ Try the help link, you should see the concepts for the help system.
label="Customize the Visitor Pattern"
skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
@@ -129,7 +129,7 @@ Try the help link, you should see the concepts for the help system.
label="Customize the Factory Pattern">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -137,7 +137,7 @@ Try the help link, you should see the concepts for the help system.
label="Customize the Singleton Pattern">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -164,43 +164,43 @@ Try the help link, you should see the concepts for the help system.
<subitem label="sub 3" skip="false"/>
<subitem label="sub 4" skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 5"/>
<subitem label="sub 6">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 7">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 8">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 9" skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 10" skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<repeated-subitem values="${files}">
<subitem label="Create class ${this}">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
param1="${this}"
param2="${project}"/>
@@ -209,21 +209,21 @@ Try the help link, you should see the concepts for the help system.
<subitem label="sub 11" skip="false">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 12" skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
</item>
<item
title="Select a pattern">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"/>
<description>
Launch the wizard to begin. You can select a pattern to create. There
@@ -242,15 +242,15 @@ Try the help link, you should see the concepts for the help system.
<perform-when condition="${pattern}">
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</subitem>
@@ -258,17 +258,17 @@ Try the help link, you should see the concepts for the help system.
<perform-when condition="${pattern}">
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</subitem>
@@ -276,17 +276,17 @@ Try the help link, you should see the concepts for the help system.
<perform-when condition="${pattern}">
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</subitem>
@@ -306,17 +306,17 @@ Now that you have chosen the pattern that you would like to create, customize yo
<!-- The "when" are set incorrectly to ensure the perform when is working. -->
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Visitor"
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Factory"
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</subitem>
@@ -326,7 +326,7 @@ Now that you have chosen the pattern that you would like to create, customize yo
skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -335,7 +335,7 @@ Now that you have chosen the pattern that you would like to create, customize yo
skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
@@ -352,17 +352,17 @@ Now that you have chosen the pattern that you would like to create, customize yo
<!-- The "when" are set incorrectly to ensure the perform when is working. -->
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Visitor"
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Factory"
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</subitem>
@@ -376,4 +376,4 @@ Did the test work?
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems_serialized.txt
new file mode 100644
index 000000000..a241930ac
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestDynamicSubItems_serialized.txt
@@ -0,0 +1,636 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Testing SubItems">
+ <item
+ title="Introduction"
+ description="This cheat sheet will test subitems.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Select a pattern"
+ description="Launch the wizard to begin. You can select a pattern to create. There
+are a few different patterns that you can try out, follow the steps in the
+cheat sheet to help guide you through building the patterns."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Customize your pattern"
+ description="Now that you have chosen the pattern that you would like to create, customize your options."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ </list>
+ </item>
+ <item
+ title="Test SubItems"
+ description="Try the help link, you should see the concepts for the help system."
+ Href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="sub 1"
+ when="null"
+ isSkip="true">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 2"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="true">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ <subItem
+ label="sub 3"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 4"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 5"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 6"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 7"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 8"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 9"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 10"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <repeatedSubItem
+ values="${files}">
+ <list>
+ <subItem
+ label="Create class ${this}"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <array>
+ <string
+ value="${this}">
+ </string>
+ <string
+ value="${project}">
+ </string>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ </array>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </repeatedSubItem>
+ <subItem
+ label="sub 11"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 12"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </item>
+ <item
+ title="Select a pattern"
+ description="Launch the wizard to begin. You can select a pattern to create. There
+are a few different patterns that you can try out, follow the steps in the
+cheat sheet to help guide you through building the patterns."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.LaunchPatternSelectionDialogAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Test SubItems with PerformWhen"
+ description="Try the help link, you should see the concepts for the help system."
+ Href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="sub 1"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ </subItem>
+ <subItem
+ label="sub 2"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ </subItem>
+ <subItem
+ label="sub 3"
+ when="null"
+ isSkip="true">
+ <nullAction/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ </subItem>
+ </list>
+ </item>
+ <item
+ title="Customize your pattern"
+ description="Now that you have chosen the pattern that you would like to create, customize your options."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="true">
+ <nullAction/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ </list>
+ </item>
+ <item
+ title="Customize your pattern"
+ description="Now that you have chosen the pattern that you would like to create, customize your options."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <repeatedSubItem
+ values="${files}">
+ <list>
+ <subItem
+ label="Create class ${this}"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ </subItem>
+ </list>
+ </repeatedSubItem>
+ </list>
+ </item>
+ <item
+ title="All done!"
+ description="Did the test work?"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/webapp/TestOpeningURL.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL.xml
index fb7edef72..e22a617fe 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/webapp/TestOpeningURL.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL.xml
@@ -14,4 +14,4 @@ Did it work?
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL_serialized.txt
new file mode 100644
index 000000000..5ca3e521e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestOpeningURL_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet opening from URL">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work?"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters.xml
index 833d7bb42..5e6d93e56 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters.xml
@@ -12,8 +12,8 @@ Let's get started!
<item
title="Prompt to enter some data">
<action
- class="org.eclipse.ui.tests.cheatsheets.parameters.GatherDisplayDataAction"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ua.tests.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ua.tests"
param1="gather"/>
<description>
To begin, let's gather some data.
@@ -23,8 +23,8 @@ To begin, let's gather some data.
<item
title="Display the gathered data and additional parameters">
<action
- class="org.eclipse.ui.tests.cheatsheets.parameters.GatherDisplayDataAction"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ua.tests.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ua.tests"
param1="display"
param2="${name}"
param3="${color}"
@@ -36,4 +36,4 @@ You data has been process, let's see the results.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters_serialized.txt
new file mode 100644
index 000000000..5d448d04a
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestParameters_serialized.txt
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Hello World Demo">
+ <item
+ title="Introduction"
+ description="This cheat sheet will test parameters.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Prompt to enter some data"
+ description="To begin, let's gather some data."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <array>
+ <string
+ value="gather">
+ </string>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ </array>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <item
+ title="Display the gathered data and additional parameters"
+ description="You data has been process, let's see the results."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <array>
+ <string
+ value="display">
+ </string>
+ <string
+ value="${name}">
+ </string>
+ <string
+ value="${color}">
+ </string>
+ <string
+ value="${animal}">
+ </string>
+ <string
+ value="Testing is fun.">
+ </string>
+ <string
+ value="Powered by Cheat Sheets!">
+ </string>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ </array>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems.xml
index d0c3cb3e2..13fe8085c 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems.xml
@@ -18,56 +18,56 @@ Try the help link, you should see the concepts for the help system.
<subitem label="sub 1" skip="true"/>
<subitem label="sub 2" skip="true">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 3" skip="false"/>
<subitem label="sub 4" skip="false">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 5"/>
<subitem label="sub 6">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 7">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 8">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 9" skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 10" skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
<subitem label="sub 11" skip="false">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</subitem>
<subitem label="sub 12" skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"/>
</subitem>
</item>
@@ -79,4 +79,4 @@ Did the test work?
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems_serialized.txt
new file mode 100644
index 000000000..9d144d5dd
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/TestSubItems_serialized.txt
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Testing SubItems">
+ <item
+ title="Introduction"
+ description="This cheat sheet will test subitems.
+Let's get started!"
+ Href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Test SubItems"
+ description="Try the help link, you should see the concepts for the help system."
+ Href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="sub 1"
+ when="null"
+ isSkip="true">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 2"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 3"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 4"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 5"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 6"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 7"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 8"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 9"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 10"
+ when="null"
+ isSkip="true">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 11"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="sub 12"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.IncrementVariableAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </item>
+ <item
+ title="All done!"
+ description="Did the test work?"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr.xml
index d891c3504..b75d903c5 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr.xml
@@ -14,8 +14,8 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
<action
extra="testing"
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..75a0c2a61
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraAttr_serialized.txt
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement.xml
index 9e6361190..fb2004921 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement.xml
@@ -13,12 +13,12 @@ Simple test
Did it work? Of course not, it is suppose to cause a parsing error.
</description>
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction">
+ pluginId="org.eclipse.ua.tests"
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction">
<extra>
testing
</extra>
</action>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement_serialized.txt
new file mode 100644
index 000000000..75a0c2a61
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ActionElement_ExtraElement_serialized.txt
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <action
+ class="org.eclipse.ua.tests.cheatsheet.util.NoopAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr.xml
index 1f72bb113..299d0d595 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr.xml
@@ -13,4 +13,4 @@ Simple test
Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraAttr_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement.xml
index 1b0bf442f..2e5edf37d 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement.xml
@@ -18,4 +18,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
Just an extra element.
</extra>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/CheatSheetElement_ExtraElement_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr.xml
index 78f1555bb..1dab05a5c 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr.xml
@@ -19,7 +19,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -28,7 +28,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -37,10 +37,10 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..e3935eb65
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraAttr_serialized.txt
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement.xml
index b80e45b30..b1b7c2d15 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement.xml
@@ -20,7 +20,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
</subitem>
<subitem
@@ -29,7 +29,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="false">
<action
confirm="true"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
</subitem>
<subitem
@@ -38,10 +38,10 @@ Did it work? Of course not, it is suppose to cause a parsing error.
skip="true">
<action
confirm="false"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</subitem>
</conditional-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement_serialized.txt
new file mode 100644
index 000000000..e3935eb65
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ConditionalSubItem_ExtraElement_serialized.txt
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <conditionalSubItem
+ condition="${pattern}">
+ <list>
+ <subItem
+ label="Customize the Factory Pattern"
+ when="Factory"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Singleton Pattern"
+ when="Singleton"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="true">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ <subItem
+ label="Customize the Visitor Pattern"
+ when="Visitor"
+ isSkip="true">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </conditionalSubItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements.xml
index 6fca2a9c5..81618ec4d 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements.xml
@@ -14,4 +14,4 @@ Did it work? Of course <b>not</b>, it is suppose to cause a parsing <extra>error
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements_serialized.txt
new file mode 100644
index 000000000..f5dfe5f35
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/DescriptionElement_ExtraElements_serialized.txt
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="<form><p>
+Did it work? Of course <b>not</b>, it is suppose to cause a parsing .
+ </p></form>"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr.xml
index f97ebd7c8..087fde23e 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr.xml
@@ -14,4 +14,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraAttr_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement.xml
index ae0f407c3..54440e1fa 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement.xml
@@ -17,4 +17,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ExtraElement_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions.xml
index 3d62fa582..cabba858c 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions.xml
@@ -20,4 +20,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/IntroElement_ManyDescriptions_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr.xml
index d96cb1ee7..bda7dae7a 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr.xml
@@ -14,4 +14,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..5d2c82f5c
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraAttr_serialized.txt
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list>
+ <array/>
+ <array/>
+ </list>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement.xml
index 56b73840f..5a24f6e45 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement.xml
@@ -20,4 +20,4 @@ Just another extra element.
</extra2>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ExtraElement_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions.xml
index bd84b014d..a647b3d2f 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions.xml
@@ -20,4 +20,4 @@ Just another extra description.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions_serialized.txt
new file mode 100644
index 000000000..cccd1247f
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_ManyDescriptions_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Just another extra description."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined.xml
index 6b8204342..530b1533a 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined.xml
@@ -14,4 +14,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</description>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined_serialized.txt
new file mode 100644
index 000000000..07536fe5e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/ItemElement_OneDefined_serialized.txt
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr.xml
index e7ed10744..f91d98ff5 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr.xml
@@ -15,17 +15,17 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<perform-when condition="${pattern}" extra="testing">
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..70628f56a
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraAttr_serialized.txt
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement.xml
index f580bcfb5..327023874 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement.xml
@@ -16,17 +16,17 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<extra>testing</extra>
<action
when="Factory"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
<action
when="Singleton"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
<action
when="Visitor"
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
</perform-when>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement_serialized.txt
new file mode 100644
index 000000000..70628f56a
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/PerformWhen_ExtraElement_serialized.txt
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <performWhen
+ condition="${pattern}">
+ <list>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Factory"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Singleton"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"
+ pluginId="org.eclipse.ua.tests"
+ when="Visitor"
+ isConfirm="false">
+ <nullArray/>
+ </action>
+ </list>
+ </performWhen>
+ <nullList/>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr.xml
index 33a0ff4c3..1cae53f57 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr.xml
@@ -15,7 +15,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<repeated-subitem values="${files}" extra="testing">
<subitem label="Create class ${this}">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
param1="${this}"
param2="${project}"/>
@@ -23,4 +23,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</repeated-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..926687c66
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraAttr_serialized.txt
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <repeatedSubItem
+ values="${files}">
+ <list>
+ <subItem
+ label="Create class ${this}"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <array>
+ <string
+ value="${this}">
+ </string>
+ <string
+ value="${project}">
+ </string>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ </array>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </repeatedSubItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement.xml
index 40c88fa9d..07d5a6c8e 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement.xml
@@ -16,7 +16,7 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<extra>testing</extra>
<subitem label="Create class ${this}">
<action
- pluginId="org.eclipse.ui.tests.cheatsheets"
+ pluginId="org.eclipse.ua.tests"
class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
param1="${this}"
param2="${project}"/>
@@ -24,4 +24,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</repeated-subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement_serialized.txt
new file mode 100644
index 000000000..926687c66
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/RepeatedSubItem_ExtraElement_serialized.txt
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <repeatedSubItem
+ values="${files}">
+ <list>
+ <subItem
+ label="Create class ${this}"
+ when="null"
+ isSkip="false">
+ <action
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenClassNameFilledAction"
+ pluginId="org.eclipse.ua.tests"
+ when="null"
+ isConfirm="false">
+ <array>
+ <string
+ value="${this}">
+ </string>
+ <string
+ value="${project}">
+ </string>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ <nullObject/>
+ </array>
+ </action>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </repeatedSubItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr.xml
index b0eb38cbe..cb114fbbc 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr.xml
@@ -15,4 +15,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
<subitem label="sub 1" extra="testing"/>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr_serialized.txt
new file mode 100644
index 000000000..d00050603
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraAttr_serialized.txt
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="sub 1"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement.xml
index 4f9bf1bec..012f9fbf4 100644
--- a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement.xml
@@ -17,4 +17,4 @@ Did it work? Of course not, it is suppose to cause a parsing error.
</subitem>
</item>
-</cheatsheet> \ No newline at end of file
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement_serialized.txt b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement_serialized.txt
new file mode 100644
index 000000000..d00050603
--- /dev/null
+++ b/org.eclipse.ua.tests/data/cheatsheet/valid/tolerate/SubItemElement_ExtraElement_serialized.txt
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet
+ title="Test cheatsheet without cheatsheet element">
+ <item
+ title="Introduction"
+ description="Simple test"
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <nullList/>
+ <nullPerformWhen/>
+ <nullList/>
+ </item>
+ <list>
+ <item
+ title="Just a simple test"
+ description="Did it work? Of course not, it is suppose to cause a parsing error."
+ Href="null"
+ contextId="null">
+ <nullAction/>
+ <list/>
+ <nullPerformWhen/>
+ <list>
+ <subItem
+ label="sub 1"
+ when="null"
+ isSkip="false">
+ <nullAction/>
+ <nullPerformWhen/>
+ </subItem>
+ </list>
+ </item>
+ </list>
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/data/intro/platform/serialized.txt b/org.eclipse.ua.tests/data/intro/platform/serialized.txt
new file mode 100644
index 000000000..a12fa8745
--- /dev/null
+++ b/org.eclipse.ua.tests/data/intro/platform/serialized.txt
@@ -0,0 +1,534 @@
+
+Intro Model Content:
+======================
+
+Model has valid config = true
+Presentation type = 2
+Home page id = root
+Number of pages (not including Root Page) = 4
+Number of shared groups = 0
+Number of unresolved extensions = 0
+
+HOME PAGE:
+--------------
+ is dynamic= true
+ id = root
+ title = Welcome to Eclipse 3.2
+ style = file:/<filtered>/root.css
+ alt-style = file:/<filtered>/root_swt.properties
+ url = null
+ style-id = page
+ page styles are =
+ page alt-styles are =
+ page children = 3
+
+ TITLE: id = null
+ title = Welcome to Eclipse 3.2
+ style-id = intro-header
+ GROUP: id = links-background
+ label = null
+ children = 1
+ style-id = null
+ GROUP: id = page-links
+ label = null
+ children = 6
+ style-id = null
+ ANCHOR: id = beginAnchor
+ LINK: id = overview
+ label = Overview
+ text = Find out what Eclipse is all about
+ url = http://org.eclipse.ui.intro/showPage?id=overview
+ style-id = left
+ LINK: id = tutorials
+ label = Tutorials
+ text = Let us guide you through Eclipse end-to-end tutorials
+ url = http://org.eclipse.ui.intro/showPage?id=tutorials
+ style-id = left
+ LINK: id = samples
+ label = Samples
+ text = Explore Eclipse development through code samples
+ url = http://org.eclipse.ui.intro/showPage?id=samples
+ style-id = right
+ LINK: id = news
+ label = What's New
+ text = Find out what is new in this release
+ url = http://org.eclipse.ui.intro/showPage?id=news
+ style-id = right
+ ANCHOR: id = endAnchor
+ GROUP: id = action-links
+ label = null
+ children = 1
+ style-id = null
+ LINK: id = workbench
+ label = Workbench
+ text = Go to the workbench
+ url = http://org.eclipse.ui.intro/switchToLaunchBar
+ style-id = null
+
+PAGE id = overview
+----------
+ title = Welcome to Eclipse 3.2
+ style = file:/<filtered>/overview.css
+ alt-style = file:/<filtered>/swt.properties
+ style-id = page
+ page styles are = file:/<filtered>/overview.css
+ file:/<filtered>/overview.css
+
+ page alt-styles are = file:/<filtered>/swt.properties from org.eclipse.jdt
+ file:/<filtered>/swt.properties from org.eclipse.pde
+
+ page children = 4
+
+ TITLE: id = null
+ title = Welcome to Eclipse 3.2
+ style-id = intro-header
+ GROUP: id = curve-image
+ label = null
+ children = 0
+ style-id = null
+ GROUP: id = navigation-links
+ label = null
+ children = 2
+ style-id = null
+ GROUP: id = page-links
+ label = null
+ children = 6
+ style-id = null
+ ANCHOR: id = navigationBegin
+ LINK: id = overview
+ label = Overview
+ text = Find out what Eclipse is all about
+ url = http://org.eclipse.ui.intro/showPage?id=overview
+ style-id = left
+ LINK: id = tutorials
+ label = Tutorials
+ text = Let us guide you through Eclipse end-to-end tutorials
+ url = http://org.eclipse.ui.intro/showPage?id=tutorials
+ style-id = left
+ LINK: id = samples
+ label = Samples
+ text = Explore Eclipse development through code samples
+ url = http://org.eclipse.ui.intro/showPage?id=samples
+ style-id = right
+ LINK: id = news
+ label = What's New
+ text = Find out what is new in this release
+ url = http://org.eclipse.ui.intro/showPage?id=news
+ style-id = right
+ ANCHOR: id = navigationEnd
+ GROUP: id = action-links
+ label = null
+ children = 1
+ style-id = null
+ LINK: id = workbench
+ label = Workbench
+ text = Go to the workbench
+ url = http://org.eclipse.ui.intro/switchToLaunchBar
+ style-id = null
+ GROUP: id = page-content
+ label = null
+ children = 4
+ style-id = null
+ GROUP: id = content-header
+ label = OVERVIEW
+ children = 0
+ style-id = null
+ TEXT: id = page-title
+ text = OVERVIEW
+ style-id = page-title
+ TEXT: id = page-description
+ text = Eclipse is a kind of universal tool platform - an open extensible IDE for anything and nothing in particular. It provides a feature-rich development environment that allows the developer to efficiently create tools that integrate seamlessly into the Eclipse Platform.
+ style-id = page-description
+ GROUP: id = overview-links
+ label = null
+ children = 8
+ style-id = null
+ ANCHOR: id = beginAnchor
+ LINK: id = basics
+ label = Workbench basics
+ text = Learn about basic Eclipse workbench concepts
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.platform.doc.user/gettingStarted/intro/overview.htm&embedTarget=page-content
+ style-id = null
+ LINK: id = team
+ label = Team support
+ text = Find out how to collaborate with other developers
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.platform.doc.user/concepts/concepts-26.htm&embedTarget=page-content
+ style-id = null
+ LINK: id = java
+ label = Java development
+ text = Get familiar with developing Java programs using Eclipse
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.jdt.doc.user/gettingStarted/intro/overview.htm&embedTarget=page-content
+ style-id = null
+ ANCHOR: id = jdtAnchor
+ LINK: id = pde
+ label = Eclipse plug-in development
+ text = Learn how to extend Eclipse by building new plug-ins
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.pde.doc.user/guide/intro/pde_overview.htm&embedTarget=page-content
+ style-id = null
+ ANCHOR: id = pdeAnchor
+ ANCHOR: id = endAnchor
+
+PAGE id = tutorials
+----------
+ title = Welcome to Eclipse 3.2
+ style = file:/<filtered>/tutorials.css
+ alt-style = file:/<filtered>/swt.properties
+ style-id = page
+ page styles are = file:/<filtered>/tutorials.css
+ file:/<filtered>/tutorials.css
+
+ page alt-styles are = file:/<filtered>/swt.properties from org.eclipse.jdt
+ file:/<filtered>/swt.properties from org.eclipse.pde
+
+ page children = 4
+
+ TITLE: id = null
+ title = Welcome to Eclipse 3.2
+ style-id = intro-header
+ GROUP: id = curve-image
+ label = null
+ children = 0
+ style-id = null
+ GROUP: id = navigation-links
+ label = null
+ children = 2
+ style-id = null
+ GROUP: id = page-links
+ label = null
+ children = 6
+ style-id = null
+ ANCHOR: id = navigationBegin
+ LINK: id = overview
+ label = Overview
+ text = Find out what Eclipse is all about
+ url = http://org.eclipse.ui.intro/showPage?id=overview
+ style-id = left
+ LINK: id = tutorials
+ label = Tutorials
+ text = Let us guide you through Eclipse end-to-end tutorials
+ url = http://org.eclipse.ui.intro/showPage?id=tutorials
+ style-id = left
+ LINK: id = samples
+ label = Samples
+ text = Explore Eclipse development through code samples
+ url = http://org.eclipse.ui.intro/showPage?id=samples
+ style-id = right
+ LINK: id = news
+ label = What's New
+ text = Find out what is new in this release
+ url = http://org.eclipse.ui.intro/showPage?id=news
+ style-id = right
+ ANCHOR: id = navigationEnd
+ GROUP: id = action-links
+ label = null
+ children = 1
+ style-id = null
+ LINK: id = workbench
+ label = Workbench
+ text = Go to the workbench
+ url = http://org.eclipse.ui.intro/switchToLaunchBar
+ style-id = null
+ GROUP: id = page-content
+ label = null
+ children = 9
+ style-id = null
+ GROUP: id = content-header
+ label = TUTORIALS
+ children = 0
+ style-id = null
+ TEXT: id = page-title
+ text = TUTORIALS
+ style-id = page-title
+ TEXT: id = page-description
+ text = Learn how to be productive using Eclipse by completing end-to-end tutorials that will guide you along the way.
+ style-id = page-description
+ ANCHOR: id = beginAnchor
+ GROUP: id = java
+ label = Java Development
+ children = 2
+ style-id = tutorials-group
+ LINK: id = hello-world
+ label = Build a simple Java application
+ text = Create a small Java program that will print "Hello, World" on the console
+ url = http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=org.eclipse.jdt.helloworld
+ style-id = tutorials-link
+ LINK: id = swt
+ label = Build a standalone SWT application
+ text = Create a SWT application that runs without the workbench
+ url = http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=org.eclipse.jdt.helloworld.swt
+ style-id = tutorials-link
+ ANCHOR: id = jdtAnchor
+ GROUP: id = pde
+ label = Eclipse Plug-in Development
+ children = 3
+ style-id = tutorials-group
+ LINK: id = pde-hello-world
+ label = Create a "Hello, World" plug-in
+ text = Create an Eclipse plug-in that will open a message box from the menu
+ url = http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=org.eclipse.pde.helloworld
+ style-id = tutorials-link
+ LINK: id = features
+ label = Deploy a feature on an update site
+ text = End-to-end tutorial in building and deploying features
+ url = http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=org.eclipse.pde.updates
+ style-id = tutorials-link
+ LINK: id = rcp
+ label = Build a Rich Client Platform application
+ text = Create a full RCP application step by step
+ url = http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=org.eclipse.pde.rcpapp
+ style-id = tutorials-link
+ ANCHOR: id = pdeAnchor
+ ANCHOR: id = endAnchor
+
+PAGE id = samples
+----------
+ title = Welcome to Eclipse 3.2
+ style = file:/<filtered>/samples.css
+ alt-style = file:/<filtered>/swt.properties
+ style-id = page
+ page styles are = file:/<filtered>/samples.css
+
+ page alt-styles are = file:/<filtered>/swt.properties from org.eclipse.pde
+
+ page children = 4
+
+ TITLE: id = null
+ title = Welcome to Eclipse 3.2
+ style-id = intro-header
+ GROUP: id = curve-image
+ label = null
+ children = 0
+ style-id = null
+ GROUP: id = navigation-links
+ label = null
+ children = 2
+ style-id = null
+ GROUP: id = page-links
+ label = null
+ children = 6
+ style-id = null
+ ANCHOR: id = navigationBegin
+ LINK: id = overview
+ label = Overview
+ text = Find out what Eclipse is all about
+ url = http://org.eclipse.ui.intro/showPage?id=overview
+ style-id = left
+ LINK: id = tutorials
+ label = Tutorials
+ text = Let us guide you through Eclipse end-to-end tutorials
+ url = http://org.eclipse.ui.intro/showPage?id=tutorials
+ style-id = left
+ LINK: id = samples
+ label = Samples
+ text = Explore Eclipse development through code samples
+ url = http://org.eclipse.ui.intro/showPage?id=samples
+ style-id = right
+ LINK: id = news
+ label = What's New
+ text = Find out what is new in this release
+ url = http://org.eclipse.ui.intro/showPage?id=news
+ style-id = right
+ ANCHOR: id = navigationEnd
+ GROUP: id = action-links
+ label = null
+ children = 1
+ style-id = null
+ LINK: id = workbench
+ label = Workbench
+ text = Go to the workbench
+ url = http://org.eclipse.ui.intro/switchToLaunchBar
+ style-id = null
+ GROUP: id = page-content
+ label = null
+ children = 9
+ style-id = null
+ GROUP: id = content-header
+ label = SAMPLES
+ children = 0
+ style-id = null
+ TEXT: id = page-title
+ text = SAMPLES
+ style-id = page-title
+ TEXT: id = page-description
+ text = Explore Eclipse by installing prefabricated samples (may require Internet connection).
+ style-id = page-description
+ ANCHOR: id = beginAnchor
+ ANCHOR: id = jdtAnchor
+ GROUP: id = swt
+ label = SWT
+ children = 3
+ style-id = samples-group
+ TEXT: id = null
+ text = Run SWT samples using either the standalone SWT launcher or as an integrated workbench view.
+ style-id = group-description
+ LINK: id = swt-examples
+ label = Workbench views and standalone applications
+ text = The SWT Example launcher will allow you to launch a collection of SWT examples. Some of the examples can be run independent of the eclipse platform and others will be available as views inside the workbench.
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&id=org.eclipse.sdk.samples.swt.examples
+ style-id = sample-link
+ ANCHOR: id = swtGroupAnchor
+ GROUP: id = workbench
+ label = Workbench
+ children = 7
+ style-id = samples-group
+ TEXT: id = null
+ text = The following samples demonstrate how to tightly integrate into the Eclipse workbench.
+ style-id = group-description
+ LINK: id = multi-page-editor
+ label = Multi-page editor
+ text = Shows how to create an editor with multiple pages
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&id=org.eclipse.sdk.samples.multipageeditor
+ style-id = sample-link
+ LINK: id = property-sheet
+ label = Property sheet and outline
+ text = Demonstrates how to use property sheet and outline views
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&id=org.eclipse.sdk.samples.propertysheet
+ style-id = sample-link
+ LINK: id = readmetool
+ label = Readme tool
+ text = Shows how to create your own extension points
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&id=org.eclipse.sdk.samples.readmetool
+ style-id = sample-link
+ LINK: id = java-editor
+ label = Java editor
+ text = Demonstrates standard features available to custom text editors
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&id=org.eclipse.sdk.samples.javaeditor
+ style-id = sample-link
+ ANCHOR: id = jdtAnchor
+ ANCHOR: id = workbenchGroupAnchor
+ ANCHOR: id = pdeAnchor
+ ANCHOR: id = endAnchor
+
+PAGE id = news
+----------
+ title = Welcome to Eclipse 3.2
+ style = file:/<filtered>/whatsnew.css
+ alt-style = file:/<filtered>/swt.properties
+ style-id = page
+ page styles are = file:/<filtered>/news.css
+
+ page alt-styles are = file:/<filtered>/swt.properties from org.eclipse.pde
+
+ page children = 4
+
+ TITLE: id = null
+ title = Welcome to Eclipse 3.2
+ style-id = intro-header
+ GROUP: id = curve-image
+ label = null
+ children = 0
+ style-id = null
+ GROUP: id = navigation-links
+ label = null
+ children = 2
+ style-id = null
+ GROUP: id = page-links
+ label = null
+ children = 6
+ style-id = null
+ ANCHOR: id = navigationBegin
+ LINK: id = overview
+ label = Overview
+ text = Find out what Eclipse is all about
+ url = http://org.eclipse.ui.intro/showPage?id=overview
+ style-id = left
+ LINK: id = tutorials
+ label = Tutorials
+ text = Let us guide you through Eclipse end-to-end tutorials
+ url = http://org.eclipse.ui.intro/showPage?id=tutorials
+ style-id = left
+ LINK: id = samples
+ label = Samples
+ text = Explore Eclipse development through code samples
+ url = http://org.eclipse.ui.intro/showPage?id=samples
+ style-id = right
+ LINK: id = news
+ label = What's New
+ text = Find out what is new in this release
+ url = http://org.eclipse.ui.intro/showPage?id=news
+ style-id = right
+ ANCHOR: id = navigationEnd
+ GROUP: id = action-links
+ label = null
+ children = 1
+ style-id = null
+ LINK: id = workbench
+ label = Workbench
+ text = Go to the workbench
+ url = http://org.eclipse.ui.intro/switchToLaunchBar
+ style-id = null
+ GROUP: id = page-content
+ label = null
+ children = 6
+ style-id = null
+ GROUP: id = content-header
+ label = WHAT'S NEW
+ children = 0
+ style-id = null
+ TEXT: id = page-title
+ text = WHAT'S NEW
+ style-id = page-title
+ ANCHOR: id = beginAnchor
+ GROUP: id = noteworthy-links
+ label = New and Noteworthy
+ children = 6
+ style-id = null
+ LINK: id = platform-noteworthy
+ label = Eclipse Platform
+ text = Find out about the major new features in this release
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.platform.doc.user/whatsNew/platform_whatsnew.html
+ style-id = noteworthy-link
+ LINK: id = jdt-noteworthy
+ label = Java development tools
+ text = Find out about significant changes made to the Java development tools
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.jdt.doc.user/whatsNew/jdt_whatsnew.html
+ style-id = noteworthy-link
+ ANCHOR: id = jdtAnchor
+ LINK: id = pde-noteworthy
+ label = Plug-in Development Environment
+ text = Learn about significant changes made to PDE for this release
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.pde.doc.user/whatsNew/pde_whatsnew.htm
+ style-id = noteworthy-link
+ ANCHOR: id = pdeAnchor
+ ANCHOR: id = generalAnchor
+ GROUP: id = news-links
+ label = General
+ children = 5
+ style-id = null
+ LINK: id = migration
+ label = Migration from the previous release
+ text = Learn what you need to do to make your old code work in Eclipse 3.1
+ url = http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.platform.doc.isv/porting/eclipse_3_1_porting_guide.html
+ style-id = null
+ ANCHOR: id = linksBeginAnchor
+ LINK: id = updates
+ label = New Updates
+ text = Get the latest updates from Eclipse.org
+ url = http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.platform&class=org.eclipse.platform.internal.LaunchUpdateIntroAction
+ style-id = null
+ LINK: id = eclipse
+ label = Eclipse community
+ text = Join the community, read articles and news on Eclipse.org
+ url = http://www.eclipse.org
+ style-id = null
+ ANCHOR: id = linksAnchor
+ ANCHOR: id = endAnchor
+
+Model Flag Tests:
+----------------
+ First page children are:
+ Groups: 3
+ Links: 0
+ Texts: 0
+ HTMLs: 0
+ Images: 0
+ Includes: 0
+ Page Titles: 1
+ Page Heads: 0
+ Model Elements: 4
+ Containers: 3
+ All Pages: 0
+ Anchors: 0
+ Content providers: 0
+ Elements with Text child(AbstractTextElemets): 0
+ Groups and Links: 3 \ No newline at end of file
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroTests.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroTests.java
new file mode 100644
index 000000000..a98277665
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroTests.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests.intro;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.ua.tests.intro.parser.AllParserTests;
+
+/*
+ * Tests all intro (welcome) functionality (automated).
+ */
+public class AllIntroTests extends TestSuite {
+
+ /*
+ * Returns the entire test suite.
+ */
+ public static Test suite() {
+ return new AllIntroTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllIntroTests() {
+ addTest(AllParserTests.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/AllParserTests.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/AllParserTests.java
new file mode 100644
index 000000000..3778fa968
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/AllParserTests.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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.ua.tests.intro.parser;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/*
+ * Tests all intro parser functionality (automated).
+ */
+public class AllParserTests extends TestSuite {
+
+ /*
+ * Returns the test suite.
+ */
+ public static Test suite() {
+ return new AllParserTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllParserTests() {
+ addTest(PlatformTest.suite());
+ addTest(ValidTest.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/PlatformTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/PlatformTest.java
new file mode 100644
index 000000000..e178c31ca
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/PlatformTest.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.intro.parser;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ua.tests.intro.util.IntroModelSerializer;
+import org.eclipse.ua.tests.intro.util.IntroModelSerializerTest;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.FileUtil;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
+import org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager;
+import org.osgi.framework.Bundle;
+
+/*
+ * Tests the intro parser on valid intro content.
+ */
+public class PlatformTest extends TestCase {
+
+ private static final String SERIALIZED_PATH = "data/intro/platform/serialized.txt";
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(PlatformTest.class);
+ }
+
+ /*
+ * Test the platform's parsed intro content.
+ */
+ public void testModel() {
+ IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
+ Assert.assertEquals("The platform did not have the expected number of \"org.eclipse.ui.intro.config\" extensions.", 1, elements.length);
+
+ IConfigurationElement element = elements[0];
+
+ String pluginRoot = ResourceFinder.findFile(UserAssistanceTestPlugin.getDefault(), "/").toString().substring("file:".length());
+ String content = element.getAttribute("content");
+ String id = element.getAttribute("id");
+ String resultFile = pluginRoot + SERIALIZED_PATH;
+
+ IntroModelRoot model = ExtensionPointManager.getInst().getModel(id);
+ IntroModelSerializer serializer = new IntroModelSerializer(model);
+
+ try {
+ String expected = FileUtil.getContents(resultFile);
+ String actual = serializer.toString();
+ StringTokenizer tok1 = new StringTokenizer(expected, "\n");
+ StringTokenizer tok2 = new StringTokenizer(actual, "\n");
+
+ /*
+ * Report the line number and line text where it didn't match,
+ * as well as the extension id and expected results file.
+ */
+ int tokenNumber = 0;
+ while (tok1.hasMoreTokens() && tok2.hasMoreTokens()) {
+ String a = tok1.nextToken();
+ String b = tok2.nextToken();
+ Assert.assertEquals("Serialized intro content model text for \"" + id + "\" did not match expected result (" + IntroModelSerializerTest.getResultFile(content) + "). First difference occured on token " + tokenNumber + ".", a, b);
+ ++tokenNumber;
+ }
+ }
+ catch(Exception e) {
+ Assert.fail("An error occured while loading expected result file for intro at: " + resultFile);
+ }
+ }
+
+ /*
+ * Some extensions run samples that involve executing code. Check to make sure
+ * that the classes exist and can be instantiated.
+ */
+ public void testClasses() {
+ String pluginRoot = ResourceFinder.findFile(UserAssistanceTestPlugin.getDefault(), "/").toString().substring("file:".length());
+ String resultFile = pluginRoot + SERIALIZED_PATH;
+
+ try {
+ String contents = FileUtil.getContents(resultFile);
+ StringTokenizer tok = new StringTokenizer(contents);
+ while (tok.hasMoreTokens()) {
+ String next = tok.nextToken();
+ if (next.startsWith("http://org.eclipse.ui.intro/runAction?")) {
+ Map map = createMap(next.substring("http://org.eclipse.ui.intro/runAction?".length()));
+ Assert.assertTrue("The runAction was missing the class attribute: " + next, map.containsKey("class"));
+ Assert.assertTrue("The runAction was missing the pluginId attribute: " + next, map.containsKey("pluginId"));
+
+ String clazz = (String)map.get("class");
+ String pluginId = (String)map.get("pluginId");
+
+ Bundle bundle = Platform.getBundle(pluginId);
+ Assert.assertNotNull("The plugin referenced in one of the platform's intro runAction URLs (" + next + ") was not found: " + pluginId, bundle);
+
+ try {
+ Class c = bundle.loadClass(clazz);
+ c.newInstance();
+ }
+ catch (ClassNotFoundException e) {
+ Assert.fail("One of the classes in the platform's intro runActions URLs was not found: " + clazz + " in plugin: " + pluginId);
+ }
+ catch (InstantiationException e) {
+ Assert.fail("One of the classes in the platform's intro runActions URLs could not be instantiated: " + clazz + " in plugin: " + pluginId);
+ }
+ catch (IllegalAccessException e) {
+ Assert.fail("One of the classes in the platform's intro runActions URLs could not be accessed (is it public?): " + clazz + " in plugin: " + pluginId);
+ }
+ }
+ }
+ }
+ catch (IOException e) {
+ Assert.fail("An IOException occured while reading platform's serialized.txt file");
+ }
+ }
+
+ /*
+ * Generates a map from the given string of the form:
+ * "key1=value1&key2=value2&..." (i.e. URL parameters)
+ */
+ private static Map createMap(String args) {
+ Map map = new HashMap();
+ StringTokenizer tok2 = new StringTokenizer(args, "&");
+ while (tok2.hasMoreTokens()) {
+ String arg = tok2.nextToken();
+ int separator = arg.indexOf('=');
+ map.put(arg.substring(0, separator), arg.substring(separator + 1));
+ }
+ return map;
+ }
+}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java
new file mode 100644
index 000000000..1c353565d
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.ua.tests.intro.parser;
+
+import java.util.StringTokenizer;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ua.tests.intro.util.IntroModelSerializer;
+import org.eclipse.ua.tests.intro.util.IntroModelSerializerTest;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.FileUtil;
+import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
+import org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager;
+
+/*
+ * Tests the intro parser on valid intro content.
+ */
+public class ValidTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(ValidTest.class);
+ }
+
+ /*
+ * Test valid intro content.
+ */
+ public void testParserValid() {
+ IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
+ for (int i=0;i<elements.length;++i) {
+ /*
+ * Only use the ones from this test plugin.
+ */
+ if (elements[i].getDeclaringExtension().getNamespace().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
+ String pluginRoot = UserAssistanceTestPlugin.getDefault().getBundle().getLocation().substring("update@".length());
+ String content = elements[i].getAttribute("content");
+ String id = elements[i].getAttribute("id");
+ String resultFile = IntroModelSerializerTest.getResultFile(pluginRoot + content);
+
+ IntroModelRoot model = ExtensionPointManager.getInst().getModel(id);
+ IntroModelSerializer serializer = new IntroModelSerializer(model);
+
+ try {
+ String expected = FileUtil.getContents(resultFile);
+ String actual = serializer.toString();
+
+ StringTokenizer tok1 = new StringTokenizer(expected, "\n");
+ StringTokenizer tok2 = new StringTokenizer(actual, "\n");
+
+ /*
+ * Report the line number and line text where it didn't match,
+ * as well as the extension id and expected results file.
+ */
+ int lineNumber = 0;
+ while (tok1.hasMoreTokens() && tok2.hasMoreTokens()) {
+ String a = tok1.nextToken();
+ String b = tok2.nextToken();
+ Assert.assertEquals("Serialized intro content model text for \"" + id + "\" did not match expected result (" + IntroModelSerializerTest.getResultFile(content) + "). First difference occured on line " + lineNumber + ".", a, b);
+ ++lineNumber;
+ }
+ }
+ catch(Exception e) {
+ Assert.fail("An error occured while loading expected result file for intro at: " + resultFile);
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java
new file mode 100644
index 000000000..3b0bbd66a
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java
@@ -0,0 +1,353 @@
+/*******************************************************************************
+ * Copyright (c) 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.ua.tests.intro.util;
+
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Set;
+
+import org.eclipse.ui.internal.intro.impl.model.AbstractIntroContainer;
+import org.eclipse.ui.internal.intro.impl.model.AbstractIntroElement;
+import org.eclipse.ui.internal.intro.impl.model.AbstractIntroPage;
+import org.eclipse.ui.internal.intro.impl.model.IntroAnchor;
+import org.eclipse.ui.internal.intro.impl.model.IntroContentProvider;
+import org.eclipse.ui.internal.intro.impl.model.IntroGroup;
+import org.eclipse.ui.internal.intro.impl.model.IntroHTML;
+import org.eclipse.ui.internal.intro.impl.model.IntroHead;
+import org.eclipse.ui.internal.intro.impl.model.IntroHomePage;
+import org.eclipse.ui.internal.intro.impl.model.IntroImage;
+import org.eclipse.ui.internal.intro.impl.model.IntroInclude;
+import org.eclipse.ui.internal.intro.impl.model.IntroLink;
+import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
+import org.eclipse.ui.internal.intro.impl.model.IntroPage;
+import org.eclipse.ui.internal.intro.impl.model.IntroPageTitle;
+import org.eclipse.ui.internal.intro.impl.model.IntroText;
+import org.osgi.framework.Bundle;
+
+public class IntroModelSerializer {
+
+ private StringBuffer buffer;
+
+ public IntroModelSerializer(IntroModelRoot root) {
+ this.buffer = new StringBuffer();
+ printModelRootInfo(root, buffer);
+
+ // Root Page
+ IntroHomePage rootPage = root.getHomePage();
+ printHomePage(rootPage, buffer);
+ printPageChildren(rootPage, buffer);
+
+ IntroPage[] pages = root.getPages();
+ printPages(pages, buffer);
+
+ buffer.append("\n\n"); //$NON-NLS-1$
+ printModelFlagTests(root, buffer);
+ }
+
+ /*
+ * Removes any platform/machine-specific paths from the given URL. This is
+ * used to remove absolute paths from the serialized model in order to compare
+ * results in automated tests.
+ */
+ private String filterURL(String url) {
+ if (url != null && url.startsWith("file:/")) {
+ return "file:/" + "<filtered>" + url.substring(url.lastIndexOf('/'));
+ }
+ return url;
+ }
+
+ private void printModelRootInfo(IntroModelRoot model, StringBuffer text) {
+ text.append("\nIntro Model Content:"); //$NON-NLS-1$
+ text.append("\n======================"); //$NON-NLS-1$
+ text.append("\n\nModel has valid config = " + model.hasValidConfig()); //$NON-NLS-1$
+ text.append("\nPresentation type = " //$NON-NLS-1$
+ + model.getPresentation().getType());
+ text.append("\nHome page id = " //$NON-NLS-1$
+ + model.getPresentation().getHomePageId());
+ IntroHead headContent = model.getPresentation().getHead();
+ if (headContent != null)
+ text.append("\nPresentation Shared Head = " + headContent.getSrc()); //$NON-NLS-1$
+ text.append("\nNumber of pages (not including Root Page) = " //$NON-NLS-1$
+ + model.getPages().length);
+ text.append("\nNumber of shared groups = " //$NON-NLS-1$
+ + model.getChildrenOfType(AbstractIntroElement.GROUP).length);
+ text
+ .append("\nNumber of unresolved extensions = " //$NON-NLS-1$
+ + model
+ .getChildrenOfType(AbstractIntroElement.CONTAINER_EXTENSION).length);
+ }
+
+ /**
+ * @param text
+ * @param root
+ */
+ private void printHomePage(IntroHomePage rootPage, StringBuffer text) {
+ text.append("\n\nHOME PAGE: "); //$NON-NLS-1$
+ text.append("\n--------------"); //$NON-NLS-1$
+ text
+ .append("\n\tis dynamic= " + ((IntroModelRoot) rootPage.getParent()).isDynamic()); //$NON-NLS-1$
+
+ text.append("\n\tid = " + rootPage.getId()); //$NON-NLS-1$
+ text.append("\n\ttitle = " + rootPage.getTitle()); //$NON-NLS-1$
+ text.append("\n\tstyle = " + filterURL(rootPage.getStyle())); //$NON-NLS-1$
+ text.append("\n\talt-style = " + filterURL(rootPage.getAltStyle())); //$NON-NLS-1$
+ text.append("\n\turl = " + rootPage.getUrl()); //$NON-NLS-1$
+ text.append("\n\tstyle-id = " + rootPage.getStyleId()); //$NON-NLS-1$
+ printPageStyles(rootPage, text);
+ }
+
+ private void printPageStyles(AbstractIntroPage page, StringBuffer text) {
+ text.append("\n\tpage styles are = "); //$NON-NLS-1$
+ String[] styles = page.getStyles();
+ for (int i = 0; i < styles.length; i++)
+ text.append(filterURL(styles[i] + "\n\t\t\t")); //$NON-NLS-1$
+ text.append("\n\tpage alt-styles are = "); //$NON-NLS-1$
+
+ final Hashtable altStylesHashtable = page.getAltStyles();
+ if (altStylesHashtable == null)
+ return;
+
+ Set set = altStylesHashtable.keySet();
+ String[] sorted = new String[set.size()];
+ set.toArray(sorted);
+ Arrays.sort(sorted);
+
+ for (int i=0;i<sorted.length;++i) {
+ Bundle bundle = (Bundle) altStylesHashtable.get(sorted[i]);
+ text.append(filterURL(sorted[i]) + " from " + bundle.getSymbolicName()); //$NON-NLS-1$
+ text.append("\n\t\t"); //$NON-NLS-1$
+ }
+ }
+
+ private void printPageChildren(AbstractIntroPage page, StringBuffer text) {
+
+ text.append("\n\tpage children = " + page.getChildren().length); //$NON-NLS-1$
+ text.append("\n"); //$NON-NLS-1$
+ printContainerChildren(page, text, "\n\t\t"); //$NON-NLS-1$
+
+ }
+
+ private void printContainerChildren(AbstractIntroContainer container,
+ StringBuffer text, String indent) {
+
+ AbstractIntroElement[] children = container.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ int childType = children[i].getType();
+ switch (childType) {
+ case AbstractIntroElement.ELEMENT:
+ text.append("SHOULD NEVER BE HERE"); //$NON-NLS-1$
+ break;
+ case AbstractIntroElement.GROUP:
+ printGroup(text, (IntroGroup) children[i], indent);
+ break;
+ case AbstractIntroElement.LINK:
+ printLink(text, (IntroLink) children[i], indent);
+ break;
+ case AbstractIntroElement.TEXT:
+ printText(text, (IntroText) children[i], indent);
+ break;
+ case AbstractIntroElement.IMAGE:
+ printImage(text, (IntroImage) children[i], indent);
+ break;
+ case AbstractIntroElement.HTML:
+ printHtml(text, (IntroHTML) children[i], indent);
+ break;
+ case AbstractIntroElement.INCLUDE:
+ printInclude(text, (IntroInclude) children[i], indent);
+ break;
+ case AbstractIntroElement.HEAD:
+ printHead(text, (IntroHead) children[i], indent);
+ break;
+ case AbstractIntroElement.PAGE_TITLE:
+ printPageTitle(text, (IntroPageTitle) children[i], indent);
+ break;
+ case AbstractIntroElement.ANCHOR:
+ printAnchor(text, (IntroAnchor) children[i], indent);
+ break;
+ case AbstractIntroElement.CONTENT_PROVIDER:
+ printContentProvidor(text, (IntroContentProvider) children[i],
+ indent);
+ break;
+
+ }
+ }
+ }
+
+ private void printGroup(StringBuffer text, IntroGroup group, String indent) {
+ text.append(indent + "GROUP: id = " + group.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "label = " + group.getLabel()); //$NON-NLS-1$
+ text.append(indent + "children = " + group.getChildren().length); //$NON-NLS-1$
+ text.append(indent + "style-id = " + group.getStyleId()); //$NON-NLS-1$
+ printContainerChildren(group, text, indent + "\t\t"); //$NON-NLS-1$
+ }
+
+ private void printLink(StringBuffer text, IntroLink link, String indent) {
+ text.append(indent + "LINK: id = " + link.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "label = " + link.getLabel()); //$NON-NLS-1$
+ text.append(indent + "text = " + link.getText()); //$NON-NLS-1$
+ text.append(indent + "url = " + link.getUrl()); //$NON-NLS-1$
+ text.append(indent + "style-id = " + link.getStyleId()); //$NON-NLS-1$
+ }
+
+ private void printText(StringBuffer text, IntroText introText, String indent) {
+ text.append(indent + "TEXT: id = " + introText.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "text = " + introText.getText()); //$NON-NLS-1$
+ text.append(indent + "style-id = " + introText.getStyleId()); //$NON-NLS-1$
+ }
+
+ private void printImage(StringBuffer text, IntroImage image, String indent) {
+ text.append(indent + "IMAGE: id = " + image.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "src = " + image.getSrc()); //$NON-NLS-1$
+ text.append(indent + "alt = " + image.getAlt()); //$NON-NLS-1$
+ text.append(indent + "style-id = " + image.getStyleId()); //$NON-NLS-1$
+ }
+
+ private void printHtml(StringBuffer text, IntroHTML html, String indent) {
+ text.append(indent + "HTML: id = " + html.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "src = " + html.getSrc()); //$NON-NLS-1$
+ text.append(indent + "isInlined = " + html.isInlined()); //$NON-NLS-1$
+ text.append(indent + "style-id = " + html.getStyleId()); //$NON-NLS-1$
+ if (html.getIntroImage() != null)
+ printImage(text, html.getIntroImage(), indent + "\t\t"); //$NON-NLS-1$
+ if (html.getIntroText() != null)
+ printText(text, html.getIntroText(), indent + "\t\t"); //$NON-NLS-1$
+
+ }
+
+ private void printInclude(StringBuffer text, IntroInclude include,
+ String indent) {
+ text.append(indent + "INCLUDE: configId = " + include.getConfigId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "path = " + include.getPath()); //$NON-NLS-1$
+ text.append(indent + "merge-style = " + include.getMergeStyle()); //$NON-NLS-1$
+ }
+
+ private void printHead(StringBuffer text, IntroHead head, String indent) {
+ text.append(indent + "HEAD: src = " + head.getSrc()); //$NON-NLS-1$
+ }
+
+ private void printPageTitle(StringBuffer text, IntroPageTitle title,
+ String indent) {
+ text.append(indent + "TITLE: id = " + title.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "title = " + title.getTitle()); //$NON-NLS-1$
+ text.append(indent + "style-id = " + title.getStyleId()); //$NON-NLS-1$
+ }
+
+ private void printAnchor(StringBuffer text, IntroAnchor anchor,
+ String indent) {
+ text.append(indent + "ANCHOR: id = " + anchor.getId()); //$NON-NLS-1$
+ }
+
+ private void printContentProvidor(StringBuffer text,
+ IntroContentProvider provider, String indent) {
+ text.append(indent + "CONTENT PROVIDER: id = " + provider.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "class = " + provider.getClassName()); //$NON-NLS-1$
+ text.append(indent + "pluginId = " + provider.getPluginId()); //$NON-NLS-1$
+ if (provider.getIntroText() != null)
+ printText(text, provider.getIntroText(), indent + "\t\t"); //$NON-NLS-1$
+
+ }
+
+ /**
+ * Appends a given page's categories to the Text buffer.
+ *
+ * @param text
+ */
+ private void printPages(IntroPage[] pages, StringBuffer text) {
+ for (int i = 0; i < pages.length; i++) {
+ text.append("\n\nPAGE id = " + pages[i].getId()); //$NON-NLS-1$
+ text.append("\n----------"); //$NON-NLS-1$
+ text.append("\n\ttitle = " + pages[i].getTitle()); //$NON-NLS-1$
+ text.append("\n\tstyle = " + filterURL(pages[i].getStyle())); //$NON-NLS-1$
+ text.append("\n\talt-style = " + filterURL(pages[i].getAltStyle())); //$NON-NLS-1$
+ text.append("\n\tstyle-id = " + pages[i].getStyleId()); //$NON-NLS-1$
+ printPageStyles(pages[i], text);
+ printPageChildren(pages[i], text);
+ }
+ }
+
+ private void printModelFlagTests(IntroModelRoot model, StringBuffer text) {
+ text.append("Model Flag Tests: "); //$NON-NLS-1$
+ text.append("\n----------------"); //$NON-NLS-1$
+ if (model.getPages().length == 0) {
+ text.append("\nNo first page in model\n\n"); //$NON-NLS-1$
+ return;
+ }
+ IntroPage firstPage = model.getPages()[0];
+ text.append("\n\t\tFirst page children are: "); //$NON-NLS-1$
+ text
+ .append("\n\t\t\tGroups: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.GROUP).length);
+ text
+ .append("\n\t\t\tLinks: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.LINK).length);
+ text
+ .append("\n\t\t\tTexts: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.TEXT).length);
+ text
+ .append("\n\t\t\tHTMLs: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.HTML).length);
+ text
+ .append("\n\t\t\tImages: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.IMAGE).length);
+ text
+ .append("\n\t\t\tIncludes: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.INCLUDE).length);
+ text
+ .append("\n\t\t\tPage Titles: " //$NON-NLS-1$
+ + firstPage
+ .getChildrenOfType(AbstractIntroElement.PAGE_TITLE).length);
+ text
+ .append("\n\t\t\tPage Heads: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.HEAD).length);
+ text
+ .append("\n\t\t\tModel Elements: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.ELEMENT).length);
+ text
+ .append("\n\t\t\tContainers: " //$NON-NLS-1$
+ + firstPage
+ .getChildrenOfType(AbstractIntroElement.ABSTRACT_CONTAINER).length);
+ text
+ .append("\n\t\t\tAll Pages: " //$NON-NLS-1$
+ + firstPage
+ .getChildrenOfType(AbstractIntroElement.ABSTRACT_PAGE).length);
+ text
+ .append("\n\t\t\tAnchors: " //$NON-NLS-1$
+ + firstPage.getChildrenOfType(AbstractIntroElement.ANCHOR).length);
+ text
+ .append("\n\t\t\tContent providers: " //$NON-NLS-1$
+ + firstPage
+ .getChildrenOfType(AbstractIntroElement.CONTENT_PROVIDER).length);
+ text
+ .append("\n\t\t\tElements with Text child(AbstractTextElemets): " //$NON-NLS-1$
+ + firstPage
+ .getChildrenOfType(AbstractIntroElement.ABSTRACT_TEXT).length);
+
+ AbstractIntroElement[] linksAndGroups = (AbstractIntroElement[]) firstPage
+ .getChildrenOfType(AbstractIntroElement.GROUP
+ | AbstractIntroElement.LINK);
+ text.append("\n\t\t\tGroups and Links: " + linksAndGroups.length); //$NON-NLS-1$
+ }
+
+ /**
+ * @return Returns the textUI.
+ */
+ public String toString() {
+ return buffer.toString();
+ }
+}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java
new file mode 100644
index 000000000..bd5e3f771
--- /dev/null
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 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.ua.tests.intro.util;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.ResourceFinder;
+import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
+import org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager;
+
+/*
+ * A utility for regenerating the _serialized.txt files that contain the expected
+ * output for the intro content when serialized. This reads all the intro content from
+ * the plugin manifest (for this test plugin only), constructs the intro model, then
+ * serializes the model to a text file, which is stored in the same directory as the
+ * intro xml file, as <original_name>_serialized.txt.
+ *
+ * These files are used by the JUnit tests to compare the result with the expected
+ * result.
+ *
+ * Usage:
+ *
+ * 1. Run this test as a JUnit plug-in test.
+ * 2. Right-click in "Package Explorer -> Refresh".
+ *
+ * The new files should appear.
+ */
+public class IntroModelSerializerTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(IntroModelSerializerTest.class);
+ }
+
+ public void testRunSerializer() {
+ /*
+ * Serialize the SDK's intro.
+ */
+ IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
+ for (int i=0;i<elements.length;++i) {
+ String id = elements[i].getAttribute("id");
+ if ("org.eclipse.platform.introConfig".equals(id)) {
+ String pluginRoot = ResourceFinder.findFile(UserAssistanceTestPlugin.getDefault(), "/").toString().substring("file:".length());
+
+ IntroModelRoot model = ExtensionPointManager.getInst().getModel(id);
+ IntroModelSerializer serializer = new IntroModelSerializer(model);
+
+ try {
+ PrintWriter out = new PrintWriter(new FileOutputStream(pluginRoot + "data/intro/platform/serialized.txt"));
+ out.print(serializer.toString());
+ out.close();
+ }
+ catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ break;
+ }
+ }
+
+ /*
+ * Serialize the test intro.
+ */
+ elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
+ for (int i=0;i<elements.length;++i) {
+ /*
+ * Only use the ones from this test plugin.
+ */
+ if (elements[i].getDeclaringExtension().getNamespace().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
+ String pluginRoot = UserAssistanceTestPlugin.getDefault().getBundle().getLocation().substring("update@".length());
+ String content = elements[i].getAttribute("content");
+ String id = elements[i].getAttribute("id");
+
+ IntroModelRoot model = ExtensionPointManager.getInst().getModel(id);
+ IntroModelSerializer serializer = new IntroModelSerializer(model);
+
+ try {
+ PrintWriter out = new PrintWriter(new FileOutputStream(getResultFile(pluginRoot + content)));
+ out.print(serializer.toString());
+ out.close();
+ }
+ catch(FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /*
+ * Generates a filename with path to the result file that will be generated
+ * for the intro xml referred to by the string.
+ */
+ public static String getResultFile(String in) {
+ return in.substring(0, in.lastIndexOf('.')) + "_serialized.txt";
+ }
+}
diff --git a/org.eclipse.ua.tests/plugin.xml b/org.eclipse.ua.tests/plugin.xml
index 4ee3bbb7a..06076311c 100644
--- a/org.eclipse.ua.tests/plugin.xml
+++ b/org.eclipse.ua.tests/plugin.xml
@@ -1,62 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.ui.tests.cheatsheets"
- name="Cheat Sheets Test"
- version="3.0"
- provider-name="Eclipse.org"
- class="org.eclipse.ui.tests.cheatsheets.CheatSheetTestPlugin">
-
- <runtime>
- <library name="cheatsheetTests.jar"/>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.help.appserver"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.cheatsheets"/>
- <import plugin="org.eclipse.ui.forms"/>
- <import plugin="org.eclipse.ui.ide"/>
- </requires>
-
+<plugin>
- <extension
- point="org.eclipse.ui.cheatsheets.cheatSheetItemExtension">
- <itemExtension
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.ExtensionActionI"
- itemAttribute="actionI">
- </itemExtension>
- </extension>
- <extension
- point="org.eclipse.ui.cheatsheets.cheatSheetItemExtension">
- <itemExtension
- class="org.eclipse.ui.examples.cheatsheets.pattern.actions.ExtensionActionII"
- itemAttribute="actionII">
- </itemExtension>
- </extension>
-<!-- Cheat Sheet content extension point!!! -->
+ <!--
+ Cheat sheet test content
+ -->
<extension
point="org.eclipse.ui.cheatsheets.cheatSheetContent">
<category
name="Cheat sheet examples - part 1"
- id="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat">
+ id="org.eclipse.ua.tests.cheatsheet.cheatSheetsCat">
</category>
<category
name="Cheat sheet examples - part 2"
- id="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat2">
+ id="org.eclipse.ua.tests.cheatsheet.cheatSheetsCat2">
</category>
<category
name="Tests"
- id="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat">
+ id="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat">
</category>
<cheatsheet
+ name="ActionsTest"
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestActionsWithSkip.xml"
+ id="org.eclipse.ua.tests.cheatsheet.actions.TestActionsWithSkip">
+ <description>
+ This is a test cheat sheet used to verify actions.
+ </description>
+ </cheatsheet>
+ <cheatsheet
name="Hello World"
- category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat"
- contentFile="cheatsheets/examples/part1/HelloWorld.xml"
- id="org.eclipse.ui.examples.cheatsheets.HelloWorld">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsCat"
+ contentFile="data/cheatsheet/valid/HelloWorld.xml"
+ id="org.eclipse.ua.tests.cheatsheet.HelloWorld">
<description>
This cheat sheet will guide you through building a hello world Java application and testing it.
Uses only the basic cheat sheet features.
@@ -64,206 +40,98 @@
</cheatsheet>
<cheatsheet
name="Hello World With Extensions Icons"
- category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat"
- contentFile="cheatsheets/examples/part1/HelloWorldWithExtensions.xml"
- id="org.eclipse.ui.examples.cheatsheets.HelloWorldWithExtensions">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsCat"
+ contentFile="data/cheatsheet/valid/HelloWorldWithExtensions.xml"
+ id="org.eclipse.ua.tests.cheatsheet.HelloWorldWithExtensions">
<description>
This cheat sheet has extra icons next to the help icon using the cheatSheetItemExtension extension point.
</description>
</cheatsheet>
<cheatsheet
name="Hello World With Subitems"
- category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat"
- contentFile="cheatsheets/examples/part1/HelloWorldWithSubitems.xml"
- id="org.eclipse.ui.examples.cheatsheets.HelloWorldWithSubitem">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsCat"
+ contentFile="data/cheatsheet/valid/HelloWorldWithSubitems.xml"
+ id="org.eclipse.ua.tests.cheatsheet.HelloWorldWithSubitem">
<description>
This cheat sheet uses subitems.
</description>
</cheatsheet>
<cheatsheet
- name="Java Patterns"
- category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat2"
- contentFile="cheatsheets/examples/part2/PatternSheet.xml"
- id="org.eclipse.ui.examples.cheatsheets.PatternSheet"
- listener="org.eclipse.ui.examples.cheatsheets.pattern.listeners.PatternItemListener">
- <description>
- This cheatsheet to demonstrates some of the advanced cheat sheet features,
- including: conditional actions for an item, dynamic sub items,
- using the cheatsheet manager to persist data
- </description>
- </cheatsheet>
- <cheatsheet
- name="Java Patterns using Conditional SubItem"
- category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat2"
- contentFile="cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml"
- id="org.eclipse.ui.examples.cheatsheets.PatternSheetUsingConditionalSubItem"
- listener="org.eclipse.ui.examples.cheatsheets.pattern.listeners.PatternItemListener">
- <description>
- This cheatsheet to demonstrates some of the advanced cheat sheet features,
- including: conditional actions for an item, dynamic sub items,
- using the cheatsheet manager to persist data
- </description>
- </cheatsheet>
- <cheatsheet
name="Testing Cheat Sheets actions"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestCSActions.xml"
- id="org.eclipse.ui.tests.cheatsheets.cheatsheetsActions">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestCSActions.xml"
+ id="org.eclipse.ua.tests.cheatsheet.cheatsheetsActions">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
name="Testing Parameters"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestParameters.xml"
- id="org.eclipse.ui.tests.cheatsheets.parameters">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestParameters.xml"
+ id="org.eclipse.ua.tests.cheatsheet.parameters">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
- name="Testing Infopop and Help Links"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestInfopop_Help.xml"
- id="org.eclipse.ui.tests.cheatsheets.infopop.help">
+ name="Testing Context Help and Help Links"
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestContext_Help.xml"
+ id="org.eclipse.ua.tests.cheatsheet.infopop.help">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
name="Testing SubItems"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestSubItems.xml"
- id="org.eclipse.ui.tests.cheatsheets.subitems">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestSubItems.xml"
+ id="org.eclipse.ua.tests.cheatsheet.subitems">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
name="Testing Dynamic SubItems"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestDynamicSubItems.xml"
- id="org.eclipse.ui.tests.cheatsheets.dynamic.subitems">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestDynamicSubItems.xml"
+ id="org.eclipse.ua.tests.cheatsheet.dynamic.subitems">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
name="Testing Item Description Formatting"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestDescriptionFormatting.xml"
- id="org.eclipse.ui.tests.cheatsheets.description">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestDescriptionFormatting.xml"
+ id="org.eclipse.ua.tests.cheatsheet.description">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
- name="Rational Test1"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/rational/Test1.xml"
- listener="org.eclipse.ui.examples.cheatsheets.pattern.listeners.PatternItemListener"
- id="rational.Test1">
- </cheatsheet>
- <cheatsheet
- name="Rational Test2"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/rational/Test2.xml"
- listener="org.eclipse.ui.examples.cheatsheets.pattern.listeners.PatternItemListener"
- id="rational.Test2">
- </cheatsheet>
- <cheatsheet
name="Testing Actions"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestActions.xml"
- id="org.eclipse.ui.tests.cheatsheets.actions">
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/valid/TestActions.xml"
+ id="org.eclipse.ua.tests.cheatsheet.actions">
<description>
This cheat sheet has items to test the framework
</description>
</cheatsheet>
<cheatsheet
- name="Testing Non-exsting File"
- category="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat"
- contentFile="cheatsheets/tests/TestNonExistingFile.xml"
- id="org.eclipse.ui.tests.cheatsheets.nonExistingFile">
+ name="Testing Non-existent File"
+ category="org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat"
+ contentFile="data/cheatsheet/invalid/TestNonExistentFile.xml"
+ id="org.eclipse.ua.tests.cheatsheet.nonExistingFile">
</cheatsheet>
</extension>
+ <!--
+ Cheat sheet context help test
+ -->
<extension point="org.eclipse.help.contexts">
- <contexts file="contexts.xml"/>
- </extension>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Cheat Sheets Tests"
- id="org.eclipse.ui.tests.cheatsheets">
- </category>
- <view
- name="CheatSheetViewer Test"
- icon="icons/sample.gif"
- category="org.eclipse.ui.tests.cheatsheets"
- class="org.eclipse.ui.tests.cheatsheets.views.CheatSheetViewerTestView"
- id="org.eclipse.ui.tests.cheatsheets.views.CheatSheetViewerTestView">
- </view>
- </extension>
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xml"
- id="tests.cheatsheets.contribution1">
- <menu
- label="Test CheatSheet Parsing"
- path="additions"
- id="org.eclipse.ui.tests.cheatsheets.menu">
- <separator
- name="group1">
- </separator>
- </menu>
- <action
- label="Test Parsing"
- class="org.eclipse.ui.tests.cheatsheets.actions.TestCheatSheetParserAction"
- menubarPath="org.eclipse.ui.tests.cheatsheets.menu/group1"
- enablesFor="+"
- id="org.eclipse.ui.tests.cheatsheets.actions.TestCheatSheetParserAction">
- </action>
- </objectContribution>
- </extension>
-
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="Cheat Sheet Tests Action Set"
- visible="true"
- id="org.eclipse.ui.tests.cheatsheets.actionSet">
- <menu
- label="Cheat Sheet Tests"
- id="cheatSheetTests">
- <separator
- name="group1">
- </separator>
- </menu>
- <action
- label="Test opening with an invalid id"
- class="org.eclipse.ui.tests.cheatsheets.actions.TestCheatSheetViewerSetInputAction"
- menubarPath="cheatSheetTests/group1"
- id="org.eclipse.ui.tests.cheatsheets.actions.TestCheatSheetViewerSetInputAction">
- </action>
- <action
- label="Start WebApp"
- class="org.eclipse.ui.tests.cheatsheets.actions.TestStartWebApp"
- menubarPath="cheatSheetTests/group1"
- id="org.eclipse.ui.tests.cheatsheets.actions.TestStartWebApp">
- </action>
- <action
- label="Test opening from a URL"
- class="org.eclipse.ui.tests.cheatsheets.actions.TestOpeningURL"
- menubarPath="cheatSheetTests/group1"
- id="org.eclipse.ui.tests.cheatsheets.actions.TestOpeningURL">
- </action>
- </actionSet>
+ <contexts file="data/cheatsheet/contexts.xml"/>
</extension>
</plugin>
diff --git a/org.eclipse.ua.tests/readme.txt b/org.eclipse.ua.tests/readme.txt
deleted file mode 100644
index ad2c6753f..000000000
--- a/org.eclipse.ua.tests/readme.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-
-Examples
-========
-HelloWorld
-HelloWorld with Extensions
-HelloWorld with SubItems
-
-Design Patterns in Java
-Design Patterns in Java using ConditionalSubItem
-
-
-
-Tests
-=====
-
-Actions
-CSActions
-DescriptionFormatting
-Infopop_Help
-Parameters
-SubItems
-Inter-cheatsheet navigation
-Opening non-existing file
-
-Steps for the above test cheat sheets:
-1. Start a Run-time Workbench
-2. Select "Cheat Sheets..." from the "Help" menu
-3. Pick one of the test cheat sheets from the "Tests" category
-4. There are number of sub tests that can be run:
- 4.1 Cheat sheet not started yet:
- 4.1.1 Restart the workbench with the cheat sheet open
- 4.1.2 Close the view and reopen the same cheat sheet
- 4.1.3 Switch to a different cheat sheet with the same view and then switch back
- 4.2 Cheat sheet started:
- 4.2.1 Restart the workbench with the cheat sheet open
- 4.2.2 Close the view and reopen the same cheat sheet
- 4.2.3 Switch to a different cheat sheet with the same view and then switch back
- 4.2.4 Restart the cheat sheet
- 4.3 Cheat sheet completed:
- 4.3.1 Restart the workbench with the cheat sheet open
- 4.3.2 Close the view and reopen the same cheat sheet
- 4.3.3 Switch to a different cheat sheet with the same view and then switch back
-
-
-
-DynamicSubItems
-
-Steps for the DynamicSubItems cheat sheet:
-1. Details to come
-
-
-Steps for testing opening with an invalid cheat sheet id:
-1. Opening cheat sheet with an invalid ID
-2. Start a Run-time Workbench
-3. Select the "Test opening with an invalid id" menu item from the "Cheat Sheet Tests"
-
-
-CheatSheetViewer
-
-Steps for the CheatSheetViewer cheat sheet:
-1. Start a Run-time Workbench
-2. Show the "CheatSheetViewer Test" view from "Cheat Sheet Tests" category
-3. Verify that the cheat sheet is display and functioning
-4. Close the view and reopen it to test the method order of createPartControl and setInput
-
-
-Parser
-
-Steps for the Parser cheat sheet:
-1. Start a Run-time Workbench
-2. Create a Simple project
-3. Copy the cheatsheets/tests/parser folder into the project
-4. Select all the cheat sheet XML files just pasted into the project
-5. Right click to bring up the popup menu
-6. Select the "Test CheatSheet Parsing > Test Parsing" action item
-7. The results will be displayed in the Console
-
-Note: The files are named according to the test they perform.
-
-
-Opening a cheat sheet from a URL
-
-Steps for testing opening a cheat sheet from a URL :
-1. To test opening a URL, one needs to have 2 Run-time Workbench running at the same time
-2. Start the first Run-time Workbench which we will call the cheat sheet workbench
-3. Start the second Run-time Workbench which we will call the web app workbench
-4. In the web app workbench select the "Start WebApp" menu item from the "Cheat Sheet Tests"
-5. This will start the web app that will server a cheat sheet via http
-6. When the web app starts it outputs the URL to use to access the cheat sheet to the console
-7. Copy the URL to the clipboard
-8. In the cheat sheet workbench select the "Test opening from a URL" menu item from the "Cheat Sheet Tests"
-9. When the dialog appears, paste the URL into the text field and press OK
-10. Exit the cheat sheet by either changing the to another cheat sheet or closing the view
-11. In the cheat sheet workbench select the "Test opening from a URL" menu item from the "Cheat Sheet Tests"
-12. When the dialog appears, paste the URL into the text field and press OK
-13. Now start the cheat sheet using the "Click to Begin" button
-14. Exit the cheat sheet workbench with the cheat sheet still open
-15. Start the cheat sheet workbench again and the cheat sheet should reopen the cheat sheet from the memento which points to the URL based cheat sheet
-
-
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/CustomizeAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/CustomizeAction.java
deleted file mode 100644
index ce1de35e4..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/CustomizeAction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.cheatsheets.*;
-import org.eclipse.ui.examples.cheatsheets.pattern.dialogs.CustomizePatternDialog;
-
-/**
- * Our sample action implements workbench action delegate.
- * The action proxy will be created by the workbench and
- * shown in the UI. When the user tries to use the action,
- * this delegate will be created and execution will be
- * delegated to it.
- * @see IWorkbenchWindowActionDelegate
- */
-public class CustomizeAction extends Action implements IWorkbenchWindowActionDelegate, ICheatSheetAction {
- private IWorkbenchWindow window;
- private ICheatSheetManager csmanager;
- /**
- * The constructor.
- */
- public CustomizeAction() {
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- run();
- }
-
- public void run(){
- try {
-// IWorkbench workbench = PlatformUI.getWorkbench();
-// IStructuredSelection selection = new StructuredSelection();
- Shell shell = Display.getCurrent().getActiveShell();
- CustomizePatternDialog p = new CustomizePatternDialog(shell);
- p.setCSM(csmanager);
- p.create();
- p.open();
- } catch(Exception e) {
-
- }
- }
-
- public void run(String[] params, ICheatSheetManager csm){
- csmanager = csm;
- run();
- }
-
- /**
- * Selection in the workbench has been changed. We
- * can change the state of the 'real' action here
- * if we want, but this can only happen after
- * the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * We can use this method to dispose of any system
- * resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- this.window = window;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionI.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionI.java
deleted file mode 100644
index 238c682aa..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionI.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
-import org.eclipse.ui.forms.events.*;
-import org.eclipse.ui.forms.widgets.*;
-import org.eclipse.ui.tests.cheatsheets.CheatSheetTestPlugin;
-
-public class ExtensionActionI extends AbstractItemExtensionElement {
-
- private Image helpImage;
- private FormToolkit toolkit;
-
- /**
- * @param attributeName
- */
- public ExtensionActionI(String attributeName) {
- super(attributeName);
- }
-
- protected ImageHyperlink createButton(Composite parent, Image image, Color color, String toolTipText) {
- ImageHyperlink button = new ImageHyperlink(parent, SWT.NULL);
- toolkit.adapt(button, true, true);
- button.setImage(image);
- button.setBackground(color);
- button.setToolTipText(toolTipText);
-
- return button;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite c) {
- System.out.println("ADDING STUFF TO COMPOSITE!!!"); //$NON-NLS-1$
-
- toolkit = new FormToolkit(c.getDisplay());
-
- String imageFileName = "icons/sample.gif"; //$NON-NLS-1$
- URL imageURL = CheatSheetTestPlugin.getDefault().find(new Path(imageFileName));
- ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL);
- helpImage = imageDescriptor.createImage();
-
- ImageHyperlink helpButton = createButton(c, helpImage, c.getBackground(), "Button I"); //$NON-NLS-1$
- helpButton.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- System.out.println("Button I Pressed!!!");//$NON-NLS-1$
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#handleAttribute(java.lang.String)
- */
- public void handleAttribute(String attributeValue) {
- System.out.println("HANDLING ATTRIBUTE: "+attributeValue); //$NON-NLS-1$
- return;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#dispose()
- */
- public void dispose() {
- if(helpImage != null)
- helpImage.dispose();
-
- if(toolkit != null)
- toolkit.dispose();
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionII.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionII.java
deleted file mode 100644
index fbd514d9f..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionII.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
-import org.eclipse.ui.forms.events.*;
-import org.eclipse.ui.forms.widgets.*;
-import org.eclipse.ui.tests.cheatsheets.CheatSheetTestPlugin;
-
-public class ExtensionActionII extends AbstractItemExtensionElement {
-
- private Image helpImage;
- private FormToolkit toolkit;
-
- /**
- * @param attributeName
- */
- public ExtensionActionII(String attributeName) {
- super(attributeName);
- }
-
- protected ImageHyperlink createButton(Composite parent, Image image, Color color, String toolTipText) {
- ImageHyperlink button = new ImageHyperlink(parent, SWT.NULL);
- toolkit.adapt(button, true, true);
- button.setImage(image);
- button.setBackground(color);
- button.setToolTipText(toolTipText);
-
- return button;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite c) {
- System.out.println("ADDING STUFF TO COMPOSITE!!!"); //$NON-NLS-1$
-
- toolkit = new FormToolkit(c.getDisplay());
-
- String imageFileName = "icons/sample2.gif"; //$NON-NLS-1$
- URL imageURL = CheatSheetTestPlugin.getDefault().find(new Path(imageFileName));
- ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL);
- helpImage = imageDescriptor.createImage();
-
- ImageHyperlink helpButton = createButton(c, helpImage, c.getBackground(), "Button II"); //$NON-NLS-1$
- helpButton.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- System.out.println("Button II Pressed!!!");//$NON-NLS-1$
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#handleAttribute(java.lang.String)
- */
- public void handleAttribute(String attributeValue) {
- System.out.println("HANDLING ATTRIBUTE: "+attributeValue); //$NON-NLS-1$
- return;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.AbstractItemExtensionElement#dispose()
- */
- public void dispose() {
- if(helpImage != null)
- helpImage.dispose();
-
- if(toolkit != null)
- toolkit.dispose();
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/LaunchPatternSelectionDialogAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/LaunchPatternSelectionDialogAction.java
deleted file mode 100644
index 8596dcc52..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/LaunchPatternSelectionDialogAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.cheatsheets.*;
-import org.eclipse.ui.examples.cheatsheets.pattern.dialogs.PatternSelectionDialog;
-
-public class LaunchPatternSelectionDialogAction extends Action implements ICheatSheetAction {
- private ICheatSheetManager csmanager;
- /**
- * The constructor.
- */
- public LaunchPatternSelectionDialogAction() {
- }
-
- public void run(String[] s, ICheatSheetManager csm){
- csmanager = csm;
-
- try {
- Shell shell = Display.getCurrent().getActiveShell();
- PatternSelectionDialog p = new PatternSelectionDialog(shell);
- p.setCSM(csmanager);
- p.create();
- p.open();
- } catch(Exception e) {
-
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenClassNameFilledAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenClassNameFilledAction.java
deleted file mode 100644
index aac96798a..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenClassNameFilledAction.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard;
-import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.cheatsheets.*;
-import org.eclipse.ui.cheatsheets.ICheatSheetAction;
-
-
-public class OpenClassNameFilledAction extends Action implements ICheatSheetAction {
- private ICheatSheetManager csmanager;
- private String className;
- private String projectName;
-
- /**
- * Create a new <code>OpenFileImportWizard</code> action.
- */
- public OpenClassNameFilledAction() {
-
- }
-
- public void run() {
- boolean extendBase = false;
- try {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IStructuredSelection psel = null;
- if (projectName != null) {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (p != null)
- psel = new StructuredSelection(p);
- }
-
- IStructuredSelection selection = null;
- // ISelection s = workbench.getActiveWorkbenchWindow().getSelectionService().getSelection();
-
- if (psel != null)
- selection = psel;
- else
- selection = new StructuredSelection();
-
- NewClassCreationWizard classWizard = new NewClassCreationWizard();
- classWizard.init(workbench, selection);
-
- Shell shell = Display.getCurrent().getActiveShell();
- WizardDialog wizardDialog = new WizardDialog(shell, classWizard);
- wizardDialog.create();
-
- IWizardPage[] pages = classWizard.getPages();
-
-
- String values = csmanager.getData("files"); //$NON-NLS-1$
-
- StringTokenizer tokenizer = new StringTokenizer(values, ",");
- String[] files = new String[tokenizer.countTokens()];
- for(int i = 0; tokenizer.hasMoreTokens(); i++) {
- files[i] = tokenizer.nextToken();
- }
- String baseClassName = null;
- String derived = null;
- String secondderived = null;
- if(files.length == 4) {
- baseClassName = files[1];
- derived = files[2];
- secondderived = files[3];
- }
-
-
-
- if (className != null){
- if(className.equals(derived) || //$NON-NLS-1$
- className.equals(secondderived)){//$NON-NLS-1$
- extendBase = true;
- }
- }else {
- className = "NewClass"; //$NON-NLS-1$
- }
-
- if (pages[0] instanceof NewClassWizardPage) {
- NewClassWizardPage page1 = (NewClassWizardPage) pages[0];
- page1.setTypeName(className, true);
- page1.setMethodStubSelection(false, false, false, false);
- if(extendBase){
- page1.setSuperClass(baseClassName, false); //$NON-NLS-1$
- }
- }
-
- wizardDialog.open();
-
- PatternGenerator.generate(csmanager);
- } catch (Exception e) {
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager)
- */
- public void run(String[] params, ICheatSheetManager csm) {
- csmanager = csm;
- if (params != null && !(params.length < 2))
- if (params[0] != null)
- className = params[0];
- if (params[1] != null)
- projectName = params[1];
- run();
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaClassWizardWithMain.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaClassWizardWithMain.java
deleted file mode 100644
index 689e1e26e..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaClassWizardWithMain.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard;
-import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.IWorkbench;
-
-public class OpenJavaClassWizardWithMain extends Action {
-
- public OpenJavaClassWizardWithMain() {
- super();
-
- }
-
- public OpenJavaClassWizardWithMain(String text) {
- super(text);
-
- }
-
- public OpenJavaClassWizardWithMain(String text, ImageDescriptor image) {
- super(text, image);
-
- }
-
- public OpenJavaClassWizardWithMain(String text, int style) {
- super(text, style);
-
- }
-
- public void run() {
- try {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IStructuredSelection selection = new StructuredSelection();
- NewClassCreationWizard classWizard = new NewClassCreationWizard();
- classWizard.init(workbench, selection);
-
- Shell shell = Display.getCurrent().getActiveShell();
- WizardDialog wizardDialog = new WizardDialog(shell, classWizard);
- wizardDialog.create();
-
- IWizardPage[] pages = classWizard.getPages();
- String className = "HelloWorld"; //$NON-NLS-1$
-
- if (pages[0] instanceof NewClassWizardPage) {
- NewClassWizardPage page1 = (NewClassWizardPage) pages[0];
- page1.setTypeName(className, true);
- page1.setMethodStubSelection(true, false,false,true);
- }
-
- int result = wizardDialog.open();
-
- notifyResult(result == Window.OK ? true : false);
- } catch (Exception e) {
-
- }
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaProjectWizard.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaProjectWizard.java
deleted file mode 100644
index 6bcca75ba..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaProjectWizard.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.jdt.internal.ui.wizards.JavaProjectWizard;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-
-public class OpenJavaProjectWizard extends Action {
-
- public OpenJavaProjectWizard() {
- super();
- }
-
- public OpenJavaProjectWizard(String text) {
- super(text);
- }
-
- public OpenJavaProjectWizard(String text, ImageDescriptor image) {
- super(text, image);
- }
-
- public OpenJavaProjectWizard(String text, int style) {
- super(text, style);
- }
-
- public void run() {
- try {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IStructuredSelection selection = new StructuredSelection();
- JavaProjectWizard projectWizard = new JavaProjectWizard();
- projectWizard.init(workbench, selection);
-
- Shell shell = Display.getCurrent().getActiveShell();
- WizardDialog wizardDialog = new WizardDialog(shell, projectWizard);
- wizardDialog.create();
- int result = wizardDialog.open();
-
- notifyResult(result == Window.OK ? true : false);
- } catch (Exception e) {
- }
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenNewJavaProjectWizardWithNameAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenNewJavaProjectWizardWithNameAction.java
deleted file mode 100644
index cdb30b59e..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenNewJavaProjectWizardWithNameAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.cheatsheets.*;
-import org.eclipse.ui.examples.cheatsheets.pattern.wizards.MyProjectCreationWizard;
-
-public class OpenNewJavaProjectWizardWithNameAction extends Action implements ICheatSheetAction {
- private ICheatSheetManager csmanager;
-
- /**
- * Create a new <code>OpenFileImportWizard</code> action.
- */
- public OpenNewJavaProjectWizardWithNameAction() {
- }
-
- public void run() {
- try {
- IWorkbench workbench = PlatformUI.getWorkbench();
-
- IStructuredSelection selection = new StructuredSelection();
-
- MyProjectCreationWizard projectWizard = new MyProjectCreationWizard(csmanager);
- projectWizard.init(workbench, selection);
-
- Shell shell = Display.getCurrent().getActiveShell();
- WizardDialog wizardDialog = new WizardDialog(shell, projectWizard);
-
- wizardDialog.create();
-
- wizardDialog.open();
-
- } catch (Exception e) {
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.ICheatsheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatsheetManager)
- */
- public void run(String[] params, ICheatSheetManager csm) {
- csmanager = csm;
- run();
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/PatternGenerator.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/PatternGenerator.java
deleted file mode 100644
index 87dec4cf9..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/PatternGenerator.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.ui.cheatsheets.*;
-
-public class PatternGenerator {
-
-
- private static IType findType(IJavaProject project, String typeName) throws JavaModelException {
- if (project.exists()) {
- return project.findType(typeName);
- }
- return null;
- }
-
- public static void generate(ICheatSheetManager csm) {
- String project = csm.getData("project"); //$NON-NLS-1$
- String pattern = csm.getData("pattern"); //$NON-NLS-1$
- String thisValue = csm.getData("this"); //$NON-NLS-1$
- String values = csm.getData("files"); //$NON-NLS-1$
-
- StringTokenizer tokenizer = new StringTokenizer(values, ",");
- String[] files = new String[tokenizer.countTokens()];
- for(int i = 0; tokenizer.hasMoreTokens(); i++) {
- files[i] = tokenizer.nextToken();
- }
-
- if (project == null)
- return;
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject wproject = workspace.getRoot().getProject(project);
- IJavaProject jproject = JavaCore.create(wproject);
-
- if (pattern != null && pattern.equals("Factory")) //$NON-NLS-1$
- handleFactoryFileAutomation(pattern, csm, jproject, thisValue, files);
- else if (pattern != null && pattern.equals("Singleton")) //$NON-NLS-1$
- handleSingletonFileAutomation(pattern, csm, jproject, thisValue, files);
- else if (pattern != null && pattern.equals("Visitor")) //$NON-NLS-1$
- handleVisitorFileAutomation(pattern, csm, jproject, thisValue, files);
- }
-
- private static void handleSingletonFileAutomation(String pattern, ICheatSheetManager csm, IJavaProject jproject, String thisValue, String[] files) {
- IType mytype = null;
- String singletonClassName = files[0];
- if (singletonClassName == null)
- return;
-
- if (thisValue != null) {
- if (thisValue.equals(singletonClassName)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, singletonClassName);
- StringBuffer sb = new StringBuffer();
- sb.append("public static synchronized "); //$NON-NLS-1$
- sb.append(singletonClassName + " getInstance () {"); //$NON-NLS-1$
- sb.append("\n\t if(instance == null)\n\t\t instance = new " + singletonClassName + "();"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n\t return instance;"); //$NON-NLS-1$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
-
- sb = new StringBuffer();
- sb.append("public void print(String s) {\n\t System.out.println(s);\n}\n"); //$NON-NLS-1$
- mytype.createMethod(sb.toString(), null, false, null);
-
- sb = new StringBuffer();
- sb.append("private static " + singletonClassName + " instance;\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
- mytype.createField(sb.toString(), null, false, null);
-
- } catch (Exception je) {
- }
-
- }
- } else {
- try {
- mytype = findType(jproject, "TestPattern"); //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- sb.append("public static "); //$NON-NLS-1$
- sb.append("void main (String[] args) {"); //$NON-NLS-1$
- sb.append("\n\t" + singletonClassName + " singleInstance = " + singletonClassName + ".getInstance();"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append("\n\t singleInstance.print(\"Printed by the single instance.\");"); //$NON-NLS-1$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- }
-
- }
- private static void handleVisitorFileAutomation(String pattern, ICheatSheetManager csm, IJavaProject jproject, String thisValue, String[] files) {
- IType mytype = null;
- String visitorClassName = files[0];
- if (visitorClassName == null)
- return;
- String classToVisitClassName = files[1];
- if (classToVisitClassName == null)
- return;
-
- if (thisValue != null) {
- if (thisValue.equals(visitorClassName)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, visitorClassName);
- StringBuffer sb = new StringBuffer();
- sb.append("public void visit (" + classToVisitClassName + " v) {"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n\t System.out.println(\"Visiting ....\");"); //$NON-NLS-1$
- sb.append("\n\t System.out.println(v.getString());"); //$NON-NLS-1$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
-
- }
-
- if (thisValue.equals(classToVisitClassName)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, classToVisitClassName);
- StringBuffer sb = new StringBuffer();
- sb.append("public void accept (" + visitorClassName + " v) {"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n\t v.visit(this);"); //$NON-NLS-1$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
-
- sb = new StringBuffer();
- sb.append("public String visitString = \"This is the String in the class to visit!\";\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createField(sb.toString(), null, false, null);
-
- sb = new StringBuffer();
- sb.append("public String getString() { \n\t return visitString; \n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
-
- } catch (Exception je) {
- }
- }
- } else {
- try {
- mytype = findType(jproject, "TestPattern"); //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- sb.append("public static "); //$NON-NLS-1$
- sb.append("void main (String[] args) {"); //$NON-NLS-1$
- sb.append("\n\t" + visitorClassName + " visitor = new " + visitorClassName + "();"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append("\n\t" + classToVisitClassName + " objectToVisit = new " + classToVisitClassName + "();"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append("\n\t objectToVisit.accept(visitor);"); //$NON-NLS-1$
-
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- }
-
- }
- private static void handleFactoryFileAutomation(String pattern, ICheatSheetManager csm, IJavaProject jproject, String thisValue, String[] files) {
-
- IType mytype = null;
- String factoryClassName = files[0];
- if (factoryClassName == null)
- return;
- String baseClassName = files[1];
- String derived = files[2];
- String secondderived = files[3];
-
- if (baseClassName == null || derived == null || secondderived == null)
- return;
-
- if (jproject instanceof IJavaProject) {
- if (baseClassName.equals(thisValue)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, baseClassName);
- StringBuffer sb = new StringBuffer();
- sb.append("public "); //$NON-NLS-1$
- sb.append("void printObjectType () {"); //$NON-NLS-1$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- } else if (derived.equals(thisValue)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, derived);
- StringBuffer sb = new StringBuffer();
- sb.append("public "); //$NON-NLS-1$
- sb.append("void printObjectType () {"); //$NON-NLS-1$
- sb.append("\n\tSystem.out.println(\"Type is: " + derived + "\");\n}\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- } else if (secondderived.equals(thisValue)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, secondderived);
- StringBuffer sb = new StringBuffer();
- sb.append("public "); //$NON-NLS-1$
- sb.append("void printObjectType () {"); //$NON-NLS-1$
- sb.append("\n\tSystem.out.println(\"Type is: " + secondderived + "\");\n}\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- } else if (factoryClassName.equals(thisValue)) { //$NON-NLS-1$
- try {
- mytype = findType(jproject, factoryClassName);
- StringBuffer sb = new StringBuffer();
- sb.append("public "); //$NON-NLS-1$
- sb.append(baseClassName + " getObjectFromFactory (String derivedTypeIndicator) {"); //$NON-NLS-1$
- sb.append("\n\t if(derivedTypeIndicator.equals(\"baseOne\"))\n\t return new " + derived + "();"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n\t if(derivedTypeIndicator.equals(\"baseTwo\"))\n\t return new " + secondderived + "();"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n\t else\n\t return new " + baseClassName + "();"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- } else { //$NON-NLS-1$
- try {
- mytype = findType(jproject, "TestPattern"); //$NON-NLS-1$ //$NON-NLS-2$
- StringBuffer sb = new StringBuffer();
- sb.append("public static "); //$NON-NLS-1$
- sb.append("void main (String[] args) {"); //$NON-NLS-1$
- sb.append("\n\t" + factoryClassName + " factory = new " + factoryClassName + "();"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append("\n\tSystem.out.println(\"First Type From Factory: \");\n\t factory.getObjectFromFactory(\"baseOne\").printObjectType();\n"); //$NON-NLS-1$
- sb.append("\tSystem.out.println(\"Second Type From Factory: \");\n\t factory.getObjectFromFactory(\"baseTwo\").printObjectType();\n}\n\n"); //$NON-NLS-1$
- if (mytype != null)
- mytype.createMethod(sb.toString(), null, false, null);
- } catch (Exception je) {
- }
- }
- }
-
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/SingletonCustomizeAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/SingletonCustomizeAction.java
deleted file mode 100644
index 5f83f332a..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/SingletonCustomizeAction.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.actions;
-
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
-
-public class SingletonCustomizeAction extends CustomizeAction {
- public void run(String[] params, ICheatSheetManager csm) {
- System.out.println("In SingletonCustomizeAction");
- super.run(params, csm);
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/CustomizePatternDialog.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/CustomizePatternDialog.java
deleted file mode 100644
index c45aa85c3..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/CustomizePatternDialog.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.cheatsheets.*;
-
-public class CustomizePatternDialog extends Dialog {
- private ICheatSheetManager csmanager;
- private Text t1;
- private Text t2;
- private Text t3;
- private Text t4;
- private Text t5;
- private String pname;
- private String cname;
- /**
- * @param parentShell
- */
- public CustomizePatternDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout g = new GridLayout();
- g.numColumns = 1;
- composite.setLayout(g);
-
- Composite descComposite = new Composite(composite, SWT.NULL);
- GridLayout dg = new GridLayout();
- dg.numColumns = 1;
- descComposite.setLayout(dg);
-
- Composite bComposite = new Composite(composite, SWT.NULL);
- GridLayout bg = new GridLayout(2, false);
- bComposite.setLayout(bg);
-
- Label dl = new Label(descComposite, SWT.NULL);
- String data = null;
- if (csmanager != null)
- data = csmanager.getData("pattern");//$NON-NLS-1$
- if (data != null) {
- dl.setText("Customize your " + data + " pattern.");//$NON-NLS-1$//$NON-NLS-2$
- if (data.equals("Singleton"))//$NON-NLS-1$
- addSingletonStuff(bComposite);
- else if (data.equals("Visitor"))//$NON-NLS-1$
- addVisitorStuff(bComposite);
- else if (data.equals("Factory"))//$NON-NLS-1$
- addFactoryStuff(bComposite);
- } else
- dl.setText("Customize your pattern.");//$NON-NLS-1$
-
- return composite;
- }
-
- private void addSingletonStuff(Composite c) {
- Label l = new Label(c, SWT.NULL);
- l.setText("Java Project Name:");//$NON-NLS-1$
- t1 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Singleton Class Name:");//$NON-NLS-1$
- t2 = new Text(c, SWT.BORDER);
- }
-
- public void addFactoryStuff(Composite c) {
- Label l = new Label(c, SWT.NULL);
- l.setText("Java Project Name:");//$NON-NLS-1$
- t1 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Factory Class Name:");//$NON-NLS-1$
- t2 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Base Derived Class Name:");//$NON-NLS-1$
- t3 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("First Derived Class Name:");//$NON-NLS-1$
- t4 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Second Derived Class Name:");//$NON-NLS-1$
- t5 = new Text(c, SWT.BORDER);
- }
-
- public void addVisitorStuff(Composite c) {
-
- Label l = new Label(c, SWT.NULL);
- l.setText("Java Project Name:");//$NON-NLS-1$
- t1 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Visitor Class Name:");//$NON-NLS-1$
- t2 = new Text(c, SWT.BORDER);
-
- l = new Label(c, SWT.NULL);
- l.setText("Class to visit Name:");//$NON-NLS-1$
- t3 = new Text(c, SWT.BORDER);
-
- }
-
- protected void okPressed() {
- pname = t1.getText();
- cname = t2.getText();
- csmanager.setData("project", pname);//$NON-NLS-1$
- String pattern = csmanager.getData("pattern");//$NON-NLS-1$
- if (pattern.equals("Factory")) {//$NON-NLS-1$
- StringBuffer buffer = new StringBuffer();
- buffer.append(t2.getText());
- buffer.append(',');
- buffer.append(t3.getText());
- buffer.append(',');
- buffer.append(t4.getText());
- buffer.append(',');
- buffer.append(t5.getText());
-
- csmanager.setData("files", buffer.toString());//$NON-NLS-1$
- } else if (pattern.equals("Visitor")) {//$NON-NLS-1$
- StringBuffer buffer = new StringBuffer();
- buffer.append(t2.getText());
- buffer.append(',');
- buffer.append(t3.getText());
-
- csmanager.setData("files", buffer.toString());//$NON-NLS-1$
- } else if (pattern.equals("Singleton")) {//$NON-NLS-1$
- StringBuffer buffer = new StringBuffer();
- buffer.append(t2.getText());
-
- csmanager.setData("files", buffer.toString());//$NON-NLS-1$
- }
-
- super.okPressed();
- }
-
- public void setCSM(ICheatSheetManager csm) {
- csmanager = csm;
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/PatternSelectionDialog.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/PatternSelectionDialog.java
deleted file mode 100644
index fc38f6428..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/PatternSelectionDialog.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.dialogs;
-
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
-
-
-public class PatternSelectionDialog extends Dialog {
- Button f;
- Button v;
- Button s;
- String selected;
- private static final String factory = "Factory"; //$NON-NLS-1$
- private static final String singleton = "Singleton"; //$NON-NLS-1$
- private static final String visitor = "Visitor"; //$NON-NLS-1$
- private ICheatSheetManager csmanager;
-
- public PatternSelectionDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Pattern Selection"); //$NON-NLS-1$
-
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout g = new GridLayout();
- g.numColumns = 1;
- composite.setLayout(g);
-
- Composite descComposite = new Composite(composite, SWT.NULL);
- GridLayout dg = new GridLayout();
- dg.numColumns = 1;
- descComposite.setLayout(dg);
-
- Composite bComposite = new Composite(composite, SWT.NULL);
- GridLayout bg = new GridLayout(2, false);
- bComposite.setLayout(bg);
-
- Label dl = new Label(descComposite, SWT.NULL);
- dl.setText("Please select a design pattern."); //$NON-NLS-1$
-
- f = new Button(bComposite, SWT.RADIO);
- f.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- selected = factory;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- return;
- }
- }
- );
- Label fl = new Label(bComposite, SWT.NULL);
- fl.setText(factory);
-
- s = new Button(bComposite, SWT.RADIO);
- s.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- selected = singleton;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- return;
- }
- });
- Label sl = new Label(bComposite, SWT.NULL);
- sl.setText(singleton);
-
- v = new Button(bComposite, SWT.RADIO);
- v.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- selected = visitor;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- return;
- }
- });
- Label vl = new Label(bComposite, SWT.NULL);
- vl.setText(visitor);
-
- return composite;
- }
-
- protected void okPressed() {
-
- //System.out.println(selected);
- csmanager.setData("pattern", selected); //$NON-NLS-1$
- super.okPressed();
- }
-
- public void setCSM(ICheatSheetManager csm){
- csmanager = csm;
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/listeners/PatternItemListener.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/listeners/PatternItemListener.java
deleted file mode 100644
index 6ed40942c..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/listeners/PatternItemListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.listeners;
-
-import org.eclipse.ui.cheatsheets.*;
-
-public class PatternItemListener extends CheatSheetListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.cheatsheets.CheatSheetListener#cheatSheetEvent(org.eclipse.ui.cheatsheets.ICheatSheetEvent)
- */
- public void cheatSheetEvent(ICheatSheetEvent event) {
- ICheatSheetManager csm = event.getCheatSheetManager();
- System.out.print("CheatSheetEvent for ");
- System.out.println(event.getCheatSheetID());
- System.out.print("Event type: ");
- System.out.print(event.getEventType());
- System.out.print(" - ");
- switch (event.getEventType()) {
- case ICheatSheetEvent.CHEATSHEET_OPENED :
- System.out.println("OPENED");
- break;
- case ICheatSheetEvent.CHEATSHEET_CLOSED :
- System.out.println("CLOSED");
- break;
- case ICheatSheetEvent.CHEATSHEET_STARTED :
- System.out.println("STARTED");
- break;
- case ICheatSheetEvent.CHEATSHEET_RESTARTED :
- System.out.println("RESTARTED");
- break;
- case ICheatSheetEvent.CHEATSHEET_COMPLETED :
- System.out.println("COMPLETED");
- break;
- case ICheatSheetEvent.CHEATSHEET_RESTORED :
- System.out.println("RESTORED");
- break;
- default :
- System.out.println("UNKNOWN");
- break;
- }
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/wizards/MyProjectCreationWizard.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/wizards/MyProjectCreationWizard.java
deleted file mode 100644
index 6ea71a4ec..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/wizards/MyProjectCreationWizard.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Common Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.ui.examples.cheatsheets.pattern.wizards;
-
-import org.eclipse.jdt.internal.ui.wizards.JavaProjectWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-
-public class MyProjectCreationWizard extends JavaProjectWizard {
- private ICheatSheetManager csmanager;
-
- public MyProjectCreationWizard(ICheatSheetManager csm) {
- super();
- csmanager = csm;
- }
-
- public MyProjectCreationWizard() {
- super();
- }
-
- /*
- * @see Wizard#addPages
- */
- public void addPages() {
- super.addPages();
- IWizardPage[] pagesf = getPages();
- if (pagesf[0] instanceof WizardNewProjectCreationPage) {
- WizardNewProjectCreationPage page1 = (WizardNewProjectCreationPage) pagesf[0];
- String project = csmanager.getData("project"); //$NON-NLS-1$
- if (project == null)
- project = "PatternProject"; //$NON-NLS-1$
- page1.setInitialProjectName(project);
- }
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java
deleted file mode 100644
index f50303ff3..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class NoopAction extends Action {
-
- private static int count;
-
- /**
- * Constructor for NoopAction.
- */
- public NoopAction() {
- super();
- }
-
- /**
- * Constructor for NoopAction.
- * @param text
- */
- public NoopAction(String text) {
- super(text);
- }
-
- /**
- * Constructor for NoopAction.
- * @param text
- * @param image
- */
- public NoopAction(String text, ImageDescriptor image) {
- super(text, image);
- }
-
- public void run() {
- System.out.println("Running NoopAction: "+count++);
- }
-
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetParserAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetParserAction.java
deleted file mode 100644
index efa5628ee..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetParserAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
-
-import java.net.*;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.cheatsheets.data.*;
-
-public class TestCheatSheetParserAction implements IObjectActionDelegate {
- private ISelection selection;
-
- /**
- * Constructor for Action1.
- */
- public TestCheatSheetParserAction() {
- super();
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if(selection != null && selection instanceof IStructuredSelection) {
- for (Iterator iter = ((IStructuredSelection)selection).iterator(); iter.hasNext();) {
- Object obj = iter.next();
-
- System.out.println();
- System.out.println(obj.toString());
-
- if(obj instanceof IFile) {
- IFile selectedFile = (IFile)obj;
-
- System.out.print("About to parse file, ");
- System.out.println(selectedFile.getFullPath().toString());
-
- try {
- CheatSheetParser parser = new CheatSheetParser();
- CheatSheet cheatSheet = parser.parse(new URL("file:/"+selectedFile.getLocation().toOSString()));
- if(cheatSheet == null) {
- System.out.println("FAIL: Parsing of the cheat sheet failed.");
- } else {
- System.out.println("PASS: Parsing of the cheat sheet was successful.");
- }
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetViewerSetInputAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetViewerSetInputAction.java
deleted file mode 100644
index fe803e320..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetViewerSetInputAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.*;
-import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
-
-public class TestCheatSheetViewerSetInputAction implements IWorkbenchWindowActionDelegate {
-
- /* (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) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- OpenCheatSheetAction openCheatSheetAction = new OpenCheatSheetAction("test.cheatsheet.id.does.not.exist");
- openCheatSheetAction.run();
- }
-
- /* (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) {
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestOpeningURL.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestOpeningURL.java
deleted file mode 100644
index d04f8d5b9..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestOpeningURL.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.cheatsheets.OpenCheatSheetAction;
-
-public class TestOpeningURL implements IWorkbenchWindowActionDelegate {
- /* (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) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- try {
- final String[] result = new String[1];
- Dialog enterURLDialog = new Dialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()) {
- private Text urlField;
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout g = new GridLayout(2, false);
- composite.setLayout(g);
-
- Label l = new Label(composite, SWT.NULL);
- l.setText("URL of cheat sheet:");
- urlField = new Text(composite, SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 200;
- urlField.setLayoutData(gd);
-
- return composite;
- }
-
- protected void okPressed() {
- String text = urlField.getText();
- if(text == null || text.length()<=0) {
- result[0] = "";
- super.okPressed();
- } else if(text.substring(0,4).equalsIgnoreCase("http")) {
- result[0] = text;
- super.okPressed();
- } else {
- IStatus status = new Status(IStatus.ERROR, "cheatsheets.test", 0, "Invalid URL, please enter a new URL.", null);
- ErrorDialog.openError(this.getShell(), "Error", null, status);
- }
- }
- };
-
- enterURLDialog.open();
-
- if(result[0] != null && result[0].length()>0) {
- URL url = new URL(result[0]);
- OpenCheatSheetAction openCheatSheetAction = new OpenCheatSheetAction("test.opening.url", "Testing Opening URL", url);
- openCheatSheetAction.run();
- }
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- /* (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) {
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestStartWebApp.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestStartWebApp.java
deleted file mode 100644
index 5b8514d4d..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestStartWebApp.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.actions;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.internal.appserver.WebappManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-public class TestStartWebApp implements IWorkbenchWindowActionDelegate {
- private static String appServerHost = null;
-
- /* (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) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- int appServerPort = 0;
- try {
- Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- if(appServerHost == null) {
- if(MessageDialog.openQuestion(parent, "Web App", "Web application for cheat sheet testing is not started for this Run-time Workbench. Would you like to start it now?")) {
- WebappManager.start("cheatsheets.test", "org.eclipse.ui.tests.cheatsheets", new Path("cheatsheets/tests/webapp"));
- } else {
- return;
- }
- } else {
- MessageDialog.openInformation(parent, "Web App", "Web application for cheat sheet testing is already started for this Run-time Workbench.");
- }
-
- appServerHost = WebappManager.getHost();
- appServerPort = WebappManager.getPort();
- System.out.println("host: "+appServerHost);
- System.out.println("port: "+appServerPort);
- System.out.println("http://"+appServerHost+":"+appServerPort+"/cheatsheets.test/TestOpeningURL.xml");
- } catch(CoreException e) {
- e.printStackTrace();
- }
- }
-
- /* (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) {
- }
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/DisplayDataDialog.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/DisplayDataDialog.java
deleted file mode 100644
index 4e78c2c79..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/DisplayDataDialog.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.parameters;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
-
-
-public class DisplayDataDialog extends Dialog {
-
- private ICheatSheetManager csmanager;
- private String[] parameters;
-
-
- public DisplayDataDialog(Shell parentShell, ICheatSheetManager csm, String[] parameters) {
- super(parentShell);
- csmanager = csm;
- this.parameters = parameters;
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Data Analysis"); //$NON-NLS-1$
-
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout g = new GridLayout();
- g.numColumns = 1;
- composite.setLayout(g);
-
- Composite descComposite = new Composite(composite, SWT.NULL);
- GridLayout dg = new GridLayout();
- dg.numColumns = 1;
- descComposite.setLayout(dg);
-
- Label dl = new Label(descComposite, SWT.NULL);
- dl.setText("Result of your data analysis."); //$NON-NLS-1$
-
- Composite bComposite = new Composite(composite, SWT.NULL);
- GridLayout bg = new GridLayout(1, false);
- bComposite.setLayout(bg);
-
- Label l = new Label(bComposite, SWT.NULL);
- l.setText("Name: " + parameters[1]); //$NON-NLS-1$
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("Favorite color: " + parameters[2]); //$NON-NLS-1$
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("Animal: " + parameters[3]); //$NON-NLS-1$
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("Extra 1: " + parameters[4]); //$NON-NLS-1$
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("Extra 2: " + parameters[5]); //$NON-NLS-1$
-
- return composite;
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDataDialog.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDataDialog.java
deleted file mode 100644
index 8f0987c33..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDataDialog.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.parameters;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.cheatsheets.ICheatSheetManager;
-
-
-public class GatherDataDialog extends Dialog {
- private Text t1;
- private Text t2;
- private Text t3;
-
- private ICheatSheetManager csmanager;
-
-
- public GatherDataDialog(Shell parentShell, ICheatSheetManager csm) {
- super(parentShell);
- csmanager = csm;
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Data Entry"); //$NON-NLS-1$
-
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout g = new GridLayout();
- g.numColumns = 1;
- composite.setLayout(g);
-
- Composite descComposite = new Composite(composite, SWT.NULL);
- GridLayout dg = new GridLayout();
- dg.numColumns = 1;
- descComposite.setLayout(dg);
-
- Label dl = new Label(descComposite, SWT.NULL);
- dl.setText("Enter some data to be analysed."); //$NON-NLS-1$
-
- String data = null;
- if (csmanager != null)
- data = csmanager.getData("pattern"); //$NON-NLS-1$
-
- Composite bComposite = new Composite(composite, SWT.NULL);
- GridLayout bg = new GridLayout(2, false);
- bComposite.setLayout(bg);
-
- Label l = new Label(bComposite, SWT.NULL);
- l.setText("Please enter you name:"); //$NON-NLS-1$
- t1 = new Text(bComposite, SWT.BORDER);
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("What is your favorite color:"); //$NON-NLS-1$
- t2 = new Text(bComposite, SWT.BORDER);
-
- l = new Label(bComposite, SWT.NULL);
- l.setText("Which animal would you most like to own:"); //$NON-NLS-1$
- t3 = new Text(bComposite, SWT.BORDER);
- return composite;
- }
-
- protected void okPressed() {
-
- csmanager.setData("name", t1.getText()); //$NON-NLS-1$
- csmanager.setData("color", t2.getText()); //$NON-NLS-1$
- csmanager.setData("animal", t3.getText()); //$NON-NLS-1$
- super.okPressed();
- }
-
-}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDisplayDataAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDisplayDataAction.java
deleted file mode 100644
index 388ae91d7..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDisplayDataAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.parameters;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.cheatsheets.*;
-
-public class GatherDisplayDataAction extends Action implements ICheatSheetAction {
- private ICheatSheetManager csmanager;
- /**
- * The constructor.
- */
- public GatherDisplayDataAction() {
- }
-
- public void run(String[] s, ICheatSheetManager csm){
- csmanager = csm;
-
- try {
- Shell shell = Display.getCurrent().getActiveShell();
- Dialog dialog = null;
- if(s[0].equals("gather")) {
- dialog = new GatherDataDialog(shell, csmanager);
- } else {
- dialog = new DisplayDataDialog(shell, csmanager, s);
- }
- dialog.create();
- int result = dialog.open();
- notifyResult(result == Window.OK ? true : false);
- } catch(Exception e) {
-
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/views/CheatSheetViewerTestView.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/views/CheatSheetViewerTestView.java
deleted file mode 100644
index 75088efae..000000000
--- a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/views/CheatSheetViewerTestView.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.cheatsheets.views;
-
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.cheatsheets.*;
-import org.eclipse.ui.cheatsheets.ICheatSheetViewer;
-import org.eclipse.ui.part.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.SWT;
-
-
-public class CheatSheetViewerTestView extends ViewPart {
- private ICheatSheetViewer viewer;
- private static boolean switcher = false;
-
- /**
- * The constructor.
- */
- public CheatSheetViewerTestView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- RowLayout rowLayout = new RowLayout ();
- rowLayout.type = SWT.VERTICAL;
- composite.setLayout(rowLayout);
-
- new Label(composite, SWT.NONE).setText("Test of the ICheatSheetviewer.");
- new Label(composite, SWT.NONE).setText("The Simple Java Application cheat sheet should be shown.");
-
- viewer = CheatSheetViewerFactory.createCheatSheetView();
- if(switcher) {
- switcher = !switcher;
- new Label(composite, SWT.NONE);
- new Label(composite, SWT.NONE).setText("Method order:");
- new Label(composite, SWT.NONE).setText("viewer.setInput called first");
- new Label(composite, SWT.NONE).setText("viewer.createPartControl called second");
- new Label(composite, SWT.NONE).setText("Close the view and reopen to reverse the order");
- new Label(composite, SWT.NONE);
- viewer.setInput("org.eclipse.jdt.helloworld");
- viewer.createPartControl(composite);
- } else {
- switcher = !switcher;
- new Label(composite, SWT.NONE);
- new Label(composite, SWT.NONE).setText("Method order:");
- new Label(composite, SWT.NONE).setText("viewer.createPartControl called first");
- new Label(composite, SWT.NONE).setText("viewer.setInput called second");
- new Label(composite, SWT.NONE).setText("Close the view and reopen to reverse the order");
- new Label(composite, SWT.NONE);
- viewer.createPartControl(composite);
- viewer.setInput("org.eclipse.jdt.helloworld");
- }
- viewer.getControl().setLayoutData(new RowData(200, 350));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- }
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- if(viewer != null)
- viewer.setFocus();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ua.tests/test.xml b/org.eclipse.ua.tests/test.xml
new file mode 100644
index 000000000..9d25efa9a
--- /dev/null
+++ b/org.eclipse.ua.tests/test.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+
+<project name="testsuite" default="run" basedir=".">
+ <!-- The property ${eclipse-home} should be passed into this script -->
+ <!-- Set a meaningful default value for when it is not. -->
+ <property name="eclipse-home" value="${basedir}/../.."/>
+
+ <!-- sets the properties eclipse-home, and library-file -->
+ <property name="plugin-name" value="org.eclipse.ua.tests"/>
+ <property name="library-file"
+ value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
+
+ <!-- This target holds all initialization code that needs to be done for -->
+ <!-- all tests that are to be run. Initialization for individual tests -->
+ <!-- should be done within the body of the suite target. -->
+ <target name="init">
+ <tstamp/>
+ <delete>
+ <fileset dir="${eclipse-home}" includes="org*.xml"/>
+ </delete>
+ </target>
+
+ <!-- This target defines the tests that need to be run. -->
+ <target name="suite">
+ <property name="session-folder"
+ value="${eclipse-home}/ui_session_sniff_folder"/>
+ <delete dir="${session-folder}" quiet="true"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${session-folder}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname"
+ value="org.eclipse.ua.tests.AllTests"/>
+ </ant>
+ </target>
+
+ <!-- This target holds code to cleanup the testing environment after -->
+ <!-- after all of the tests have been run. You can use this target to -->
+ <!-- delete temporary files that have been created. -->
+ <target name="cleanup">
+ </target>
+
+ <!-- This target runs the test suite. Any actions that need to happen -->
+ <!-- after all the tests have been run should go here. -->
+ <target name="run" depends="init,suite,cleanup">
+ <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="includes" value="org*.xml"/>
+ <property name="output-file" value="${plugin-name}.xml"/>
+ </ant>
+ </target>
+
+</project>
diff --git a/org.eclipse.ui.cheatsheets/.classpath b/org.eclipse.ui.cheatsheets/.classpath
index 065ac06e1..751c8f2e5 100644
--- a/org.eclipse.ui.cheatsheets/.classpath
+++ b/org.eclipse.ui.cheatsheets/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Back to the top