Skip to content

Instantly share code, notes, and snippets.

@dcunited08
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcunited08/0f4b99ea895579cc66f5 to your computer and use it in GitHub Desktop.
Save dcunited08/0f4b99ea895579cc66f5 to your computer and use it in GitHub Desktop.
Recommended API for tree-view to allow custom nodes.
myCallbackFunc: (node) =>
node.on "click", =>
#do something
node.on "delete", =>
#do something else
atom.project.tree-view().addNode
text: "node text" #text to be displayed
class: "my-special-node" #optional, adds extra class but a class is added for each package as well
parentNode: parentNode #optional if you are making a sub node
callback: myCallbackFunc #required, calls back with details to update and subscribe to events on that node
atom.project.tree-view().removeNode
node: nodeID
force: false #fail removal of the node if it has children
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment