Class: Watobo::Template::Plugin
- Inherits:
-
FXDialogBox
- Object
- FXDialogBox
- Watobo::Template::Plugin
- Includes:
- Gui::Icons
- Defined in:
- lib/watobo/gui/templates/plugin.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_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
-
#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) ⇒ Plugin
constructor
A new instance of Plugin.
- #load_icon(file = __FILE__) ⇒ Object
- #notify(event, *args) ⇒ Object
- #subscribe(event, &callback) ⇒ Object
- #updateView ⇒ Object
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) ⇒ Plugin
Returns a new instance of Plugin.
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/watobo/gui/templates/plugin.rb', line 69 def initialize(owner, title, project, opts) dialog_opts = { :opts => DECOR_ALL, :width=>800, :height=>650 } dialog_opts.update opts super(owner, title, dialog_opts) # Implement Sender # Implement Scanner @icon = nil # load_icon() @plugin_name = "undefined" @event_dispatcher_listeners = Hash.new end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
27 28 29 |
# File 'lib/watobo/gui/templates/plugin.rb', line 27 def icon @icon end |
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
26 27 28 |
# File 'lib/watobo/gui/templates/plugin.rb', line 26 def plugin_name @plugin_name end |
Instance Method Details
#clearEvents(event) ⇒ Object
35 36 37 |
# File 'lib/watobo/gui/templates/plugin.rb', line 35 def clearEvents(event) @event_dispatcher_listener[event].clear end |
#load_icon(file = __FILE__) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/watobo/gui/templates/plugin.rb', line 51 def load_icon(file=__FILE__) begin @icon = ICON_PLUGIN path = File.dirname(file) # puts "... searching for icons in #{path}" file = Dir.glob("#{path}/*.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 |
#notify(event, *args) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/watobo/gui/templates/plugin.rb', line 39 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
31 32 33 |
# File 'lib/watobo/gui/templates/plugin.rb', line 31 def subscribe(event, &callback) (@event_dispatcher_listeners[event] ||= []) << callback end |
#updateView ⇒ Object
47 48 49 |
# File 'lib/watobo/gui/templates/plugin.rb', line 47 def updateView() raise "!!! updateView not defined" end |