Composite cheat sheets provide guidance through complex problems by breaking the problem into a set of smaller tasks. Composite cheat sheets are registered using the the org.eclipse.ui.cheatsheets.cheatSheetContent extension point.
The composite cheat sheet content itself is defined in a separate file which conforms to the composite cheat sheet schema. The content file is an XML file and consists of a set of tasks organized in groups into a tree structure.
<compositeCheatsheet> is the root element of a composite cheat sheet. It will have a single root task which may be a <task> or <taskGroup>. <taskGroup> elements may have one or more children each of which can be a <task> or <taskGroup>. A <task> does not have child tasks.
Tasks and task groups may contain <intro> elements which contain the text to be displayed before the task has been started and <onCompletion> elements which contain the text to be displayed once the task is completed. Both the <intro> and <onCompletion> elements may contain form text markup, in the example below the tags <b> and </b> are used to make text bold.
Tasks may also contain <param> elements. A cheat sheet task may have any of the following parameters: "id" is the id of a registered cheatsheet, "path" is the relative path or URL of the cheat sheet content file and "skipIntro" is a boolean parameter which if true causes the cheat sheet to start at the first step rather than at the introduction. Either "id" or "path" but not both must be specified.
A <dependency> node from task "B" to task "A" represents a requirement that task A is completed before task B can be started.
The file below is an example of how to create a composite cheat sheet from existing cheat sheets and how to create task groups and make tasks skippable.
<?xml version="1.0" encoding="UTF-8"?> <compositeCheatsheet name="Building and Publishing Plugins"> <taskGroup name= "Introduction to the PDE"> <intro> This composite cheat sheet contains tasks which can guide you through the <b>PDE</b>, from creating a simple project to deploying a feature </intro> <taskGroup name= "Build and deploy a plugin project" kind = "sequence"> <intro> First you will learn how to create a java project, then you will deploy that project. </intro> <task kind="cheatsheet" name= "Create a java project" id = "createJavaProject"> <param name="id" value = "org.eclipse.jdt.helloworld"/> <intro>This task guide walks through the process of creating a simple hello world application. The guide can launch wizards to create a new project and a new class. </intro> <onCompletion>Congratulations you have succeeded in creating a hello world application</onCompletion> </task> <task kind="cheatsheet" name= "Deploy a java project"> <intro>In this task the hello world project created in a previous task will be deployed. This task guide shows show to create <b>features</b> and <b>update sites</b> </intro> <dependsOn task = "createJavaProject" /> <param name = "id" value = "org.eclipse.pde.updates" /> </task> </taskGroup> <taskGroup name= "Next Steps"> <intro>Once you have learned how to create and deploy a java project you may want to learn about SWT and Rich Clients. </intro> <task kind="cheatsheet" name= "Create an SWT application"> <param name = "id" value = "org.eclipse.jdt.helloworld.swt" /> <intro>Eclipse plugins which contribute to the user interface use The Standard Widget Toolkit (SWT). This task guide can be used to learn more about SWT. </intro> </task> <task kind="cheatsheet" name= "Create a Rich Client application"> <param name = "id" value ="org.eclipse.pde.rcpapp" /> <intro> The minimal set of plug-ins needed to build a rich client application is collectively known as the Rich Client Platform. This task guide walks through the steps to create a rich client application. </intro> </task> </taskGroup> </taskGroup> </compositeCheatsheet>
Composite cheat sheets are extensible, however in Eclipse 3.2 this extensibility is provisional and the classes could change before they become API. Composite cheat sheet support can be extended by using the extension point org.eclipse.ui.cheatsheets.cheatSheetContent which has two new elements taskEditor and taskExplorer which allow for contribution of task editors and task explorers.
Contributing a task editor defines a new kind of task which displays in the task detail section. To contribute a task editor implement a concrete subclass of TaskEditor, then add a taskEditor element to plugin.xml.
The representation of the task explorer is also configurable with an extension point, a tree explorer is included with the Eclipse platform. By default the explorer for a composite cheat sheet when first opened is a tree, an attribute on the <compositeCheatSheet> element will allow that default to be overridden. If more than one explorer is registered the view menu will contain a menu item to switch between explorers. To contribute a task explorer first implement a concrete subclass of TaskExplorer, then add a taskExplorer element to plugin.xml.