Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 33685 Details for
Bug 123921
document list of commands for use from UA document contexts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
update to draft document (ver 0.3)
EmbeddingCommands.html (text/html), 20.70 KB, created by
Christopher Daly
on 2006-01-26 20:45:20 EST
(
hide
)
Description:
update to draft document (ver 0.3)
Filename:
MIME Type:
Creator:
Christopher Daly
Created:
2006-01-26 20:45:20 EST
Size:
20.70 KB
patch
obsolete
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ><html> ><head> > <meta content="text/html; charset=ISO-8859-1" > http-equiv="content-type"> > <title>Embedding Commands as Links</title> ></head> ><body> ><h1>Embedding Commands as Links</h1> >by Chris Daly (cjdaly@us.ibm.com)<br> >version 0.3 (26-Jan-2006)<br> ><br> ><br> >This document is meant to serve as a guide to authors of Help, >Cheatsheets, Intro and possibly other document types who would benefit >from the ability to embed commands in their documents as links. >The centerpiece of this document is a catalog of commands that are >thought to be useful in embedded document contexts. This document >is associated with <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123921">bug 123921</a>.<br> ><br> ><h2>Background</h2> >A <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=120523">recent >enhancement</a> to the command framework allows commands and their >parameter values to be serialized as strings and later deserialized and >executed. This allows serialized commands to be embedded in >documents and visualized as links such that activating the link has the >effect of executing the embedded command.<br> ><br> ><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=121709">Another >enhancement</a> introduces the notion of typed command >parameters. Previously, parameter values were expressed as >strings throughout the lifecycle of command parameterization and >execution. Now command parameters can declare a type and the >parameter values can be handled as objects instead of strings. >This allows:<br> ><ul> > <li>object parameter values to be handled correctly by the >serialization/deserialization mechanism described above</li> > <li>multiple handlers of a command to convert string to object >parameter values in a consistent way</li> > <li>tooling to search for commands that operate on certain types of >objects</li> ></ul> >This work was done with the goal of allowing commands to be embedded as >links in the various types of User Assistance documents: Help, >Cheatsheets and Intro. The functionality may also be useful in >other contexts.<br> ><br> >Two additional things are required for the ability to embed commands in >documents to become a useful and used feature. First, we must >have a reasonably large "catalog" of commands that do >interesting/useful things when embedded in documents. Second, >each type of document must specify how commands may be embedded and its >supporting code must present the commands in some way that allows them >to be invoked by users (such as a clickable link). These topics >are explored in detail below.<br> ><br> ><h2>An Example<br> ></h2> >Below is an HTML document that represents a Help topic. The >JavaScript <span style="font-family: monospace;">executeCommand</span> >function takes a serialized command as its argument and executes the >command when the link is clicked. The serialized command text is >highlighted.<span style="font-style: italic;"></span><br> ><br> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span > style="font-family: monospace;"><!DOCTYPE HTML PUBLIC "-//W3C//DTD >HTML 4.0 Transitional//EN"><HTML></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"><HEAD></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"><TITLE></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;">Help Link Test</span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"></TITLE></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"><script >language="JavaScript" src="../../org.eclipse.help/livehelp.js"> ></script></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"></HEAD></span><br > style="font-family: monospace;"> > <br style="font-family: monospace;"> > <span style="font-family: monospace;"><body></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"><p>Execute command >link to</span><br style="font-family: monospace;"> > <span style="font-family: monospace;"><a >href='javascript:executeCommand(</span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> >"<span style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.ui.views.TaskList)</span>")'></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> show >Tasks view</a>.</p></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"></body></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"></HTML></span><br> > </td> > </tr> > </tbody> ></table> ><br> ><br> ><h2>Catalog of Commands</h2> >What follows is a catalog of commands that may be useful in embedded >document scenarios. Some of these are available today and some >are not yet committed (indicated with [proposed] below). The >format of the tables below is:<br> ><br> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Command >Name</span> - brief description and mention of parameters<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><span > style="font-family: monospace;">command.id(param.id=value)</span> >« <span style="font-style: italic;">example demonstrating usage</span><br> > </div> > </td> > </tr> > </tbody> ></table> ><br> >Please refer to the JavaDoc for <span style="font-family: monospace;">ParameterizedCommand.serialize()</span> >for a description of the command serialization format.<br> ><br> ><h3>General Workbench</h3> ><small> </small><small> </small> ><table style="text-align: left; width: 876px; height: 296px;" border="1" > cellpadding="2" cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >Perspective</span> - without parameters, opens a >dialog with list of perspectives<br> > </td> > </tr> > <tr style="font-family: monospace;"> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;">org.eclipse.ui.perspectives.showPerspective</div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >Perspective</span> - parameter >indicates perspective id<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><small><span > style="font-family: monospace;">org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.ui.resourcePerspective)</span> > </small></div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >View</span> - without parameters, opens a dialog with >list of views<br> > </td> > </tr> > <tr style="font-family: monospace;"> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;">org.eclipse.ui.views.showView</div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >View</span> - parameter indicates >view id</td> > </tr> > <tr style="font-family: monospace;"> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.ui.views.TaskList)</div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Window >Preferences</span> [proposed] - parameter indicates which preference >page (no parameter means open the main page)<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">New >Wizard</span> [proposed] - parameter indicates id of wizard to launch<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Import >Wizard</span> [proposed] - parameter indicates id of wizard to launch</td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Export >Wizard</span> [proposed] - parameter indicates id of wizard to launch</td> > </tr> > <tr> > <td style="vertical-align: top;">Navigator Common Wizard - figure >out what this is<br> > </td> > </tr> > </tbody> ></table> ><br> ><h3>Workspace</h3> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >Resource</span> [proposed] - open a resource given its path and/or URI >as parameter<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >Resource in Navigator</span> [proposed] - show in Navigator view given >resource path and/or URI as parameter</td> > </tr> > </tbody> ></table> ><br> ><h3>User Assistance <small><small>(see bug <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123040">123040</a>)</small></small><br> ></h3> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Display >Help</span> - without parameters, opens the help system<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><span > style="font-family: monospace;">org.eclipse.ui.help.displayHelp</span><br> > </div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Display >Help</span> - parameter indicates help topic href<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><span > style="font-family: monospace;">org.eclipse.ui.help.displayHelp(href=/org.eclipse.platform.doc.user/gettingStarted/qs-02a.htm)</span><br> > </div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >Cheatsheet</span> [proposed] - Chris G. indicated there would be >several variants<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >Intro Content</span> [proposed] - look into this...<br> > </td> > </tr> > </tbody> ></table> ><br> ><h3>Java <small><small>(see bug <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123198">123198</a>)</small></small><br> ></h3> >Note: the examples below work on a class named <span > style="font-family: monospace;">Activator</span> in a plugin called <span > style="font-family: monospace;">org.test</span>. Simply create a >new plugin called <span style="font-family: monospace;">org.test</span> >to try these examples.<br> ><br> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >JavaElement in Editor</span> - parameter encodes handle identifier of >java element<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><small><span > style="font-family: monospace;">org.eclipse.jdt.ui.commands.openElementInEditor(elementRef=org.test/org.test.Activator)</span></small><br> > </div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >JavaElement in Package Explorer View</span> - parameter encodes handle >identifier of java element</td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><small><span > style="font-family: monospace;">org.eclipse.jdt.ui.commands.showElementInPackageView(elementRef=org.test/org.test.Activator)</span></small><br> > </div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Show >JavaElement in Type Hierarchy View</span> - parameter encodes handle >identifier of java element</td> > </tr> > <tr style="font-family: monospace;"> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><small>org.eclipse.jdt.ui.commands.showElementInTypeHierarchyView(elementRef=org.test/org.test.Activator)<br> > </small></div> > </td> > </tr> > </tbody> ></table> ><br> ><h3>Run/Debug</h3> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><br> > </td> > </tr> > </tbody> ></table> ><br> ><h3>Update Manager <small><small>(see bug <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=125071">125071</a>)</small></small><br> ></h3> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >Manage Configuration Dialog</span> - opens the dialog for managing >product configuration (no parameters)<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><span > style="font-family: monospace;">org.eclipse.ui.update.manageConfiguration</span><br> > </div> > </td> > </tr> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >Install/Update Feature Dialog</span> - opens the dialog for installing >and updating features (no parameters)<br> > </td> > </tr> > <tr> > <td style="vertical-align: top;"> > <div style="margin-left: 40px;"><span > style="font-family: monospace;">org.eclipse.ui.update.findAndInstallUpdates</span><br> > </div> > </td> > </tr> > </tbody> ></table> ><br> ><br> ><h3>Browser</h3> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span style="font-weight: bold;">Open >URL in Browser</span> [proposed] - parameter is URL<br> > </td> > </tr> > </tbody> ></table> ><br> ><br> ><br> ><h2>Command Embedding Contexts</h2> ><h3>Help <small><small>(see bug <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=122726">122726</a>)</small></small><br> ></h3> >The example above shows how to embed commands in Help.<br> ><br> ><h3>Cheatsheets</h3> >Here's an example that shows how to embed commands in a Cheatsheet:<br> ><br> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span > style="font-family: monospace;"><?xml version="1.0" >encoding="UTF-8"?></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"><cheatsheet >title="Example of Commands"></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <intro></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ><description>A cheat sheet which tests command >support</description></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> </intro></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <item title="Step >1"></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> ><description>This is a step with a command which shows the search >view.</description></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> ><command serialization="<span > style="background-color: rgb(255, 153, 102);">org.eclipse.search.ui.views.SearchView</span>"/> > </span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> </item></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <item title="Step >2"></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> ><description>This is a step with a command and parameters, shows >package explorer.</description></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ><command serialization="<span > style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.jdt.ui.PackageExplorer)</span>"/></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> </item></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"></cheatsheet></span><br> > </td> > </tr> > </tbody> ></table> ><br> >Note also that bug <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=125420">125420</a> >proposes an enhancement to declare command return types. If this >is accepted there will be a mechanism to capture the return type in the >cheatsheet data store (so we need an example of that).<br> ><br> ><h3>Intro <small><small>(see bugs <a > href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124060">124060</a>, ><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124076">124076</a>, ><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124573">124573</a>)</small></small><br> ></h3> >Here's an example that shows how to embed commands in Intro content:<br> ><br> ><table style="width: 100%; text-align: left;" border="1" cellpadding="2" > cellspacing="2"> > <tbody> > <tr> > <td style="vertical-align: top;"><span > style="font-family: monospace;"><?xml version="1.0" >encoding="UTF-8" ?></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"><introContent></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <!-- Extension to >the SDK What's New Page. --></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <extensionContent >path="news/page-content/noteworthy-links/pdeAnchor"></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> <link >label="Test News1"</span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> >url="http://org.eclipse.ui.intro/execute?command=<span > style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView()</span>&amp;standby=true"</span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> >id="pde-noteworthy" style-id="noteworthy-link"></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ><text>This is a test</text></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ></link></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> <link >label="Test News2"</span><br style="font-family: monospace;"> > <span style="font-family: monospace;">url="http://org.eclipse.ui.intro/execute?command=<span > style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId%3dorg.eclipse.jdt.ui.PackageExplorer)</span>&amp;standby=true"</span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> >id="pde-noteworthy" style-id="noteworthy-link"></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ><text>This is another test</text></span><br > style="font-family: monospace;"> > <span style="font-family: monospace;"> ></link></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"> ></extensionContent></span><br style="font-family: monospace;"> > <span style="font-family: monospace;"></introContent></span><br> > </td> > </tr> > </tbody> ></table> ><br> ></body> ></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Embedding Commands as Links</title> </head> <body> <h1>Embedding Commands as Links</h1> by Chris Daly (cjdaly@us.ibm.com)<br> version 0.3 (26-Jan-2006)<br> <br> <br> This document is meant to serve as a guide to authors of Help, Cheatsheets, Intro and possibly other document types who would benefit from the ability to embed commands in their documents as links. The centerpiece of this document is a catalog of commands that are thought to be useful in embedded document contexts. This document is associated with <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123921">bug 123921</a>.<br> <br> <h2>Background</h2> A <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=120523">recent enhancement</a> to the command framework allows commands and their parameter values to be serialized as strings and later deserialized and executed. This allows serialized commands to be embedded in documents and visualized as links such that activating the link has the effect of executing the embedded command.<br> <br> <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=121709">Another enhancement</a> introduces the notion of typed command parameters. Previously, parameter values were expressed as strings throughout the lifecycle of command parameterization and execution. Now command parameters can declare a type and the parameter values can be handled as objects instead of strings. This allows:<br> <ul> <li>object parameter values to be handled correctly by the serialization/deserialization mechanism described above</li> <li>multiple handlers of a command to convert string to object parameter values in a consistent way</li> <li>tooling to search for commands that operate on certain types of objects</li> </ul> This work was done with the goal of allowing commands to be embedded as links in the various types of User Assistance documents: Help, Cheatsheets and Intro. The functionality may also be useful in other contexts.<br> <br> Two additional things are required for the ability to embed commands in documents to become a useful and used feature. First, we must have a reasonably large "catalog" of commands that do interesting/useful things when embedded in documents. Second, each type of document must specify how commands may be embedded and its supporting code must present the commands in some way that allows them to be invoked by users (such as a clickable link). These topics are explored in detail below.<br> <br> <h2>An Example<br> </h2> Below is an HTML document that represents a Help topic. The JavaScript <span style="font-family: monospace;">executeCommand</span> function takes a serialized command as its argument and executes the command when the link is clicked. The serialized command text is highlighted.<span style="font-style: italic;"></span><br> <br> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-family: monospace;"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><HEAD></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><TITLE></span><br style="font-family: monospace;"> <span style="font-family: monospace;">Help Link Test</span><br style="font-family: monospace;"> <span style="font-family: monospace;"></TITLE></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><script language="JavaScript" src="../../org.eclipse.help/livehelp.js"> </script></span><br style="font-family: monospace;"> <span style="font-family: monospace;"></HEAD></span><br style="font-family: monospace;"> <br style="font-family: monospace;"> <span style="font-family: monospace;"><body></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><p>Execute command link to</span><br style="font-family: monospace;"> <span style="font-family: monospace;"><a href='javascript:executeCommand(</span><br style="font-family: monospace;"> <span style="font-family: monospace;"> "<span style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.ui.views.TaskList)</span>")'></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> show Tasks view</a>.</p></span><br style="font-family: monospace;"> <span style="font-family: monospace;"></body></span><br style="font-family: monospace;"> <span style="font-family: monospace;"></HTML></span><br> </td> </tr> </tbody> </table> <br> <br> <h2>Catalog of Commands</h2> What follows is a catalog of commands that may be useful in embedded document scenarios. Some of these are available today and some are not yet committed (indicated with [proposed] below). The format of the tables below is:<br> <br> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Command Name</span> - brief description and mention of parameters<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><span style="font-family: monospace;">command.id(param.id=value)</span> « <span style="font-style: italic;">example demonstrating usage</span><br> </div> </td> </tr> </tbody> </table> <br> Please refer to the JavaDoc for <span style="font-family: monospace;">ParameterizedCommand.serialize()</span> for a description of the command serialization format.<br> <br> <h3>General Workbench</h3> <small> </small><small> </small> <table style="text-align: left; width: 876px; height: 296px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show Perspective</span> - without parameters, opens a dialog with list of perspectives<br> </td> </tr> <tr style="font-family: monospace;"> <td style="vertical-align: top;"> <div style="margin-left: 40px;">org.eclipse.ui.perspectives.showPerspective</div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show Perspective</span> - parameter indicates perspective id<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><small><span style="font-family: monospace;">org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.ui.resourcePerspective)</span> </small></div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show View</span> - without parameters, opens a dialog with list of views<br> </td> </tr> <tr style="font-family: monospace;"> <td style="vertical-align: top;"> <div style="margin-left: 40px;">org.eclipse.ui.views.showView</div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show View</span> - parameter indicates view id</td> </tr> <tr style="font-family: monospace;"> <td style="vertical-align: top;"> <div style="margin-left: 40px;">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.ui.views.TaskList)</div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Window Preferences</span> [proposed] - parameter indicates which preference page (no parameter means open the main page)<br> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">New Wizard</span> [proposed] - parameter indicates id of wizard to launch<br> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Import Wizard</span> [proposed] - parameter indicates id of wizard to launch</td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Export Wizard</span> [proposed] - parameter indicates id of wizard to launch</td> </tr> <tr> <td style="vertical-align: top;">Navigator Common Wizard - figure out what this is<br> </td> </tr> </tbody> </table> <br> <h3>Workspace</h3> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open Resource</span> [proposed] - open a resource given its path and/or URI as parameter<br> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show Resource in Navigator</span> [proposed] - show in Navigator view given resource path and/or URI as parameter</td> </tr> </tbody> </table> <br> <h3>User Assistance <small><small>(see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123040">123040</a>)</small></small><br> </h3> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Display Help</span> - without parameters, opens the help system<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><span style="font-family: monospace;">org.eclipse.ui.help.displayHelp</span><br> </div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Display Help</span> - parameter indicates help topic href<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><span style="font-family: monospace;">org.eclipse.ui.help.displayHelp(href=/org.eclipse.platform.doc.user/gettingStarted/qs-02a.htm)</span><br> </div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open Cheatsheet</span> [proposed] - Chris G. indicated there would be several variants<br> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open Intro Content</span> [proposed] - look into this...<br> </td> </tr> </tbody> </table> <br> <h3>Java <small><small>(see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=123198">123198</a>)</small></small><br> </h3> Note: the examples below work on a class named <span style="font-family: monospace;">Activator</span> in a plugin called <span style="font-family: monospace;">org.test</span>. Simply create a new plugin called <span style="font-family: monospace;">org.test</span> to try these examples.<br> <br> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open JavaElement in Editor</span> - parameter encodes handle identifier of java element<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><small><span style="font-family: monospace;">org.eclipse.jdt.ui.commands.openElementInEditor(elementRef=org.test/org.test.Activator)</span></small><br> </div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show JavaElement in Package Explorer View</span> - parameter encodes handle identifier of java element</td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><small><span style="font-family: monospace;">org.eclipse.jdt.ui.commands.showElementInPackageView(elementRef=org.test/org.test.Activator)</span></small><br> </div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Show JavaElement in Type Hierarchy View</span> - parameter encodes handle identifier of java element</td> </tr> <tr style="font-family: monospace;"> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><small>org.eclipse.jdt.ui.commands.showElementInTypeHierarchyView(elementRef=org.test/org.test.Activator)<br> </small></div> </td> </tr> </tbody> </table> <br> <h3>Run/Debug</h3> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> </tbody> </table> <br> <h3>Update Manager <small><small>(see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=125071">125071</a>)</small></small><br> </h3> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open Manage Configuration Dialog</span> - opens the dialog for managing product configuration (no parameters)<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><span style="font-family: monospace;">org.eclipse.ui.update.manageConfiguration</span><br> </div> </td> </tr> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open Install/Update Feature Dialog</span> - opens the dialog for installing and updating features (no parameters)<br> </td> </tr> <tr> <td style="vertical-align: top;"> <div style="margin-left: 40px;"><span style="font-family: monospace;">org.eclipse.ui.update.findAndInstallUpdates</span><br> </div> </td> </tr> </tbody> </table> <br> <br> <h3>Browser</h3> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-weight: bold;">Open URL in Browser</span> [proposed] - parameter is URL<br> </td> </tr> </tbody> </table> <br> <br> <br> <h2>Command Embedding Contexts</h2> <h3>Help <small><small>(see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=122726">122726</a>)</small></small><br> </h3> The example above shows how to embed commands in Help.<br> <br> <h3>Cheatsheets</h3> Here's an example that shows how to embed commands in a Cheatsheet:<br> <br> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-family: monospace;"><?xml version="1.0" encoding="UTF-8"?></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><cheatsheet title="Example of Commands"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <intro></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <description>A cheat sheet which tests command support</description></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </intro></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <item title="Step 1"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <description>This is a step with a command which shows the search view.</description></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <command serialization="<span style="background-color: rgb(255, 153, 102);">org.eclipse.search.ui.views.SearchView</span>"/> </span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </item></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <item title="Step 2"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <description>This is a step with a command and parameters, shows package explorer.</description></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <command serialization="<span style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.jdt.ui.PackageExplorer)</span>"/></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </item></span><br style="font-family: monospace;"> <span style="font-family: monospace;"></cheatsheet></span><br> </td> </tr> </tbody> </table> <br> Note also that bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=125420">125420</a> proposes an enhancement to declare command return types. If this is accepted there will be a mechanism to capture the return type in the cheatsheet data store (so we need an example of that).<br> <br> <h3>Intro <small><small>(see bugs <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124060">124060</a>, <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124076">124076</a>, <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=124573">124573</a>)</small></small><br> </h3> Here's an example that shows how to embed commands in Intro content:<br> <br> <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="font-family: monospace;"><?xml version="1.0" encoding="UTF-8" ?></span><br style="font-family: monospace;"> <span style="font-family: monospace;"><introContent></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <!-- Extension to the SDK What's New Page. --></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <extensionContent path="news/page-content/noteworthy-links/pdeAnchor"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <link label="Test News1"</span><br style="font-family: monospace;"> <span style="font-family: monospace;"> url="http://org.eclipse.ui.intro/execute?command=<span style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView()</span>&amp;standby=true"</span><br style="font-family: monospace;"> <span style="font-family: monospace;"> id="pde-noteworthy" style-id="noteworthy-link"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <text>This is a test</text></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </link></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <link label="Test News2"</span><br style="font-family: monospace;"> <span style="font-family: monospace;">url="http://org.eclipse.ui.intro/execute?command=<span style="background-color: rgb(255, 153, 102);">org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId%3dorg.eclipse.jdt.ui.PackageExplorer)</span>&amp;standby=true"</span><br style="font-family: monospace;"> <span style="font-family: monospace;"> id="pde-noteworthy" style-id="noteworthy-link"></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> <text>This is another test</text></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </link></span><br style="font-family: monospace;"> <span style="font-family: monospace;"> </extensionContent></span><br style="font-family: monospace;"> <span style="font-family: monospace;"></introContent></span><br> </td> </tr> </tbody> </table> <br> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 123921
:
33044
|
33132
|
33685
|
33881
|
34409
|
34444
|
34981
|
35216