Class: Watobo::Plugin2
- Inherits:
-
FXDialogBox
- Object
- FXDialogBox
- Watobo::Plugin2
- Includes:
- Gui, Gui::Icons
- Defined in:
- lib/watobo/gui/templates/plugin2.rb
Overview
:nodoc: all
Constant Summary
Constants included from Gui::Icons
Gui::Icons::ICON_ADD_PROJECT, Gui::Icons::ICON_BROWSER_MEDIUM, Gui::Icons::ICON_BROWSER_SMALL, Gui::Icons::ICON_BTN_DOWN, Gui::Icons::ICON_BTN_UP, Gui::Icons::ICON_CB_CHECKED, Gui::Icons::ICON_CB_CHECKED_ORANGE, Gui::Icons::ICON_CB_UNCHECKED, Gui::Icons::ICON_CONVERSATION, Gui::Icons::ICON_DASHBOARD, Gui::Icons::ICON_DIFFER, Gui::Icons::ICON_FOLDER, Gui::Icons::ICON_FOLDER_SMALL, Gui::Icons::ICON_FUZZER, Gui::Icons::ICON_FUZZER_MEDIUM, Gui::Icons::ICON_FUZZER_SMALL, Gui::Icons::ICON_FUZZ_FILTER, Gui::Icons::ICON_FUZZ_GENERATOR, Gui::Icons::ICON_FUZZ_TAG, Gui::Icons::ICON_HINTS, Gui::Icons::ICON_HINTS_INFO, Gui::Icons::ICON_HINTS_INFO_SMALL, Gui::Icons::ICON_HINTS_SMALL, Gui::Icons::ICON_INFO, Gui::Icons::ICON_INFO_INFO, Gui::Icons::ICON_INFO_INFO_SMALL, Gui::Icons::ICON_INFO_SMALL, Gui::Icons::ICON_INFO_USER, Gui::Icons::ICON_INFO_USER_SMALL, Gui::Icons::ICON_INTERCEPTOR, Gui::Icons::ICON_LOGIN_WIZZARD, Gui::Icons::ICON_MANUAL_REQUEST, Gui::Icons::ICON_MANUAL_REQUEST_MEDIUM, Gui::Icons::ICON_MANUAL_REQUEST_SMALL, Gui::Icons::ICON_PAUSE, Gui::Icons::ICON_PLUGIN, Gui::Icons::ICON_PROJECT, Gui::Icons::ICON_PROJECT_SMALL, Gui::Icons::ICON_REPORT, Gui::Icons::ICON_REQUEST, Gui::Icons::ICON_REQUEST_SMALL, Gui::Icons::ICON_SEND_REQUEST, Gui::Icons::ICON_SITE, Gui::Icons::ICON_SITE_SMALL, Gui::Icons::ICON_START, Gui::Icons::ICON_STOP, Gui::Icons::ICON_TOKEN, Gui::Icons::ICON_TRANSCODER, Gui::Icons::ICON_VULN, Gui::Icons::ICON_VULN_BP, Gui::Icons::ICON_VULN_BP_SMALL, Gui::Icons::ICON_VULN_CRITICAL, Gui::Icons::ICON_VULN_CRITICAL_SMALL, Gui::Icons::ICON_VULN_HIGH, Gui::Icons::ICON_VULN_HIGH_SMALL, Gui::Icons::ICON_VULN_LOW, Gui::Icons::ICON_VULN_LOW_SMALL, Gui::Icons::ICON_VULN_MEDIUM, Gui::Icons::ICON_VULN_MEDIUM_SMALL, Gui::Icons::ICON_VULN_SMALL, Gui::Icons::ICON_WATOBO, Gui::Icons::SIBERAS_ICON, Gui::Icons::TBL_ICON_LOCK, Gui::Icons::WATOBO_LOGO
Constants included from Gui
Gui::DIFF_TYPE_NEW, Gui::DIFF_TYPE_ORIG, Gui::SEL_TYPE_GREP, Gui::SEL_TYPE_HIGHLIGHT, Gui::TABLE_COL_COMMENT, Gui::TABLE_COL_COOKIE, Gui::TABLE_COL_HOST, Gui::TABLE_COL_METHOD, Gui::TABLE_COL_PARMS, Gui::TABLE_COL_PATH, Gui::TABLE_COL_SSL, Gui::TABLE_COL_STATUS
Constants included from Diff::LCS
Diff::LCS::BalancedCallbacks, Diff::LCS::PATCH_MAP, Diff::LCS::SequenceCallbacks, Diff::LCS::VERSION
Instance Attribute Summary collapse
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Class Method Summary collapse
Instance Method Summary collapse
- #clearEvents(event) ⇒ Object
-
#initialize(owner, title, project, opts) ⇒ Plugin2
constructor
A new instance of Plugin2.
- #load_icon ⇒ Object
- #logger(msg) ⇒ Object
- #notify(event, *args) ⇒ Object
- #subscribe(event, &callback) ⇒ Object
- #updateView ⇒ Object
Methods included from Gui
add_plugin, application, browser_preview, check_first_run, clear_plugins, create_application, history, info, load_gui_icon, load_icon, plugins, project, project=, save_default_settings_UNUSED, save_scanner_settings, save_settings, start
Methods included from Diff::LCS
LCS, __diff_direction, __inverse_vector, __lcs, __normalize_patchset, __position_hash, __replace_next_larger, diff, #diff, #lcs, patch, #patch, #patch!, patch!, sdiff, #sdiff, traverse_balanced, #traverse_balanced, traverse_sequences, #traverse_sequences, #unpatch, #unpatch!, unpatch!
Constructor Details
#initialize(owner, title, project, opts) ⇒ Plugin2
Returns a new instance of Plugin2.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 63 def initialize(owner, title, project, opts) super(owner, title, :opts => DECOR_ALL, :width => 800, :height => 600) @icon = nil load_icon() @plugin_name = "undefined" @event_dispatcher_listeners = Hash.new @update_lock = Mutex.new = [] add_update_timer() end |
Instance Attribute Details
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
4 5 6 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 4 def plugin_name @plugin_name end |
Class Method Details
.get_icon ⇒ Object
12 13 14 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 12 def self.get_icon @icon_file end |
.icon_file(icon_file) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 16 def self.icon_file(icon_file) # puts "Caller >> #{caller.class}" # puts caller.to_yaml dummy = caller.first.split(":") dummy.pop file = dummy.join(":") @icon_file = File.join(File.dirname(file), "..", "icons", icon_file) end |
Instance Method Details
#clearEvents(event) ⇒ Object
37 38 39 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 37 def clearEvents(event) @event_dispatcher_listener[event].clear end |
#load_icon ⇒ Object
27 28 29 30 31 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 27 def load_icon icon = self.class.get_icon # puts "* loading icon > #{icon}" self.icon = Watobo::Gui.load_icon(icon) unless icon.nil? end |
#logger(msg) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 53 def logger(msg) t = Time.now now = t.strftime("%m/%d/%Y @ %H:%M:%S") @update_lock.synchronize do text = "\n#{now}: msg" << text end end |
#notify(event, *args) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 41 def notify(event, *args) if @event_dispatcher_listeners[event] @event_dispatcher_listeners[event].each do |m| m.call(*args) if m.respond_to? :call end end end |
#subscribe(event, &callback) ⇒ Object
33 34 35 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 33 def subscribe(event, &callback) (@event_dispatcher_listeners[event] ||= []) << callback end |
#updateView ⇒ Object
49 50 51 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 49 def updateView() raise "!!! updateView not defined" end |