Open opens the given node and updates the tree accordingly (if it is not already opened). It calls OnOpen in the [Treer] interface for extensible actions.
()
| 1119 | // (if it is not already opened). It calls OnOpen in the [Treer] |
| 1120 | // interface for extensible actions. |
| 1121 | func (tr *Tree) Open() { |
| 1122 | if !tr.Closed || tr.inOpen || tr.This == nil { |
| 1123 | return |
| 1124 | } |
| 1125 | tr.inOpen = true |
| 1126 | if tr.This.(Treer).CanOpen() { |
| 1127 | tr.SetClosed(false) |
| 1128 | tr.setBranchState() |
| 1129 | tr.setChildrenVisibility(false) |
| 1130 | tr.This.(Treer).OnOpen() |
| 1131 | } |
| 1132 | tr.inOpen = false |
| 1133 | tr.NeedsLayout() |
| 1134 | } |
| 1135 | |
| 1136 | // ToggleClose toggles the close / open status: if closed, opens, and vice-versa. |
| 1137 | func (tr *Tree) ToggleClose() { |
no test coverage detected