Macromedia Dreamweaver MX 2004 Demystified

[ LiB ]

Dreamweaver extensions are constructed following the Dreamweaver application programming interface (API), which consists of all the procedures, file construction specifications, custom functions, and formatting instructions that determine how and when commands will be processed and dialog boxes will appear, and so on. Learning how to write your own extensions means becoming familiar with the API. The official "dictionary" that explains and documents the API is Macromedia's Extending Dreamweaver manual. This manual comes in PDF format on the Dreamweaver application CD-ROM; you also can download the PDF from the Macromedia website (www.macromedia.com/support/dreamweaver/).

How Extensions are Constructed

Each extension (object, behavior, command, inspector, floating panel, report, translator, and so on) consists of one or more files in the Configuration folder. The file types are as follows :

Every rule has an exception. Although most extensions exist in HTML and JS files, it is possible to create simple extensions that exist solely as command lines built into menus .xml . How that works is beyond the scope of this chapter.

In addition to these files, each extension might have an entry in one of the XML files, such as menus.xml or insertbar.xml , that Dreamweaver uses to populate many of its interface elements.

How Extensions are Processed

For each extension type, the Dreamweaver API has a procedure that determines how the extension's JavaScript instructions will be processed. This procedure often involves custom JavaScript functions that Dreamweaver executes automatically at certain times (on startup, when the user clicks something, and so on).

How Extensions Talk to Dreamweaver

How does an extension tell Dreamweaver to open a new document, insert or edit document contents, or whatever else you want it to do? The API includes a variety of predefined JavaScript objects, each of which contains various methods (functions) that you use to communicate with different parts of the program:

In addition to these main objects, other custom JavaScript objects give you access to specific areas of Dreamweaver, such as working with web servers (the MMHttp object), working with Flash and Fireworks ( SWFFile, FWLaunch ), working with Design Notes ( MMNotes ), and so on. All these objects, methods, and properties are detailed in the Extending Dreamweaver manual, mentioned earlier.

[ LiB ]

Категории