Class Ui::WxWidgets::Widgets::HostsBrowser
In: ui/wx/widgets/hoststree.rb
Parent: Wx::TreeCtrl

Methods

new   update_view  

Included Modules

HostsBrowserInterface

Public Class methods

=============================================== public methods

[Source]

    # File ui/wx/widgets/hoststree.rb, line 64
64:         def initialize(parent=nil)
65:           super(parent, 
66:             Wx::ID_ANY, 
67:             Wx::DEFAULT_POSITION,
68:             Wx::Size.new(200, 250),
69:             Wx::TR_DEFAULT_STYLE|Wx::NO_BORDER|Wx::TR_HIDE_ROOT)
70:           
71:           setup_images
72:           #setup_dummy_content
73:           self.disable
74:         end

Public Instance methods

[Source]

    # File ui/wx/widgets/hoststree.rb, line 76
76:         def update_view(model)
77:           self.delete_all_items
78:           
79:           root = self.add_root('dradis', 0)
80:           model.hosts.each do |host|
81:             parent = self.append_item(root, "#{host['uid']}: #{host['address']}", 0)
82:             self.set_item_data(parent, {:type=>:host, :id => host.uid, :notes => host.notes})
83:             
84:             host.services.each do |srv|
85:               item = self.append_item(parent, "#{srv.uid}: #{srv.name} (#{srv.protocol}/#{srv.port})", 1)
86:               self.set_item_data(item, {:type=>:service, :id => srv.uid, :notes => srv.notes})
87:             end
88:           end
89:           self.expand_all
90:           self.enable
91:         end

[Validate]