Author: Maya Venkatraman
The first section in this document describes the parts of the tree controls and its salient states. The second section looks at the behaviors, actions and patterns that this control should support. The third section discusses how to make all the parts and actions within the control accessible by keyboard.
A tree control is a visual representation mechanism for a data set with a tree structure.
A tree control has nodes that can be opened and closed
Nodes contain child elements.
Nodes can contain other nodes.
Nodes that do not contain other nodes are called leaf nodes.
Nodes that share a common parent are called siblings
The first node in the tree can be a parent node to all the other nodes in the tree. (It should be possible to hide the root node in the Tree control UI)
Nodes have a "turner" - an icon that clearly indicates that these elements can be opened and closed. Leaf nodes should not have these "turner" icons.
Nodes can also have icons other than the turner icon:
By default a custom tree cell should provide one Icon and Node Name text. In addition, it should be possible for the application developer to add a checkbox and at least two more icons for each node.
The default state, where the application developer has not specified anything additional should map to a state where the expanded nodes are remembered.
If a scroll bar is present, then the item with focus should be in the visible window, unless the the user explicitly scrolls off the view.
Scrolling should cause entire lines to appear or disappear from the viewable area (we should not see partially displayed row of text)
Sometimes, in addition to the right click menu (or instead of it) these actions are invoked via a pull down menu placed in the Title bar of the tree control. Actions may also be shown as buttons, icons or links in the cell that are revealed on hover (or mouseover).
UX Rationale for contextual menu: Common UX usage that needs to be supported
Usage Note: Drop action can result in Copy, Move or other outcome (such as connect or apply). The tree control itself should not in any way prevent an application from using all such semantic outcomes from the drop action.
The tree component may need to convey to the user that the data in the tree is still loading. This can be at the level for the child node, parent node, several nodes, or globally. Spinners are animated icons shown when parts of the tree is still loading. Several cases are illustrated in the mock ups here:
Note: The child nodes need to be shown as spinners only if there is a lag in determining the exact icon to display. The appropriate icon should be shown as soon as it is available.
The tree component should have in place all the functionality that can support an application that will need to support users changing properties associated with nodes, adding nodes or removing nodes.
On some platforms, users will be able to make a gesture (double click , or click and pause) to indicate that they need to edit the node text. The node will assume the editable state and the user will be able to edit the node name inline. When the edit task is completed the user will click enter to return to normal mode. This should be supported by the default tree custom cell and the cross-component specification for custom cell may cover more details.
The tree control should be able to support application developers who want to use a system generated change in the focused node. If the system causes the focus or selected item on the control to change, the application developer should be able to show the end user that the new tree-node that has focus. It should be displayed in the view area of the tree, and all the nodes that contain this node should be expanded or opened out so that this node with the selection is visible. A RIA interface should use animated transitions to clearly convey such a change to the user.
It should be possible for the application to highlight an arbitrary node or nodes. For instance, if the user searches a tree, all the hits in the search will need to be highlighted. The component should make it possible for the application developer to do this.
The tree component should support the ability for the app to sort the nodes in some orders (alpha, order of creation, or by some other node-property)
The main tasks that users will need to do within the tree component (and therefore the tasks that will have to be supported by keyboard access are:
- Moving through the nodes of the tree
- Opening and closing nodes
- invoking the right click menu
- skip between sections of the control (title bar, body and footer)
The diagram and table below discuss how these actions can be performed using the keyboard and tab traversal. After that we look at the mobile and TV platforms.
Keyboard Operation (Win) | Keyboard Operation (Mac) | Action |
---|---|---|
Right Arrow | Right Arrow | Expand current selection (or go to first child node) |
Left Arrow | Left Arrow | Collapse current selection (or go to parent node) |
Up Arrow | Up Arrow | Move selection up one node |
Down Arrow | Down Arrow | Move selection down one node |
Home | Home | Move selection to the first node in the tree |
End | End | Move selection to the last node in the tree |
Page Up | Page Up | Move the selection up on the first fully visible item on the current page. If the first fully visible item is selected, move the selection on the first fully visible item on the previous page. |
Page Down | Page Down | Move selection down on the last fully visible item on the current page. If the last fully visible item is selected, move the selection on the last fully visible item on the next page. |
Ctrl-PgDn | Cmd-PgDn | Move focus down on the last fully visible item on the current page. If the last fully visible item is focused, move focus on the last fully visible item on the next page. |
Ctrl-PgUp | Cmd-PgUp | Move focus up on the first fully visible item on the current page. If the first fully visible item is focused, move focus on the first fully visible item on the previous page. |
Ctrl-A | Cmd-A | Select all nodes in the tree. Focus remains on the same item. |
Shift-Up Arrow | Shift-Up Arrow | Extend selection up one node In single selection mode, Shift key should be ignored and only Up Arrow key should be processed. See description of Up Arrow behavior for more details. |
Shift-Down Arrow | Shift-Down Arrow | Extend selection down one node In single selection mode, Shift key should be ignored and only Down Arrow key should be processed. See description of Down Arrow behavior for more details. |
Shift-Home | Shift-Home | Extend selection to the top of the tree In single selection mode, Shift key should be ignored and only Home key should be processed. See description of Home behavior for more details. |
Shift-End | Shift-End | Extend selection to the bottom of the tree In single selection mode, Shift key should be ignored and only End key should be processed. See description of End behavior for more details. |
Shift-PgUp | Shift-PgUp | Select all items between anchor and the first fully visible item on the current page. If the first fully visible item is already included in the selection, extend the selection to the first fully visible item on the previous page. In single selection mode, Shift key should be ignored and only PgUp key should be processed. See description of PgUp behavior for more details. |
Shift-PgDn | Shift-PgDn | Select all items between anchor and the last fully visible item on the current page. If the last fully visible item is already included in the selection, extend the selection to the last fully visible item on the next page. In single selection mode, Shift key should be ignored and only PgDn key should be processed. See description of PgDn behavior for more details. |
F2 | F2 | Rename selected node |
Enter | Enter | Save changes made to the selected node |
Esc | Esc | Cancel changes made to the selected node |
Ctrl-Up Arrow | Cmd-Up Arrow | Move focus up one node |
Ctrl-Down Arrow | Cmd-Down Arrow | Move focus down one node |
Ctrl-Home | Cmd-Home | Move focus to the first node in the tree |
Ctrl-End | Cmd-End | Move selection to the last node in the tree |
Space | Space | Select a single node, create anchor. |
Ctrl-Space | Ctrl-Cmd-Space | Select/Deselect a single node, create anchor. |
Shift-Space | Shift-Space | Select a range of nodes In single selection mode, Shift key should be ignored and only Space key should be processed. See description of Space behavior for more details. |
* (numlock) | * (numlock) | Expand everything |
+ (numlock) | + (numlock) | Expand current selection |
- (numlock) | - (numlock) | Collapse current selection |
Ctrl-Shift-Up | Cmd-Shift-Up | Expands selection up by one item. Only in multi-selection modes. In single selection mode, Shift key should be ignored and only Ctrl-Up (Cmd-Up) should be processed. See description of Ctrl-Up behavior for more details. |
Ctrl-Shift-Down | Cmd-Shift-Down | Expands selection down by one item. Only in multi-selection modes. In single selection mode, Shift key should be ignored and only Ctrl-Down (Cmd-Down) should be processed. See description of Ctrl-Down behavior for more details. |
Ctrl-Shift-Space | Cmd-Shift-Space | Selects all items between anchor and focused item. Focused item is also included in the selection. Create anchor. Available in multi-selection mode only. In single selection mode, Shift key should be ignored and only Ctrl-Space (Cmd-Space) should be processed. See description of Ctrl-Space behavior for more details. |
Ctrl-Shift-Home | Cmd-Shift-Home | Selects all items between anchor and the first item. Available in multi-selection mode only. In single selection mode, Shift key should be ignored and only Ctrl-Home (Cmd-Home) should be processed. See description of Ctrl-Home behavior for more details. |
Ctrl-Shift-End | Cmd-Shift-End | Selects all items between anchor and the last item. Available in multi-selection mode only. In single selection mode, Shift key should be ignored and only Ctrl-End (Cmd-End) should be processed. See description of Ctrl-End behavior for more details. |
Ctrl-Shift-PageUp | Cmd-Shift-PageUp | Select all items between anchor and the first fully visible item on the current page. If the first fully visible item is already included in the selection, extend the selection to the first fully visible item on the previous page. In single selection mode, Shift key should be ignored and only Ctrl-PageUp (Cmd-PageUp) should be processed. See description of Ctrl-PageUp behavior for more details. |
Ctrl-Shift-PageDown | Cmd-Shift-PageDown | Select all items between anchor and the last fully visible item on the current page. If the last fully visible item is already included in the selection, extend the selection to the last fully visible item on the next page. In single selection mode, Shift key should be ignored and only Ctrl-PageDown (Cmd-PageDown) should be processed. See description of Ctrl-PageDown behavior for more details. |