beautypg.com

Adobe Dreamweaver API Reference CS5 User Manual

Page 147

background image

142

DREAMWEAVER API REFERENCE

Workspace

Last updated 8/27/2013

Note: This function is supported only in the Validation, Browser Compatibility Check, and Site Reports panels of the
Results panel group.

Arguments
floaterName, floaterIndex

The floaterName argument is a string that specifies the results floating panel to open. Valid values are
'

validation'

, or

'reports'

.

The floaterIndex argument is a number or string. Use a number to specify the index of an item to select in the
Results panel. Use a string to specify the URL of a document. If you specify a URL, the function selects the first
visible item for that document.

Returns
Nothing.

Example
The following example checks for errors at the offset of the current selection in the document and, if errors are present,
displays them in the specified window (

floaterName

) of the Results panel. Otherwise, it opens the Browser

Compatibility Check window of the Results panel and displays the first visible item for the current document.

var offset = dw.getDocumentDOM().source.getSelection()[0];

var errors = dw.getDocumentDOM().source.getValidationErrorsForOffset(offset);
if ( errors && errors.length > 0 )

dw.showResults( errors[0].floaterName, errors[0].floaterIndex );

else

dw.showResults('bcc', dw.getDocumentDOM().URL);

dreamweaver.resultsPalette.siteReports.addResultItem()

Availability
Dreamweaver 4.

Description
Adds a new results entry to the Site Reports panel, based on the information in the file that the

processfile()

function processes.

This function is only available in the

processFile()

callback of a site report. For details on site reports, see “Reports”

in Extending Dreamweaver.

Arguments
strFilePath, strIcon, strDisplay, strDesc, {iLineNo}, {iStartSel}, {iEndSel}

The strFilePath argument is a fully qualified URL path of the file to process.

The strIcon argument is the path to the icon to use. To display a built-in icon, use a value "1" through "10" instead
of the fully qualified path for the icon (use "0" for no icon). The following table shows the icons that correspond to
the values of "1" through "10":