19.5 Web and XML

The Web and XML preferences let you specify how Designer should handle editing and creation of CSS, HTML, and JavaScript* files.

19.5.1 CSS Files

The CSS Files preferences allow you to specify how Designer displays and manages CSS files.

Figure 19-15 Preferences: Web and XML > CSS Files

Table 19-36 Preferences: Web and XML > CSS Files Settings

Preference

Description

Creating or saving files: Line Delimiter

Sets the type of line delimiter applied to newly created files. The options are:

  • Windows

  • Unix

  • Mac

  • No translation

Creating files: Add this suffix

The file suffix the editor adds when creating files. The default is CSS.

Creating files: Encoding

The encoding used for new files.

CSS Source

Figure 19-16 Preferences: Web and XML > CSS Files > Source

Table 19-37 Preferences: Web and XML > CSS Files > Source Settings

Setting

Description

Formatting: Line width

Specifies the number of characters in a line.

Formatting: Insert line break between properties

Specifies whether the editor should insert a line between the CSS properties.

Formatting: Disable wrapping in style attribute of HTML

Specifies whether the HTML editor (used in the e-mail notification template editor) should allow wrapping of the value of a style attribute.

Formatting: Indent using tabs > or spaces

Formatting: Indentation size

Specifies how the first line of text indents.

Specifies the size of the indent.

Formatting: Capitalization style

Specifies the default case for identifiers, property names, and property values.

Syntax Coloring

Figure 19-17 Preferences: Web and XML > CSS Files > Syntax Coloring

Table 19-38 Preferences: Web and XML > CSS Files > Syntax Coloring Settings

Setting

Description

Syntax Element

Choose the content type for which you want to define a style.

Foreground/Background/Bold/Italic/Strikethrough/Underline

Specifies the syntax highlighting and formatting for individual CSS elements.

Sample Text

Displays sample CSS with the selected syntax coloring options.

19.5.2 HTML Files

The HTML Files preferences allow you to specify how Designer displays and manages HTML files and content.

Figure 19-18 Preferences: Web and XML > HTML Files

Table 19-39 Preferences: Web and XML > HTML Files Settings

Preference

Description

Creating or saving files: Line Delimiter

Choices are:

  • Windows

  • Unix

  • Mac

  • No translation

Creating files: Add this suffix

Specifies the file suffix the editor should add when creating a new file. The default is html.

Creating files: Encoding

Specifies the editor’s encoding for new files.

Loading files

Choose the encoding for files opened in the editor. Click Use workbench encoding to accept the default UTF-8, or select one from the list.

HTML Source

Figure 19-19 Preferences: Web and XML > HTML Files > Source

Table 19-40 Preferences: Web and XML > HTML Files > Source Settings

Setting

Description

Formatting: Line Width

Specifies the number of characters for each line.

Formatting: Split multiple attributes each on a new line

Specifies what the editor should do with multiple attributes.

Formatting: Align final bracket in multi-line element tags

Specifies what the editor should do with final brackets

Formatting: Clear all blank lines

Specifies what the editor should do with blank lines

Formatting: Indent using tabs or spaces

Indentation size

Specifies whether the indent should be using tabs or spaces and also the indentation size.

Content assist: Automatically make suggestions

Specifies whether to do automatic code completion.

Content assist: Prompt when these characters are inserted

Specifies the characters that initiate the content assist.

Preferred markup: Tag Names/Attribute Names

Specifies if the editor’s suggestions should be in uppercase or lowercase.

HTML Styles

Figure 19-20 Preferences: Web and XML > HTML Files > Syntax Coloring

Table 19-41 Preferences: Web and XML > HTML Files > Syntax Coloring Settings

Setting

Description

Syntax Element

Choose the content type for which you want to define a style.

Foreground/Background/Bold/Italic/Strikethrough/Underline

Specifies the syntax highlighting and formatting for individual CSS elements.

Sample Text

Displays sample CSS with the selected syntax coloring options.

HTML Templates

Figure 19-21 Preferences: Web and XML > HTML Files > Templates

Table 19-42 Preferences: Web and XML > HTML Files > Templates Settings

Setting

Description

Templates

The templates are used in the code completion in source editor.

Use this preference to add, remove or edit templates.

19.5.3 JavaScript Files

Changes how JavaScript files are created.

Figure 19-22 Preferences: Web and XML > JavaScript Files

Table 19-43 Preferences: Web and XML > JavaScript Files Settings

Setting

Description

Creating or saving files: Line delimiter

Sets what type of line delimiter is applied to the file. The options are:

  • No translation

  • UNIX

  • Mac

  • Windows

Creating files: Add this suffix (if not specified)

Sets the suffix for the file. The default value is js. It can be set to any value.

JavaScript Validation

Allows the editor to validate the JavaScript as it is entered. Select Automatically validate scripts to automatically validate the scripts. If it is not selected, the JavaScript is not validated.

Figure 19-23 Preferences: Web and XML > JavaScript Files > JavaScript Validation

Source

Changes the formatting for the source JavaScript files.

Figure 19-24 Preferences: Web and XML > JavaScript Files > Source

Table 19-44 Preferences: Web and XML > JavaScript Files > Source Settings

