*** empty log message ***
diff --git a/org.eclipse.ui.intro/schema/introContentFileSpec.html b/org.eclipse.ui.intro/schema/introContentFileSpec.html
index d0ea90a..f19e7a1 100644
--- a/org.eclipse.ui.intro/schema/introContentFileSpec.html
+++ b/org.eclipse.ui.intro/schema/introContentFileSpec.html
@@ -119,6 +119,11 @@
no parameters required<br>
<br>
+<b>execute</b> - executes the specified command. See the <code>serialize()</code> method on <code>org.eclipse.core.command.ParameterizedCommand</code> for details of the command serialization format. Since 3.2.<br>
+<i>command</i> - a serialized <code>ParameterizedCommand</code><br>
+<i>standby (optional) = ("true" | "false") "false"</i> - indicate whether to set the intro into standby mode after executing the command<br>
+<br>
+
<b>navigate</b> - navigate through the intro pages in a given direction or return to the home page<br>
<i>direction = ("backward" | "forward" | "home")</i> - specifies the direction to navigate<br>
<br>
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java
index 57dea59..8285dba 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java
@@ -16,6 +16,8 @@
import java.util.Hashtable;
import java.util.Properties;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.CommandException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.util.Geometry;
@@ -24,9 +26,11 @@
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.internal.RectangleAnimation;
import org.eclipse.ui.internal.intro.impl.IIntroConstants;
import org.eclipse.ui.internal.intro.impl.IntroPlugin;
@@ -83,6 +87,7 @@
public static final String SHOW_MESSAGE = "showMessage"; //$NON-NLS-1$
public static final String NAVIGATE = "navigate"; //$NON-NLS-1$
public static final String SWITCH_TO_LAUNCH_BAR = "switchToLaunchBar"; //$NON-NLS-1$
+ public static final String EXECUTE = "execute"; //$NON-NLS-1$
/**
* Constants that represent valid action keys.
@@ -99,6 +104,7 @@
public static final String KEY_EMBED = "embed"; //$NON-NLS-1$
public static final String KEY_EMBED_TARGET = "embedTarget"; //$NON-NLS-1$
public static final String KEY_DECODE = "decode"; //$NON-NLS-1$
+ public static final String KEY_COMAND = "command"; //$NON-NLS-1$
public static final String VALUE_BACKWARD = "backward"; //$NON-NLS-1$
@@ -185,6 +191,10 @@
// the parameters and the standby state.
return runAction(getParameter(KEY_PLUGIN_ID),
getParameter(KEY_CLASS), parameters, getParameter(KEY_STANDBY));
+
+ else if (action.equals(EXECUTE))
+ // execute a serialized command
+ return executeCommand(getParameter(KEY_COMAND), getParameter(KEY_STANDBY));
else if (action.equals(SHOW_PAGE))
// display an Intro Page.
@@ -297,6 +307,44 @@
return false;
}
}
+
+ /**
+ * Executes a serialized <code>ParameterizedCommand</code>. Uses
+ * {@link ICommandService#deserialize(String)} to convert the <code>command</code> argument
+ * into the parameterized command.
+ */
+ private boolean executeCommand(String command, String standbyState) {
+ ICommandService commandService = getCommandService();
+ if (commandService == null) {
+ Log.error("Could not get ICommandService while trying to execute: " + command, null); //$NON-NLS-1$
+ return false;
+ }
+
+ try {
+ ParameterizedCommand pCommand = commandService.deserialize(command);
+ pCommand.executeWithChecks(null, null);
+
+ // Executed command successfully. Now set intro standby if needed.
+ if (standbyState == null)
+ return true;
+ return setStandbyState(standbyState);
+ } catch (CommandException ex) {
+ Log.error("Could not execute command: " + command, ex); //$NON-NLS-1$
+ return false;
+ }
+ }
+
+ private ICommandService getCommandService() {
+ IWorkbench wb = PlatformUI.getWorkbench();
+ if (wb != null) {
+ Object serviceObject = wb.getAdapter(ICommandService.class);
+ if (serviceObject != null) {
+ ICommandService service = (ICommandService)serviceObject;
+ return service;
+ }
+ }
+ return null;
+ }
/**