Based on the great response we have had to our previous cheat sheets articles, (why they rock and tips and tricks), I have decided to post a more in depth tutorial. One of the many benefits of Cheat sheets is that they provide an immediate improvement to your product’s usability and are simple to implement. This article will allow you to quickly create multiple cheat sheets.
To help get you started we have created a cheat sheet on cheat sheets: This cheat sheet can be opened from within eclipse and will guide you through the simple steps for setting up a cheat sheet for your own project.
To use our Cheat Sheet cheat sheet simply open Eclipse. go to ‘Help ->Cheat Sheets..’ and choose ‘Enter the URL of a cheat sheet.’ Enter the following url in the box provided:
Steps for creating a cheat sheet for an Eclipse Plugin
In your project’s plugin.xml file, add the cheat sheet extension point under the Extensions tab: org.eclipse.ui.cheatsheets.cheatSheetContent
You can group the cheatsheets you create into categories. These categories are what appear as the folders in Help > Cheatsheets. To create a category, right click the cheat sheet extension point and add a ‘New > category’. Give the category an id and a name. If you don’t create a category, your cheatsheets will just go into an “Other” category.
Right click the extension again and choose ‘New > cheatsheet’. Again specify an id and name and also put the category that we just created.
Notice you need to specify the cheatsheet’s content file. This will be an XML file of the instructions shown to the user.
Creating a cheat sheet content file
The xml structure for a cheat sheet is simple and intuitive. Knowing what you want to accomplish and what options are available to you are the most important parts. Learning by example is the simplest solution. I have compiled a list of the tags you will most commonly use and their function
An item can contain _
Here is an example of the common tags in action:
Welcome to the tutorial. Let's get started!
Include some explanatory text here or list some instructional walkthrough steps.
1. Step 1..
2. Step 2..
More explanatory text or instructional steps here..
If you would like to have a composite cheatsheet that manages a set of related tasks, set the composite attribute to true. Composite cheatsheets have a different XML schema for their content files.
An example of a composite cheat sheet:
name=”Getting started with Architexa”>
Great! You have completed the tutorial!
kind="cheatsheet" name="Using Layered Diagrams"
This tutorial guides you through the creation of a Layered Diagram.
Finished creating a Layered Diagram.
<task .... more tasks...
Opening Cheat Sheets Programmatically
In many cases you may want to make your cheat sheets more accessible to the user. They can be included in wizards, help buttons/links, or anywhere else in your plugin. To launch a cheat sheet automatically create a new OpenCheatSheetAction instance with the parameter equal to the id of the desired cheat sheet as defined in the xml file. Running this action will open the cheat sheet.
For more information on these tags, additional properties, and specific information on their usage see the below references: