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);
}
Содержание DREAMWEAVER 8-EXTENDING DREAMWEAVER
Страница 1: ...Extending Dreamweaver...
Страница 8: ...8 Contents...
Страница 14: ...14 Introduction...
Страница 16: ......
Страница 54: ...54 Customizing Dreamweaver...
Страница 96: ...96 Customizing Code View...
Страница 98: ......
Страница 110: ...110 Extending Dreamweaver...
Страница 138: ......
Страница 166: ...166 Insert Bar Objects...
Страница 180: ...180 Commands...
Страница 248: ...248 Toolbars...
Страница 260: ...260 Reports...
Страница 278: ...278 Tag Libraries and Editors...
Страница 288: ...288 Property Inspectors...
Страница 378: ...378 Server Behaviors...
Страница 398: ...398 Data Sources...
Страница 432: ...432 Server Models...
Страница 456: ...456 Data Translators...
Страница 482: ......
Страница 492: ...492 The Shared Folder...