8. Editing node attributes
Prev |  | Next

## 8. Editing node attributes

Double-clicking any attribute value displayed in the tree shows a simple value editor, where the value of the attribute can be changed (note however that some annotation modes disable editing certain or all attributes - in that case, the value editor presentes the attribute value as read-only).

Usually not all attributes are displayed in the tree. In that case it is necessary to use the Edit Node dialog, which can be invoked either by double-clicking on the desired node in the tree, by activating the node and pressing Enter, or by activating the node and selecting Node → Edit Node Attributes... from the menu.

The Edit Node dialog shows all attributes defined for the type of the node or for the file and their corresponding values at the selected node. Depending on the type of the file, the dialog may have one of two possible interfaces, here refered to as the old interface (see Figure 3, “The old interface”) and the new interface (see Figure 4, “The new interface”).

### 8.1. Old interface

Displays the dialog box Edit Node, listing all attributes defined for the type of the node or for the file and their corresponding values at the active node. Depending on the type of the file, the dialog may have one of two possible interfaces, here refered to as the old interface (see Figure 3, “The old interface”) and the new interface (see Figure 4, “The new interface”).

The old interface supports attributes of the following types: strings, `|`-separated lists of strings, enumerated values, and `|`-separated lists of enumerated values. In the old interface, only plain string values can be edited directly. Any other attribute value can be edited in a dedicated sub-dialog, which appears after clicking on the button labeled ... beside them.

Figure 3. The old interface

### 8.2. New interface

The new interface (now default for PML-based files and files in FS format) offers support for string attributes, enumerated attributes, constant attributes, `Treex::PML::List` lists of values of an arbitrary type, `Treex::PML::Alt` alternatives of values, and `Treex::PML::Seq` sequences of named elements), and, most importantly, for hierarchical attributes (`Treex::PML::Struct` and `Treex::PML::Container`). Alternatives consisting of `|`-separated lists of strings used by FS format files are supported too.

Colors are used to visually differentiate items and buttons of various data types. Specifically, required attributes are listed in blue, other attributes are brown. Pale yellow background is used for structures and containers, pink for lists, green for alternatives, and blue for sequences. Orange color is used for `|`-separated alternatives.

Figure 4. The new interface

In this interface, the hierarchy of attributes is presented as a collapsible tree. The leafs of the tree represent the editable (string or enumerated) values.

Enumerated values can be selected from a combo-box with a search-as-you-type functionality. Lists, alternatives, sequences and/or their members have additional buttons beside their tree-entry for adding new members, removing members, and altering the order of members, as listed in Table 1, “Buttons in the new Edit Node interface”.

Table 1. Buttons in the new Edit Node interface

Button | Keyboard shortcut | Description
--- | --- | ---
| Ctrl++ | add a new member to a list
| Ctrl+- | remove the current member from a list
| Ctrl+up | move the current member up in an ordered list
| Ctrl+down | move the current member down in an ordered list
| Ctrl+* | add an alternative value
| Ctrl+/ | remove the current alternative value
| Ctrl+# | create/delete a structure
| Ctrl++ | add a new element to a sequence (a menu pops up to select name)
| Ctrl+- | remove the current element from a sequence
| Ctrl+up | move the current element up in a sequence
| Ctrl+down | move the current element down in a sequence
| Ctrl+* | add an alternative value to a `|`-separated FS-alternative
| Ctrl+/ | remove the current value from a `|`-separated FS-alternative

Prev |  | Next
7. Basic tree editing using mouse and keyboard | Home | ToC | 9. Tree Orientation