MCPcopy Create free account
hub / github.com/cogentcore/core / DeleteNode

Method DeleteNode

core/treesync.go:274–292  ·  view source on GitHub ↗

DeleteNode deletes the tree node or sync node corresponding to this view node in the sync tree. If SyncNode is set, operates on Sync Tree.

()

Source from the content-addressed store, hash-verified

272// to this view node in the sync tree.
273// If SyncNode is set, operates on Sync Tree.
274func (tr *Tree) DeleteNode() { //types:add
275 ttl := "Delete"
276 if tr.IsRoot(ttl) {
277 return
278 }
279 tr.Close()
280 if tr.moveDown(events.SelectOne) == nil {
281 tr.moveUp(events.SelectOne)
282 }
283 if tr.SyncNode != nil {
284 tr.SyncNode.AsTree().Delete()
285 tr.sendChangeEventReSync(nil)
286 } else {
287 parent := AsTree(tr.Parent)
288 tr.Delete()
289 parent.Update()
290 parent.treeChanged(nil)
291 }
292}
293
294// Duplicate duplicates the sync node corresponding to this view node in
295// the tree, and inserts the duplicate after this node (as a new sibling).

Callers 1

InitMethod · 0.95

Calls 10

IsRootMethod · 0.95
CloseMethod · 0.95
moveDownMethod · 0.95
moveUpMethod · 0.95
sendChangeEventReSyncMethod · 0.95
AsTreeFunction · 0.85
treeChangedMethod · 0.80
DeleteMethod · 0.65
AsTreeMethod · 0.65
UpdateMethod · 0.65

Tested by

no test coverage detected