Class: Watobo::Plugin2
- Inherits:
-
FXDialogBox
- Object
- FXDialogBox
- Watobo::Plugin2
- Includes:
- Gui, Gui::Icons
- Defined in:
- lib/watobo/gui/templates/plugin2.rb
Direct Known Subclasses
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_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
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Instance Method Summary collapse
- #clearEvents(event) ⇒ Object
-
#initialize(owner, title, project, opts) ⇒ Plugin2
constructor
A new instance of Plugin2.
- #load_icon(file = __FILE__) ⇒ 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, load_gui_icon, load_icon, plugins, project, project=, save_default_settings, save_session_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.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 77 def initialize(owner, title, project, opts) super(owner, title, :opts => DECOR_ALL,:width=>800, :height=>600) # Implement Sender # Implement Scanner @icon = nil # load_icon() @plugin_name = "undefined" @event_dispatcher_listeners = Hash.new @log_lock = Mutex.new @log_messages = [] end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
25 26 27 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 25 def icon @icon end |
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
24 25 26 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 24 def plugin_name @plugin_name end |
Instance Method Details
#clearEvents(event) ⇒ Object
33 34 35 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 33 def clearEvents(event) @event_dispatcher_listener[event].clear end |
#load_icon(file = __FILE__) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 59 def load_icon(file=__FILE__) begin @icon = ICON_PLUGIN path = File.dirname(file) # puts "... searching for icons in #{path}/icons" file = Dir.glob("#{path}/icons/*.ico").first # puts "* load icon: #{file}" @icon = Watobo::Gui.load_icon(file) unless file.nil? self.icon = @icon rescue => bang puts "!!!Error: could not init icon" puts bang puts bang.backtrace if $DEBUG end end |
#logger(msg) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 49 def logger(msg) t = Time.now now = t.strftime("%m/%d/%Y @ %H:%M:%S") @log_lock.synchronize do text = "\n#{now}: msg" @log_messages << text end end |
#notify(event, *args) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 37 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
29 30 31 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 29 def subscribe(event, &callback) (@event_dispatcher_listeners[event] ||= []) << callback end |
#updateView ⇒ Object
45 46 47 |
# File 'lib/watobo/gui/templates/plugin2.rb', line 45 def updateView() raise "!!! updateView not defined" end |