User Guide
324 Chapter 18: Components
Arguments
None.
Returns
An array of toolbar buttons in left-to-right order.
Example
The following example assigns properties to the toolbar buttons:
function toolbarControls()
{
var toolBarBtnArray = new Array();
dom = dw.getDocumentDOM();
var plusButton = new ToolbarControlRec();
var aServerModelName = null;
if (dom && dom.serverModel)
{
aServerModelName = dom.serverModel.getDisplayName();
}
else
{
//look in the site for potential server model
aServerModelName = site.getServerDisplayNameForSite();
}
if (aServerModelName.length)
{
if(aServerModelName == "ColdFusion")
{
plusButton.image= PLUS_BUTTON_UP;
plusButton.pressedImage= PLUS_BUTTON_DOWN;
plusButton.disabledImage= PLUS_BUTTON_UP;
plusButton.toolStyle= "left";
plusButton.toolTipText= MM.MSG_WebServicesAddToolTipText;
plusButton.enabled= "dwscripts.IS_WIN";
plusButton.command= "invokeWebService()";
}
else
{
plusButton.image= PLUSDROPBUTTONUP;
plusButton.pressedImage= PLUSDROPBUTTONDOWN;
plusButton.disabledImage= PLUSDROPBUTTONUP;
plusButton.toolStyle= "left";
plusButton.toolTipText= MM.MSG_WebServicesAddToolTipText;
plusButton.enabled= "dwscripts.IS_WIN";
plusButton.menuId = "DWWebServicesChoosersContext";
}
command
The JavaScript code to execute. The command handler can force a refresh using
the
dreamweaver.serverComponents.refresh() function.
menuId
The unique menu ID for the pop-up menu button when the button is clicked.
When this ID is present, it overrides the command handler. In other words, the
button can be either a button associated with a command, or a button that has a
pop-up menu associated with it, but not both at the same time.
Property Name Description