| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script> |
| <title>Defining a custom IntroURL action</title> |
| </head> |
| <body> |
| |
| <h2>Defining a custom IntroURL action</h2> |
| |
| <p> |
| Using the <b><a href="../reference/extension-points/org_eclipse_ui_intro_configExtension.html">org.eclipse.ui.intro.configExtension</a></b> |
| extension point, plug-ins can contribute their own custom actions that can be used as a <b>url</b> value for a link element in a page. |
| For example, consider the following link: |
| </p> |
| <p><tt>http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction&amp;id=org.eclipse.sdk.samples.swt.examples</tt></p> |
| <p>This IntroURL will run an action class called <b>ShowSampleAction</b>, which is in a package "org.eclipse.pde.ui.internal.samples" in the plug-in |
| "org.eclipse.pde.ui". The id of the sample to run is "org.eclipse.sdk.samples.swt.examples". |
| </p> |
| <p>To define a custom version of this intro URL, you can use the following markup:</p> |
| |
| <pre> |
| <extension point="org.eclipse.ui.intro.configExtension"> |
| <action |
| name="myCommand" |
| <b>replaces="runAction?pluginId=org.eclipse.pde.ui&amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction"</b>> |
| </action> |
| </extension> |
| </pre> |
| |
| With the above extension you can now use the following URL to run the same action: |
| <p><tt>http://org.eclipse.ui.intro/myCommand?id=org.eclipse.sdk.samples.swt.examples</tt></p> |
| <p> |
| The action "myCommand" will be replaced by the value of the <b>replaces</b> attribute and any remaining URL |
| parameters will be appended to the end. Once the substitution is made, the resulting URL will be expanded back into:</p> |
| <p><tt>http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction&amp;id=org.eclipse.sdk.samples.swt.examples</tt></p> |
| |
| </body> |
| </html> |