Attribute Order Dialog
This dialog lets you reorder mxml attributes during a Format.
Don't use custom attribute order and line breaks
If this box is checked, don't change the order of attributes or use any custom line wrapping configuration.
Order of attributes
In this table, add the attribute names that you want to see in a particular order. Many people would want to add 'id',
perhaps others. Each row in the table is a group of attributes. It could be a single attribute, or it could be a
comma-separated list of attributes with a newline at the end. The second case would mean that all the attributes in
the set (that exist) should appear in the given order in any tag, and a newline should be inserted after the last existing
attribute, so that following attributes will start on a new line. No newline will be added if none of the attributes
exist. Creating a group with only linebreaks (no attributes) means that the linebreaks will always be added (unless
there are no attributes in the tag). It makes most sense to include a linebreak in each attribute group (if you want one).
A linebreak can also be included in its own group (as the first group in the list) to insert a newline before the first
attribute in any tag. Extra line breaks beyond the last attribute in a tag will be trimmed.
Operations
Delete
Remove the currently selected row from the table
Move up/down
Use these buttons to reorder rows in the table.
Add line break
Adds a line break to the current row in the edit field
Add attr group
Add a reference to a group (a list of attributes) to the current row in the edit field. The available groups are listed
in the combo box beside the button. Use the Edit groups... button to add/edit/delete groups of attributes.
Add
Add the current row definition to the table. This will be disabled if any element in the row already exists in the table.
Update
Modify the currently selected row definition in the table with the contents of the edit field. This button will be disabled
if there is no row selected or if the contents of the edit field intersect the contents of another table row.
Simple Examples
- id, \n
The id attribute will always be listed first, if present, and subsequent attributes will start on a new line
- id, \n on first line, x,y on second line
The id attribute will always be listed first, if present. The second line will contain x and y, if they exist.
Further attributes will appear on the same line with x and y, persuant to the wrapping options set on the main
MXML preference page.
Sort remaining attrs
If this box is checked, all left-over attributes (that are not referenced in the table above) will be sorted in ascending
alphabetical order.
Add newline before tag close
If this box is checked, the end symbol for the tag (> or />) will be moved to the next line. Otherwise, it will appear
immediately after the last attribute in the tag. This option is the only way to have a line break after the last attribute
in a tag.