To include command links in your documentation, you must first declare the use of the supporting JavaScript code in the HEAD section of your HTML:
<script language="JavaScript" src="../../org.eclipse.help/livehelp.js> </script>
The live help JavaScript is located in the org.eclipse.help plug-in. You can refer to it using the help system's cross plug-in referencing technique.
In this example, we have to navigate up two levels in the directory structure. The document with the command link is located in a sub-directory underneath the plug-in directory (a typical practice). So we must navigate up one directory to reach the documentation plug-in's root, and another level to reach the "virtual" location of all plug-ins. Then we can refer to the org.eclipse.help plug-in.
In the body of your documentation, you invoke the executeCommand function.
<a href='javascript:executeCommand("org.eclipse.ui.help.aboutAction")'>
Open the About dialog</a>
The parameter for the executeCommand function is a serialized ParameterizedCommand. See the ParameterizedCommand.serialize() method for full details on this format.
In the example above, the About dialog command does not require any parameters, so the serialization is merely its command id: org.eclipse.ui.help.aboutAction. Below is another example showing a command with a parameter. Note the command id is followed by the parameter id and value in parentheses:
<a href='javascript:executeCommand( "org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.ui.preferencePages.Views)")'> Show a preference page</a>
A final example demonstrates that multiple parameters are possible. They are comma separated and the order of the parameters is not important.
<a href='javascript:executeCommand( "org.eclipse.ui.dialogs.openMessageDialog(imageType=3,buttonLabel2=Maybe,title=Opinion Poll,message=Do you like command links?,buttonLabel0=Yes,defaultIndex=0,buttonLabel1=No)")'> Open a message dialog</a>