Setting

Description

Formatting

Sets the formatting for the editor. The options are:

  • Indent using tabs

  • Indent using spaces

  • Indentation size: Changes the indentation size by setting a numeric value.

Content assist

Helps with prompts when creating the files.

Automatically make suggestions: Can be enabled or disabled if the check box is selected.

Prompt when these characters are inserted: Allows you to receive prompts when the specified characters are entered.

Syntax Coloring

Customizes the syntax highlighing in the ECMAScript editor. The default colors and fonts can be configured on the Text editors and on the Colors and Fonts preference page.

Figure 19-25 Preferences: Web and XML > JavaScript Files > Syntax Coloring

Table 19-45 Preferences: Web and XML > JavaScript Files > Syntax Coloring Settings

Setting

Description

Syntax Element

Choose the content type for which you want to define a style.

Foreground/Background/Bold/Italic/Strikethrough/Underline

Specifies the syntax highlighting and formatting for individual CSS elements.

Sample Text

Displays sample CSS with the selected syntax coloring options.

19.5.4 Task Tags

Figure 19-26 Preferences: Web and XML > Task Tags

The Task Tag preferences allow you to specify whether Designer should search for task tags and which task tags to display in the Task view. If Enable searching for Task Tags is not selected, Designer does not search for task tags. If you do not use the Task view, make sure this option is not selected because the search can affect Designer’s performance.

The TODO and FIXME task tags are defined by default, but you can specify additional tags by selecting New and completing the Task Tag dialog box. Use the Filters tab to specify the file types that Designer should search for the selected task tags.

19.5.5 XML Catalog

The XML Catalog preferences allow you to manage the WST XML catalog implementation. You can add, edit, or delete user-specified catalogs. You cannot use this preference to manage the plug-in specified entries.The XML editor uses the WST XML catalog implementation to resolve XML schema and DTD references for associating URLs, system, and public identifiers with URLs.

Figure 19-27 Preferences: Web and XML > JavaScript > XML Catalog

To add a user-specified entry:

  1. Click Add.

  2. Fill in the fields as follows:

    Field

    Description

    Location

    Specify a location on disk or a URL of the schema or DTD. Use the Search button to search Designer’s workspace or the file system.

    Key Type

    Specify the key type. Values are public identifiers for DTDs or URIs for XML schemas.

    Key

    Specify a unique key

    Specify alternative web address

    Optionally, specify an alternative Web address for locating the schema or DTD.

  3. Click OK to save.

19.5.6 XML Files

You can set the following general XML File preferences:

Figure 19-28 Preferences: Web and XML > XML Files

Table 19-46 Preferences: Web and XML > XML Files

Category

Preference

Description

Creating or saving files

Line delimiter

Choices are:

  • Windows

  • Unix

  • Mac

  • No translation

Creating files

Add this suffix

The file suffix. The default is XML.

 

Encoding

The encoding used by the editor

Validating files

Warn when no grammar is specified

Specifies whether to display a warning when no grammar (such as XML Schema or DTD) is associated with the XML document.

XML Source

You can set the following XML Source preferences:

Figure 19-29 Preferences: Web and XML > XML Files > Source

Table 19-47 Preferences: Web and XML > XML Files > Source Settings

Category

Preference

Description

Formatting

Line width

Specifies the number of characters in a line. Default is 72.

 

Split multiple attributes each on a new line

Specifies how attributes are formatted (whether to show each attribute on a separate line).

 

Align final bracket in multi-line element tags

Allows you to allign the final bracket “>” in multi-line element tags.

 

Preserve whitespace in tags with PCDATA content

Specifies whether to preserve any whitespaces that are in tags containing PCDATA content.

 

Clear all blank lines

Specifies whether blank lines are removed when formatting.

 

Indent using tabs/ or spaces

Indentation size

Specifies whether to use tabs or spaces as indentation and indentation size.

Content Assist

Automatically make suggestions

Specifies whether to do automatic code completion.

 

Prompt when these characters are inserted

The list of characters that initiate code completion.

 

Suggestion strategy

Specifies whether to use Lax or Strict grammar when making suggestions

Grammar constraints

Use inferred grammar in absence of DTD/Schema

Specifies whether to display code completion suggestions based on existing content of the XML document.

Syntax Coloring

The XML syntax coloring lets you specify the syntax highlighting (foreground and background color) and the text formatting for individual XML constructs.

Figure 19-30 Preferences: Web and XML > XML Files > Syntax Coloring

Table 19-48 Preferences: Web and XML > XML Files > Syntax Coloring Settings

Setting

Description

Syntax Element

Choose the content type for which you want to define a style.

Foreground/Background/Bold/Italic/Strikethrough/Underline

Specifies the syntax highlighting and formatting for individual CSS elements.

Sample Text

Displays sample CSS with the selected syntax coloring options.

XML Templates

Use the XML Templates preference page to define XML templates. The templates are used in the code completion in the XML Source Editor. For example, selecting the XSL Processing Instruction template in the code completion inserts <?xml-stylesheet type=”text/xsl” href=””?> in the source editor and places the cursor in the href value.

Figure 19-31 XML Templates Preference