User Guide
The Commands API 137
Returns
Dreamweaver expects an array that contains an even number of elements. The first element is a
string that contains the label for the topmost button. The second element is a string of JavaScript
code that defines the behavior of the topmost button when it is clicked. The remaining elements
define additional buttons in the same way.
Example
The following instance of commandButtons() defines three buttons: OK, Cancel, and Help:
function commandButtons(){
return new Array("OK" , "doCommand()" , "Cancel" , ¬
"window.close()" , "Help" , "showHelp()");
}
isDomRequired()
Description
Determines whether the command requires a valid DOM to operate. If this function returns a
value of
true or if the function is not defined, Dreamweaver assumes that the command requires
a valid DOM and synchronizes the Design and Code views of the document before executing.
Synchronization causes all edits in the Code view to update in the Design view.
Arguments
None.
Returns
Dreamweaver expects a true value if a command requires a valid DOM to operate;
false otherwise.
receiveArguments()
Description
Processes any arguments that pass from a menu item or from the dw.runCommand() function.
Arguments
{arg1}, {arg2},...{argN}
• If the arguments attribute is defined for a menuitem tag, the value of that attribute passes to
the
receiveArguments() function as one or more arguments. Arguments can also pass to a
command by the dw.runCommand() function.
Returns
Dreamweaver expects nothing.