       iconOnly        : yes
       iconClass       : 'cog'
       type            : 'contextmenu'
-      delegate        : this
+      delegate        : options.delegate or this
       itemClass       : AceSettingsView
       click           : (pubInst, event) -> @contextMenu event
       menu            : @getAdvancedSettingsMenuItems.bind this

    @listenWindowResize()

    aceOptions        =
      delegate        : this
      enableShortcuts : yes
      createFindAndReplaceView : options.createFindAndReplaceView


  openSaveDialog: ->

    file = @getData()
    container = @getOptions().delegate or this

    KD.utils.showSaveDialog container, (input, finderController, dialog) =>

      [node] = finderController.treeController.selectedNodes
      name   = input.getValue()
