The toolbar command API
239
canAcceptCommand()
Availability
Dreamweaver MX.
Description
Determines whether the toolbar item is enabled. The enabled state is the default condition for
an item, so you should not define this function unless it returns a
false
value in at least one
case.
Arguments
For pop-up menus, combo boxes, text boxes, and color pickers, the first argument is the
current value within the control. The
getDynamicContent()
function can optionally attach
individual IDs to items within a pop-up menu. If the selected item in the pop-up menu has
an ID attached, Dreamweaver passes that ID to
canAcceptCommand()
instead of the value.
For combo boxes, if the current contents of the text box do not match an entry in the pop-up
menu, Dreamweaver passes the contents of the text box. Dreamweaver compares against the
pop-up menu without case-sensitivity to determine whether the contents of the text box
match an entry in the list.
If you specify the
arguments
attribute for this toolbar item in the toolbars.xml file, those
arguments are passed next. If you did not specify the
arguments
attribute, Dreamweaver
passes the ID of the item.
Returns
Dreamweaver expects a Boolean value;
true
if the item is enabled;
false
otherwise.
Example
function canAcceptCommand()
{
return (dw.getDocumentDOM() != null);
}
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...