Sha256: 0b6c0951eb84f99772a374cd29abe1428c6d8bab2bae3b4f5bfa218215e51010

Contents?: true

Size: 1.2 KB

Versions: 41

Compression:

Stored size: 1.2 KB

Contents

module Redcar
  class Runnables
    class TreeController < Redcar::Project::ProjectTreeController

      def right_click(tree, node)
        controller = self
        menu = Menu.new
        Redcar.plugin_manager.objects_implementing(:runnables_context_menus).each do |object|
          case object.method(:runnables_context_menus).arity
          when 1
            menu.merge(object.runnables_context_menus(node))
          when 2
            menu.merge(object.runnables_context_menus(tree, node))
          when 3
            menu.merge(object.runnables_context_menus(tree, node, controller))
          else
            puts("Invalid runnables_context_menus hook detected in "+object.class.name)
          end
        end
        Application::Dialog.popup_menu(menu, :pointer)
      end

      def activated(tree, node)
        case node
        when Runnable
          Runnables.run_process(@project.home_dir, node.command, node.text, node.output)
        when HelpItem
          tab = Redcar.app.focussed_window.new_tab(HtmlTab)
          tab.go_to_location("http://github.com/redcar/redcar/wiki/Users-Guide---Runnables")
          tab.title = "Runnables Help"
          tab.focus
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
redcar-0.13 plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.5dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.4dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.3dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.2dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.1dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-0.12.1 plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.13.0dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-0.12 plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.27dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.26dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.25dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.24dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.23dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.22dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.21dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.20dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.19dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.18dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb
redcar-dev-0.12.17dev plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb