beautypg.com

How property inspector files work – Adobe Extending Dreamweaver CS4 User Manual

Page 221

background image

215

EXTENDING DREAMWEAVER CS4

Property inspectors

The

serverModel

element (optional) indicates the server model of the Property inspector. The server model of the

Property inspector must be the same as the Property inspector of the document. If not, Dreamweaver does not use
the Property inspector to display the properties of the current selection. For example, consider, the server model of
a document is Adobe ColdFusion. But, the server model of the Property inspector is ASP. Then, Dreamweaver does
not use that Property inspector for selections in the document.

The following comment is appropriate for an inspector that is designed to inspect the

happy

tag:

In some cases, specifying that your extension uses only Dreamweaver extension rendering and not the previous
rendering engine is a must. You can do it by inserting the following line immediately before the tag comment, as shown
in the following example:

The body section of a Property inspector file contains an HTML form. Instead of displaying the form contents in a
dialog box, Dreamweaver uses the form to define the input areas and layout of the Property inspector.

The head section of a Property inspector file contains JavaScript functions or a reference to the JavaScript file or files.

How Property inspector files work

At start-up, Dreamweaver reads the first line of each HTM and HTML file in the Configuration/Inspectors folder,
searching for the comment string that defines the type, priority, and selection type of a Property inspector. Files that
do not have this comment as their first line are ignored.

When the user makes a selection in Dreamweaver or moves the insertion point to a different location, the following
events occur:

1

Dreamweaver searches for any inspectors that have a

within

selection type.

2

If there are any

within

inspectors, Dreamweaver searches up the document tree from the currently selected tag to

check whether there are inspectors for any tags that surround the selection. If there are no

within

inspectors,

Dreamweaver searches for any inspectors that have a selection type of

exact

.

3

For the first tag that has one or more inspectors, Dreamweaver calls each inspector’s

canInspectSelection()

function. If this function returns the value

false

, Dreamweaver no longer considers the inspector a candidate for

inspecting the selection.

4

If more than one potential inspector remains after calling the

canInspectSelection()

function, Dreamweaver

sorts the remaining inspectors by priority.

5

If more than one potential inspector shares the same priority, Dreamweaver selects an inspector alphabetically by name.

6

The selected inspector appears in the Property inspector floating panel. If the Property inspector file defines the

displayHelp()

function, a small question mark (?) icon appears in the upper-right corner of the inspector.

7

Dreamweaver calls the

inspectSelection()

function to gather information about the current selection and

populate the inspector’s fields.

8

Event handlers attached to the fields in the Property inspector interface execute as the user encounters them. (For
example, you might have an

onBlur

event that calls the

setAttribute()

function to set an attribute to the value

that the user enters.)

This manual is related to the following products: