Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlparsons2004-06-07 19:01:56 +0000
committerlparsons2004-06-07 19:01:56 +0000
commit4af7dab233df3805d97ab4d4a71068d5c702fc50 (patch)
tree45d2c521c2a16703def905cb3434df8b8c3368b0 /org.eclipse.ua.tests
parente51fcfcb0763a94ef3dc7cfe35208a80e792c4b0 (diff)
downloadeclipse.platform.ua-4af7dab233df3805d97ab4d4a71068d5c702fc50.tar.gz
eclipse.platform.ua-4af7dab233df3805d97ab4d4a71068d5c702fc50.tar.xz
eclipse.platform.ua-4af7dab233df3805d97ab4d4a71068d5c702fc50.zip
Initial release of cheat sheet examples and tests
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/.classpath7
-rw-r--r--org.eclipse.ua.tests/.cvsignore1
-rw-r--r--org.eclipse.ua.tests/.project42
-rw-r--r--org.eclipse.ua.tests/build.properties4
-rw-r--r--org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml70
-rw-r--r--org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml72
-rw-r--r--org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml64
-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/TestActions.xml145
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml41
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml52
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml379
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml67
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml39
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml82
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml21
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml24
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml19
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml19
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml21
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml21
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml21
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml16
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml21
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml16
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml16
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml46
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml47
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml46
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml19
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml17
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml17
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml20
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml27
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml23
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml14
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml11
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml17
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml23
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml23
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml14
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml16
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml10
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml17
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml31
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml32
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml19
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml31
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml26
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml27
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml19
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml26
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml18
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml20
-rw-r--r--org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml18
-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/cheatsheets/tests/webapp/TestOpeningURL.xml17
-rw-r--r--org.eclipse.ua.tests/contexts.xml9
-rw-r--r--org.eclipse.ua.tests/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--org.eclipse.ua.tests/icons/sample2.gifbin0 -> 346 bytes
-rw-r--r--org.eclipse.ua.tests/plugin.xml269
-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/FactoryCustomizeAction.java20
-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/actions/VisitorCustomizeAction.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/CheatSheetTestPlugin.java33
-rw-r--r--org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java38
-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
91 files changed, 4593 insertions, 0 deletions
diff --git a/org.eclipse.ua.tests/.classpath b/org.eclipse.ua.tests/.classpath
new file mode 100644
index 000000000..065ac06e1
--- /dev/null
+++ b/org.eclipse.ua.tests/.classpath
@@ -0,0 +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="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.ua.tests/.cvsignore b/org.eclipse.ua.tests/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/org.eclipse.ua.tests/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/org.eclipse.ua.tests/.project b/org.eclipse.ua.tests/.project
new file mode 100644
index 000000000..05cdc6d1f
--- /dev/null
+++ b/org.eclipse.ua.tests/.project
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ui.tests.cheatsheets</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>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.ua.tests/build.properties b/org.eclipse.ua.tests/build.properties
new file mode 100644
index 000000000..6a2157729
--- /dev/null
+++ b/org.eclipse.ua.tests/build.properties
@@ -0,0 +1,4 @@
+bin.includes = plugin.xml,\
+ *.jar,\
+ cheatsheetTests.jar
+source.cheatsheetTests.jar = src/
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml
new file mode 100644
index 000000000..d8b63afc9
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorld.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Hello World Demo">
+
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+Welcome to the <b>hello world</b> cheat sheet.<br/>
+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.<br/>
+Let's get started!
+ </description>
+</intro>
+
+ <item
+ href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ 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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
+ title="Create a java project"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"/>
+ <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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
+ title="Create your HelloWorld class">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
+ <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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ 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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ 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!
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml
new file mode 100644
index 000000000..0ed357fef
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithExtensions.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Hello World Demo with Extensions">
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <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!
+ </description>
+</intro>
+
+ <item
+ href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ title="Open the Java Perspective"
+ actionI="ok"
+ actionII="actionII">
+ <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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
+ title="Create a java project"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaProjectWizard"/>
+ <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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
+ title="Create your HelloWorld class">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
+ <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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ 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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ title="Test your application"
+ actionII="skate">
+ <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!
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml
new file mode 100644
index 000000000..d3ab30456
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/examples/part1/HelloWorldWithSubitems.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Hello World Demo with Subitems">
+
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <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!
+ </description>
+</intro>
+
+ <item
+ href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ 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.
+ </description>
+</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.
+ </description>
+ <subitem
+ label="Create a java project"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ 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"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.OpenJavaClassWizardWithMain"/>
+ </subitem>
+ </item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/tasks/tasks-54.htm"
+ 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.
+ </description>
+</item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ 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!
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml b/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml
new file mode 100644
index 000000000..25db7efcf
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheet.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Java Pattern Demo">
+
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.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
new file mode 100644
index 000000000..3d6d2e5ea
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/examples/part2/PatternSheetUsingConditionalSubItem.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Java Pattern Demo">
+
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.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/TestActions.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestActions.xml
new file mode 100644
index 000000000..cd1adeca6
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestActions.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<cheatsheet title="Test Actions">
+
+<intro>
+ <description>
+Welcome to the Test Actions cheat sheet.
+This cheat sheet will test the various setting combinations for actions.
+Let's get started!
+ </description>
+</intro>
+
+<item
+ title="Test 1">
+ <description>
+ Test with no action.
+ </description>
+</item>
+
+<item
+ title="Test 2"
+ skip="false">
+ <description>
+ Test with no action and skip=false.
+ </description>
+</item>
+
+<item
+ title="Test 3"
+ skip="true">
+ <description>
+ Test with no action and skip=true.
+ </description>
+</item>
+
+<item
+ title="Test 4">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ <description>
+ Test with action.
+ </description>
+</item>
+
+<item
+ title="Test 5"
+ skip="false">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ <description>
+ Test with action and skip=false.
+ </description>
+</item>
+
+<item
+ title="Test 6"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ <description>
+ Test action and skip=true.
+ </description>
+</item>
+
+<item
+ title="Test 7">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="false"/>
+ <description>
+ Test action and confirm=false.
+ </description>
+</item>
+
+<item
+ title="Test 8">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="true"/>
+ <description>
+ Test action and confirm=true.
+ </description>
+</item>
+
+<item
+ title="Test 9"
+ skip="false">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="false"/>
+ <description>
+ Test action, skip=false and confirm=false.
+ </description>
+</item>
+
+<item
+ title="Test 10"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="false"/>
+ <description>
+ Test action, skip=true and confirm=false.
+ </description>
+</item>
+
+<item
+ title="Test 11"
+ skip="false">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="true"/>
+ <description>
+ Test action, skip=false and confirm=true.
+ </description>
+</item>
+
+<item
+ title="Test 12"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"
+ confirm="true"/>
+ <description>
+ Test action, skip=true and confirm=true.
+ </description>
+</item>
+
+<item
+ title="All done!">
+ <description>
+ Did the test work?
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml
new file mode 100644
index 000000000..1aae96b5a
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestCSActions.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<cheatsheet title="Hello World Demo">
+ <intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <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!
+ </description>
+</intro>
+ <item id="0"
+ href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ 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.
+ </description>
+</item>
+ <item id="1"
+ title="Select a cheat sheet"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.cheatsheets"
+ class="org.eclipse.ui.internal.cheatsheets.actions.CheatSheetCategoryBasedSelectionAction"/>
+ <description>
+ Test launching category based cheat sheet selection.
+ </description>
+ </item>
+ <item id="2"
+ title="Select a cheat sheet in another way"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.cheatsheets"
+ class="org.eclipse.ui.internal.cheatsheets.actions.CheatSheetSelectionAction"/>
+ <description>
+ Test launching single list cheat sheet selection.
+ </description>
+ </item>
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml
new file mode 100644
index 000000000..3220b0e8d
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestDescriptionFormatting.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Testing Infopop and Help Links">
+
+<intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+This cheat sheet will test infopop and help link.
+Let's get started!
+ </description>
+</intro>
+
+<item title="Item with simple text">
+<description>
+Some simple text to test the decription formating.
+</description>
+</item>
+
+<item title="Item with a line break"><description>
+Line one
+<br/>
+Line two with a special &lt; char in the middle.
+</description></item>
+
+<item title="Item with all the special charaters"><description>
+&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/>
+</description></item>
+
+<item title="Item with one less than"><description><b>&lt;</b></description></item>
+<item title="Item with one greater than"><description>&gt;</description></item>
+<item title="Item with one bold less than"><description><b>&lt;</b></description></item>
+<item title="Item with one bold greater than"><description><b>&gt;</b></description></item>
+<item title="Item with one less than before a break"><description>&lt;<br/></description></item>
+<item title="Item with one less than after a break"><description><br/>&lt;</description></item>
+<item title="Item with one less than between breaks"><description><br/>&lt;<br/></description></item>
+<item title="Item with one greater than before a break"><description>&gt;<br/></description></item>
+<item title="Item with one greater than after a break"><description><br/>&gt;</description></item>
+<item title="Item with one greater than between breaks"><description><br/>&gt;<br/></description></item>
+
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml
new file mode 100644
index 000000000..3fd13f5a7
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestDynamicSubItems.xml
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Testing SubItems">
+
+<intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+This cheat sheet will test subitems.
+Let's get started!
+ </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>
+
+<!--
+Run the cheat once with the following 2 items commented out. Work through the cheat sheet
+until the second "Customize your pattern" item. Exit the cheat sheet and uncomment the items
+to test the error page during the restoration of saved state data.
+-->
+<!--
+ <item
+ title="Test conditional-subitem">
+ <description>
+You should see the "Step for A." subitem.
+ </description>
+ <conditional-subitem condition="a">
+ <subitem when="a" label="Step for A." />
+ <subitem when="b" label="Step for B." />
+ </conditional-subitem>
+ </item>
+
+ <item
+ title="Test repeated-subitem">
+ <description>
+You should see the "Step for A.", "Step for B." and "Step for C." subitems.
+ </description>
+ <repeated-subitem values="A,B,C">
+ <subitem label="Step for ${this}"/>
+ </repeated-subitem>
+ </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"
+ skip="true">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern"
+ skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+ </item>
+
+<item
+ title="Test SubItems"
+ href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm">
+ <description>
+Try the help link, you should see the concepts for the help system.
+ </description>
+ <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"/>
+ </subitem>
+ <conditional-subitem condition="${pattern}">
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern"
+ skip="false">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <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"
+ skip="true">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+ <conditional-subitem condition="${pattern}">
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern">
+ <action
+ confirm="true"
+ 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
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern">
+ </subitem>
+ </conditional-subitem>
+ <conditional-subitem condition="${pattern}">
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern"
+ skip="true">
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern">
+ </subitem>
+ </conditional-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"/>
+ </subitem>
+ <subitem label="sub 5"/>
+ <subitem label="sub 6">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <subitem label="sub 7">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <subitem label="sub 8">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.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"/>
+ </subitem>
+ <subitem label="sub 10" skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <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>
+ <subitem label="sub 11" skip="false">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.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"/>
+ </subitem>
+</item>
+
+ <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="Test SubItems with PerformWhen"
+ href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm">
+ <description>
+Try the help link, you should see the concepts for the help system.
+ </description>
+ <subitem label="sub 1">
+ <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>
+ </subitem>
+ <subitem label="sub 2" skip="false">
+ <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"
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ <action
+ when="Visitor"
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </perform-when>
+ </subitem>
+ <subitem label="sub 3" skip="true">
+ <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"
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ <action
+ when="Visitor"
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </perform-when>
+ </subitem>
+</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"
+ skip="true">
+ <perform-when condition="${pattern}">
+ <!-- The "when" are set incorrectly to ensure the perform when is working. -->
+ <action
+ when="Singleton"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ <action
+ when="Visitor"
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ <action
+ when="Factory"
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </perform-when>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern"
+ skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+ </item>
+
+ <item
+ title="Customize your pattern">
+ <description>
+Now that you have chosen the pattern that you would like to create, customize your options.
+ </description>
+ <repeated-subitem values="${files}">
+ <subitem label="Create class ${this}">
+ <perform-when condition="${pattern}">
+ <!-- The "when" are set incorrectly to ensure the perform when is working. -->
+ <action
+ when="Singleton"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ <action
+ when="Visitor"
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ <action
+ when="Factory"
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </perform-when>
+ </subitem>
+ </repeated-subitem>
+ </item>
+
+<item
+ title="All done!">
+ <description>
+Did the test work?
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml
new file mode 100644
index 000000000..10615246c
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestInfopop_Help.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Testing Infopop and Help Links">
+
+<intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+This cheat sheet will test infopop and help link.
+Let's get started!
+ </description>
+</intro>
+
+<item
+ title="Test help link"
+ href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm">
+ <description>
+Try the help link, you should see the concepts for the help system.
+ </description>
+</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.
+ </description>
+</item>
+
+<item
+ title="Display the gathered data and additional parameters"
+ contextId="org.eclipse.ui.tests.cheatsheets.test_cheatsheets">
+ <description>
+Try the help link, you should see an infopop 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">
+ <description>
+Try the help link, you should see the same infopop again.
+ </description>
+</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.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml
new file mode 100644
index 000000000..9c60424ae
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestParameters.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Hello World Demo">
+
+<intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+This cheat sheet will test parameters.
+Let's get started!
+ </description>
+</intro>
+
+<item
+ title="Prompt to enter some data">
+ <action
+ class="org.eclipse.ui.tests.cheatsheets.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ param1="gather"/>
+ <description>
+To begin, let's gather some data.
+ </description>
+</item>
+
+<item
+ title="Display the gathered data and additional parameters">
+ <action
+ class="org.eclipse.ui.tests.cheatsheets.parameters.GatherDisplayDataAction"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ param1="display"
+ param2="${name}"
+ param3="${color}"
+ param4="${animal}"
+ param5="Testing is fun."
+ param6="Powered by Cheat Sheets!"/>
+ <description>
+You data has been process, let's see the results.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml b/org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml
new file mode 100644
index 000000000..2a711eefd
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/TestSubItems.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Testing SubItems">
+
+<intro
+ href="/org.eclipse.ui.cheatsheets.doc/tasks/tcheatst.htm">
+ <description>
+This cheat sheet will test subitems.
+Let's get started!
+ </description>
+</intro>
+
+<item
+ title="Test SubItems"
+ href="/org.eclipse.platform.doc.user/concepts/chelpsys.htm">
+ <description>
+Try the help link, you should see the concepts for the help system.
+ </description>
+ <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"/>
+ </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"/>
+ </subitem>
+ <subitem label="sub 5"/>
+ <subitem label="sub 6">
+ <action
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <subitem label="sub 7">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <subitem label="sub 8">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.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"/>
+ </subitem>
+ <subitem label="sub 10" skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+ </subitem>
+ <subitem label="sub 11" skip="false">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.tests.cheatsheets.actions.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"/>
+ </subitem>
+</item>
+
+
+<item
+ title="All done!">
+ <description>
+Did the test work?
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml
new file mode 100644
index 000000000..d891c3504
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraAttr.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+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"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml
new file mode 100644
index 000000000..9e6361190
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ExtraElement.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+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">
+ <extra>
+ testing
+ </extra>
+ </action>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml
new file mode 100644
index 000000000..4065e2103
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingClass.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <action
+ pluginId="org.eclipse.ui.cheatsheets"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml
new file mode 100644
index 000000000..863b675e0
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_MissingPluginId.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <action
+ class="org.eclipse.ui.tests.cheatsheets.actions.NoopAction"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml
new file mode 100644
index 000000000..e65e04d1f
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidNumber.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+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"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml
new file mode 100644
index 000000000..301cffc8f
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ActionElement_ParamInvalidRange.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+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"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml
new file mode 100644
index 000000000..7f9e3c19f
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_BadXML.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+<extra>
+ Just an extra element but using bad XML.
+</extraa>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml
new file mode 100644
index 000000000..1f72bb113
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraAttr.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element" extra="foobar">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml
new file mode 100644
index 000000000..1b0bf442f
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_ExtraElement.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+<extra>
+ Just an extra element.
+</extra>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml
new file mode 100644
index 000000000..ed1d7977a
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_MissingTitle.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet>
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml
new file mode 100644
index 000000000..811df7db1
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/CheatSheetElement_NotDefined.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testcheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+</testcheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml
new file mode 100644
index 000000000..78f1555bb
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraAttr.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <conditional-subitem condition="${pattern}" extra="testing">
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern"
+ skip="true">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern"
+ skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml
new file mode 100644
index 000000000..b80e45b30
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_ExtraElement.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <conditional-subitem condition="${pattern}">
+ <extra>testing</extra>
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern"
+ skip="true">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern"
+ skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml
new file mode 100644
index 000000000..487a15695
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingCondition.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <conditional-subitem>
+ <subitem
+ when="Factory"
+ label="Customize the Factory Pattern"
+ skip="true">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.FactoryCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Singleton"
+ label="Customize the Singleton Pattern"
+ skip="false">
+ <action
+ confirm="true"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.SingletonCustomizeAction"/>
+ </subitem>
+ <subitem
+ when="Visitor"
+ label="Customize the Visitor Pattern"
+ skip="true">
+ <action
+ confirm="false"
+ pluginId="org.eclipse.ui.tests.cheatsheets"
+ class="org.eclipse.ui.examples.cheatsheets.pattern.actions.VisitorCustomizeAction"/>
+ </subitem>
+ </conditional-subitem>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml
new file mode 100644
index 000000000..8d72ad685
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ConditionalSubItem_MissingSubItem.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <conditional-subitem condition="${pattern}">
+ </conditional-subitem>
+</item>
+
+</cheatsheet>
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml
new file mode 100644
index 000000000..6fca2a9c5
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/DescriptionElement_ExtraElements.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description extra="testing">
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course <b>not</b>, it is suppose to cause a parsing <extra>error</extra>.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml
new file mode 100644
index 000000000..f97ebd7c8
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraAttr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro extra="testing">
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml
new file mode 100644
index 000000000..ae0f407c3
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ExtraElement.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+<intro>
+ <description>
+Simple test
+ </description>
+ <extra>
+ Just an extra element.
+ </extra>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml
new file mode 100644
index 000000000..db3a4b0f3
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDefined.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+<intro>
+ <description>
+Simple test
+ </description>
+</intro>
+<intro>
+ <description>
+Simple test, an extra intro
+ </description>
+</intro>
+<intro>
+ <description>
+Simple test, another extra intro
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml
new file mode 100644
index 000000000..3d62fa582
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_ManyDescriptions.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+<intro>
+ <description>
+Simple test
+ </description>
+ <description>
+Simple test, an extra description
+ </description>
+ <description>
+Simple test, another extra description
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml
new file mode 100644
index 000000000..8ca495a19
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_MissingDescription.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+<intro>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml
new file mode 100644
index 000000000..f6f7813f7
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/IntroElement_NotDefined.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml
new file mode 100644
index 000000000..d96cb1ee7
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraAttr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test" extra="testing" extra2="testing2">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml
new file mode 100644
index 000000000..56b73840f
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ExtraElement.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <extra>
+Just an extra element.
+ </extra>
+ <extra2>
+Just another extra element.
+ </extra2>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml
new file mode 100644
index 000000000..bd84b014d
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_ManyDescriptions.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <description>
+Just an extra description.
+ </description>
+ <description>
+Just another extra description.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml
new file mode 100644
index 000000000..5c56d8624
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingDescription.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml
new file mode 100644
index 000000000..6198d0e0a
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_MissingTitle.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item>
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml
new file mode 100644
index 000000000..17d4d8a1e
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_NotDefined.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml
new file mode 100644
index 000000000..6b8204342
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/ItemElement_OneDefined.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml
new file mode 100644
index 000000000..e7ed10744
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraAttr.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <perform-when condition="${pattern}" extra="testing">
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml
new file mode 100644
index 000000000..f580bcfb5
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_ExtraElement.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <perform-when condition="${pattern}">
+ <extra>testing</extra>
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml
new file mode 100644
index 000000000..8a3a51216
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingAction.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <perform-when condition="${pattern}">
+ </perform-when>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml
new file mode 100644
index 000000000..a9598c842
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/PerformWhen_MissingCondition.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <perform-when>
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml
new file mode 100644
index 000000000..33a0ff4c3
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraAttr.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <repeated-subitem values="${files}" extra="testing">
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml
new file mode 100644
index 000000000..40c88fa9d
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_ExtraElement.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <repeated-subitem values="${files}">
+ <extra>testing</extra>
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml
new file mode 100644
index 000000000..82fd178f1
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingSubItem.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <repeated-subitem values="${files}">
+ </repeated-subitem>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml
new file mode 100644
index 000000000..1b8ebc924
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/RepeatedSubItem_MissingValues.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <repeated-subitem>
+ <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>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml
new file mode 100644
index 000000000..b0eb38cbe
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraAttr.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <subitem label="sub 1" extra="testing"/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml
new file mode 100644
index 000000000..4f9bf1bec
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_ExtraElement.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <subitem label="sub 1">
+ <extra>testing</extra>
+ </subitem>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml
new file mode 100644
index 000000000..fa05fa840
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/parser/SubItemElement_MissingLabel.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet without cheatsheet element">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work? Of course not, it is suppose to cause a parsing error.
+ </description>
+ <subitem/>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml b/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml
new file mode 100644
index 000000000..1e57d31d8
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/rational/Test1.xml
@@ -0,0 +1,22 @@
+<?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
new file mode 100644
index 000000000..28defaae9
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/rational/Test2.xml
@@ -0,0 +1,22 @@
+<?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/cheatsheets/tests/webapp/TestOpeningURL.xml b/org.eclipse.ua.tests/cheatsheets/tests/webapp/TestOpeningURL.xml
new file mode 100644
index 000000000..fb7edef72
--- /dev/null
+++ b/org.eclipse.ua.tests/cheatsheets/tests/webapp/TestOpeningURL.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Test cheatsheet opening from URL">
+
+ <intro>
+ <description>
+Simple test
+ </description>
+</intro>
+
+ <item
+ title="Just a simple test">
+ <description>
+Did it work?
+ </description>
+</item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/contexts.xml b/org.eclipse.ua.tests/contexts.xml
new file mode 100644
index 000000000..09aabf404
--- /dev/null
+++ b/org.eclipse.ua.tests/contexts.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.contexts"?>
+<contexts>
+ <!-- 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"/>
+ </context>
+</contexts>
diff --git a/org.eclipse.ua.tests/icons/sample.gif b/org.eclipse.ua.tests/icons/sample.gif
new file mode 100644
index 000000000..34fb3c9d8
--- /dev/null
+++ b/org.eclipse.ua.tests/icons/sample.gif
Binary files differ
diff --git a/org.eclipse.ua.tests/icons/sample2.gif b/org.eclipse.ua.tests/icons/sample2.gif
new file mode 100644
index 000000000..b991e0778
--- /dev/null
+++ b/org.eclipse.ua.tests/icons/sample2.gif
Binary files differ
diff --git a/org.eclipse.ua.tests/plugin.xml b/org.eclipse.ua.tests/plugin.xml
new file mode 100644
index 000000000..4ee3bbb7a
--- /dev/null
+++ b/org.eclipse.ua.tests/plugin.xml
@@ -0,0 +1,269 @@
+<?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>
+
+
+ <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!!! -->
+ <extension
+ point="org.eclipse.ui.cheatsheets.cheatSheetContent">
+ <category
+ name="Cheat sheet examples - part 1"
+ id="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat">
+ </category>
+ <category
+ name="Cheat sheet examples - part 2"
+ id="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat2">
+ </category>
+ <category
+ name="Tests"
+ id="org.eclipse.ui.tests.cheatsheets.cheatSheetsTestCat">
+ </category>
+ <cheatsheet
+ name="Hello World"
+ category="org.eclipse.ui.examples.cheatsheets.cheatSheetsCat"
+ contentFile="cheatsheets/examples/part1/HelloWorld.xml"
+ id="org.eclipse.ui.examples.cheatsheets.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.
+ </description>
+ </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">
+ <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">
+ <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">
+ <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">
+ <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">
+ <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">
+ <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">
+ <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">
+ <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">
+ <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">
+ </cheatsheet>
+ </extension>
+
+ <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>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.ua.tests/readme.txt b/org.eclipse.ua.tests/readme.txt
new file mode 100644
index 000000000..ad2c6753f
--- /dev/null
+++ b/org.eclipse.ua.tests/readme.txt
@@ -0,0 +1,100 @@
+
+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
new file mode 100644
index 000000000..ce1de35e4
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/CustomizeAction.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..238c682aa
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionI.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..fbd514d9f
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/ExtensionActionII.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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/FactoryCustomizeAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/FactoryCustomizeAction.java
new file mode 100644
index 000000000..46b635bbd
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/FactoryCustomizeAction.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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 FactoryCustomizeAction extends CustomizeAction {
+ public void run(String[] params, ICheatSheetManager csm) {
+ System.out.println("In FactoryCustomizeAction");
+ super.run(params, csm);
+ }
+}
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
new file mode 100644
index 000000000..8596dcc52
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/LaunchPatternSelectionDialogAction.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..aac96798a
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenClassNameFilledAction.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..689e1e26e
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaClassWizardWithMain.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..6bcca75ba
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenJavaProjectWizard.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..cdb30b59e
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/OpenNewJavaProjectWizardWithNameAction.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..87dec4cf9
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/PatternGenerator.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..5f83f332a
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/SingletonCustomizeAction.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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/actions/VisitorCustomizeAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/VisitorCustomizeAction.java
new file mode 100644
index 000000000..e452d0cfc
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/actions/VisitorCustomizeAction.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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 VisitorCustomizeAction extends CustomizeAction {
+ public void run(String[] params, ICheatSheetManager csm) {
+ System.out.println("In VisitorCustomizeAction");
+ 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
new file mode 100644
index 000000000..c45aa85c3
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/CustomizePatternDialog.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..fc38f6428
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/dialogs/PatternSelectionDialog.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..6ed40942c
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/listeners/PatternItemListener.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..6ea71a4ec
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/examples/cheatsheets/pattern/wizards/MyProjectCreationWizard.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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/CheatSheetTestPlugin.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/CheatSheetTestPlugin.java
new file mode 100644
index 000000000..2f8e7c74e
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/CheatSheetTestPlugin.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 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;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class CheatSheetTestPlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static CheatSheetTestPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public CheatSheetTestPlugin() {
+ super();
+ plugin = this;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static CheatSheetTestPlugin getDefault() {
+ return plugin;
+ }
+}
diff --git a/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java
new file mode 100644
index 000000000..2da1a8799
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NavigateAction.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.swt.widgets.Display;
+import org.eclipse.ui.cheatsheets.*;
+
+public class NavigateAction extends Action implements ICheatSheetAction {
+
+ static void go( String newSheet ) {
+ System.out.println( "Test.go newSheet:(" + newSheet + ")" );
+ final String finalNewSheet = newSheet;
+ try {
+ Display.getCurrent().asyncExec( new Runnable() {
+ public void run() {
+ OpenCheatSheetAction csAction = new OpenCheatSheetAction( finalNewSheet );
+ csAction.run();
+ }
+ } );
+ }
+ catch( Exception ex ) { }
+ }
+
+ 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/tests/cheatsheets/actions/NoopAction.java b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java
new file mode 100644
index 000000000..f50303ff3
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/NoopAction.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..efa5628ee
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetParserAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..fe803e320
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestCheatSheetViewerSetInputAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..d04f8d5b9
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestOpeningURL.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..5b8514d4d
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/actions/TestStartWebApp.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..4e78c2c79
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/DisplayDataDialog.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..8f0987c33
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDataDialog.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..388ae91d7
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/parameters/GatherDisplayDataAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 000000000..75088efae
--- /dev/null
+++ b/org.eclipse.ua.tests/src/org/eclipse/ui/tests/cheatsheets/views/CheatSheetViewerTestView.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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

Back to the top