}
public void dispatchCommand(JavaScriptObject jsCommand)
{
// cast
PresentationCommand command = jsCommand.cast();
// crack parameters
String param1 = null, param2 = null;
String params = command.getParams();
if (params.length() > 0)
{
// find the first space and split on that
int spaceLoc = params.indexOf(' ');
if (spaceLoc == -1)
{
param1 = params;
}
else
{
param1 = params.substring(0, spaceLoc);
param2 = params.substring(spaceLoc+1);
}
}
String cmdName = command.getName().toLowerCase();
if (cmdName.equals("source"))
performSourceCommand(param1, param2);
else
performOtherCommand(cmdName, params, param1, param2);