Adobe Extending Dreamweaver CS4 User Manual
Page 326
320
EXTENDING DREAMWEAVER CS4
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;
enabled
JavaScript code that returns a Boolean value (
true
or
false
). The enablers are called when the following
conditions exist:
•
When the
dreamweaver.serverComponents.refresh()
function is called
•
When the selection in the tree changes
•
When server model changes
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