IsRoot returns true if given node is the root of the tree, creating an error snackbar if it is and action is non-empty.
(action string)
| 1237 | // IsRoot returns true if given node is the root of the tree, |
| 1238 | // creating an error snackbar if it is and action is non-empty. |
| 1239 | func (tr *Tree) IsRoot(action string) bool { |
| 1240 | if tr.This == tr.root.This { |
| 1241 | if action != "" { |
| 1242 | MessageSnackbar(tr, fmt.Sprintf("Cannot %v the root of the tree", action)) |
| 1243 | } |
| 1244 | return true |
| 1245 | } |
| 1246 | return false |
| 1247 | } |
| 1248 | |
| 1249 | //////////////////////////////////////////////////////////// |
| 1250 | // Copy / Cut / Paste |
no test coverage detected