class Vizkit::NameServiceItem

Public Class Methods

new(name_service,options = Hash.new) click to toggle source
Calls superclass method Vizkit::VizkitItem.new
# File lib/vizkit/vizkit_items.rb, line 979
def initialize(name_service,options = Hash.new)
    super()
    @options = Kernel.validate_options options,:item_type => :label
    if @options[:item_type] == :label
        setText name_service.name
        name_service.on_task_added do |task_name|
            task = name_service.proxy task_name
            next if child?(task.basename)
            appendRow([TaskContextItem.new(task,:basename => true),TaskContextItem.new(task,:item_type => :value)])
        end
    else
        name_service.on_error do |error|
            setText error.to_s
        end
        name_service.on_reachable do
            setText "reachable"
        end
    end
end