Class: Nobbie::Wx::Command::TypeIntoCommand

Inherits:
ComponentAwareCommand show all
Defined in:
lib/nobbie/wx/command/type_into.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ComponentAwareCommand

#component, #ensure_enabled, #handle_unsupported_operation_for_component, #handle_value_not_found, #highlight

Constructor Details

#initialize(path, value) ⇒ TypeIntoCommand

Returns a new instance of TypeIntoCommand.



6
7
8
9
# File 'lib/nobbie/wx/command/type_into.rb', line 6

def initialize(path, value)
  super(path)
  @value = value
end

Instance Method Details

#describeObject



21
22
23
# File 'lib/nobbie/wx/command/type_into.rb', line 21

def describe
  "Type #{@value} into #{@value}"
end

#executeObject



11
12
13
14
15
16
17
18
19
# File 'lib/nobbie/wx/command/type_into.rb', line 11

def execute
  highlight {
    if component.is_a?(TextCtrl) || component.is_a?(ComboBox)
      handle_text_ctrl_or_combo_box
    else
      handle_unsupported_operation_for_component
    end
  }
end