class Roby::GUI::ModelViews::ActionInterface

Handler class to display information about an action interface

Public Class Methods

find_definition_place(model) click to toggle source
# File lib/roby/gui/model_views/action_interface.rb, line 25
def self.find_definition_place(model)
    location = model.definition_location.find do |location|
        return if location.label == 'require' || location.label == 'using_task_library'
        Roby.app.app_file?(location.absolute_path)
    end
    if location
        return location.absolute_path, location.lineno
    end
end
html_defined_in(page, model, with_require: true, definition_location: nil, format: "<b>Defined in</b> %s") click to toggle source
# File lib/roby/gui/model_views/action_interface.rb, line 35
def self.html_defined_in(page, model, with_require: true, definition_location: nil, format: "<b>Defined in</b> %s")
    path, lineno = *definition_location || find_definition_place(model)
    if path
        path = Pathname.new(path)
        path_link = page.link_to(path, "#{path}:#{lineno}", lineno: lineno)
        page.push(nil, "<p>#{format % [path_link]}</p>")
        if with_require
            if req_base = $LOAD_PATH.find { |p| path.fnmatch?(File.join(p, "*")) }
                req = path.relative_path_from(Pathname.new(req_base))
                page.push(nil, "<code>require '#{req.sub_ext("")}'</code>")
            end
        end
    end
end
new(page) click to toggle source
Calls superclass method
# File lib/roby/gui/model_views/action_interface.rb, line 6
def initialize(page)
    super
end

Public Instance Methods

render(model, options = Hash.new) click to toggle source
# File lib/roby/gui/model_views/action_interface.rb, line 18
def render(model, options = Hash.new)
    ActionInterface.html_defined_in(page, model, with_require: true)

    actions = compute_toplevel_links(model, options)
    render_links('Actions', actions)
end