Adobe 38040334 API Reference - Page 394
dreamweaver.codeHints.addMenu
UPC - 883919090467
View all Adobe 38040334 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 394 highlights
DREAMWEAVER CS3 389 API Reference You can also add new Code Hints menus dynamically through JavaScript after Dreamweaver loads the contents of the CodeHints.xml file. For example, JavaScript code populates the list of session variables in the Bindings panel. You can use the same code to add a Code Hints menu, so when a user types Session in Code view, Dreamweaver displays a menu of session variables. The CodeHints.xml file and the JavaScript API expose a useful subset of the Code Hints engine, but some Dreamweaver functionality is not accessible. For example, there is no JavaScript hook to open a color picker, so Dreamweaver cannot express the Attribute Values menu using JavaScript. You can only open a menu of text items from which you can insert text. Code Coloring lets you specify code color styles and to modify existing code coloring schemes or create new ones. You can specify code coloring styles and schemes by modifying the Colors.xml and code coloring scheme files. For more information on these files, see Extending Dreamweaver. The JavaScript API for Code Hints and Code Coloring consists of the following functions. dreamweaver.codeHints.addMenu() Availability Dreamweaver MX. Description Dynamically defines a new menu tag in the CodeHints.xml file. If there is an existing menu tag that has the same pattern and document type, this function adds items to the existing menu. Arguments menuGroupId, pattern, labelArray, {valueArray}, {iconArray}, {doctypes}, {casesensitive} • The menuGroupId argument is the ID attribute for one of the menugroup tags. • The pattern argument is the pattern attribute for the new menu tag. • The labelArray argument is an array of strings. Each string is the text for a single menu item in the pop-up menu. • The valueArray argument, which is optional, is an array of strings, which should be the same length as the labelArray argument. When a user selects an item from the pop-up menu, the string in this array is inserted in the user's document. If the string to be inserted is always the same as the menu label, this argument might have a null value. • The iconArray argument, which is optional, is either a string or an array of strings. If it is a string, it specifies the URL for a single image file that Dreamweaver uses for all items in the menu. If it is an array of strings, it must be the same length as the labelArray argument. Each string is a URL, relative to the Dreamweaver Configuration folder, for an image file that Dreamweaver uses as an icon for the corresponding menu item. If this argument is a null value, Dreamweaver displays the menu without icons. • The doctypes argument, which is optional, specifies that this menu is active for only certain document types. You can specify the doctypes argument as a comma-separated list of document type IDs. For a list of Dreamweaver document types, see the Dreamweaver Configuration/Documenttypes/MMDocumentTypes.xml file. • The casesensitive argument, which is optional, specifies whether the pattern is case-sensitive. The possible values for the casesensitive argument are the Boolean values true or false. The value defaults to false if you omit this argument. If the casesensitive argument is a true value, the Code Hints menu appears only if the text that the user types exactly matches the pattern that the pattern attribute specifies. If the casesensitive argument is a false value, the menu appears even if the pattern is lowercase and the text is uppercase.