 
     return menuItems
 
+  handleContextMenuClick: (callback= noop) ->
+    callback()
+    @contextMenu?.destroy()
+
   pistachio: ->
     """
       {{> @domainName}}

    KD.getSingleton('appManager').tell 'IDE', 'openVMWebPage', @getData()

  createContextMenu: (event) ->
    button = @actionsButton
    menu   = new KDContextMenu
      cssClass     : 'environments'
      event        : event
      delegate     : this

    data        = @getData()
    appManager  = KD.getSingleton 'appManager'
    menuItems   =
      'Mount to filetree': callback: =>
        @handleContextMenuClick appManager.tell 'IDE', 'mountVM', data
      'Open VM terminal' : callback: =>
        @handleContextMenuClick appManager.tell 'IDE', 'openVMTerminal', data
      'Open VM domain'   : callback: =>
        @handleContextMenuClick @openVMDomain()

    # FIXME: Find a better way to remove this drill down
    ideAppController   = appManager.getFrontApp()
