Class: Glimmer::SWT::ComboProxy
- Inherits:
-
WidgetProxy
- Object
- WidgetProxy
- Glimmer::SWT::ComboProxy
- Includes:
- DataBinding::ObservableElement
- Defined in:
- lib/glimmer/swt/combo_proxy.rb
Direct Known Subclasses
Constant Summary
Constants inherited from WidgetProxy
WidgetProxy::DEFAULT_INITIALIZERS, WidgetProxy::JS_KEY_CODE_TO_SWT_KEY_CODE_MAP, WidgetProxy::JS_LOCATION_TO_SWT_KEY_LOCATION_MAP, WidgetProxy::SWT_CURSOR_TO_CSS_CURSOR_MAP
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from WidgetProxy
#args, #background, #children, #cursor, #disposed?, #enabled, #focus, #font, #foreground, #menu, #menu_requested, #menu_x, #menu_y, #parent, #path, #rendered
Instance Method Summary collapse
- #dom ⇒ Object
- #element ⇒ Object
-
#initialize(parent, args, block) ⇒ ComboProxy
constructor
A new instance of ComboProxy.
- #observation_request_to_event_mapping ⇒ Object
- #selection ⇒ Object
- #selection=(value) ⇒ Object
Methods included from DataBinding::ObservableElement
Methods inherited from WidgetProxy
#add_content_on_render, #add_css_class, #add_css_classes, #add_observer, #apply_property_type_converters, #attach, #build_dom, #can_handle_observation_request?, #clear_css_classes, #content, #content_on_render_blocks, #css_classes, #default_observation_request_to_event_mapping, #dialog_ancestor, #dispose, #dom_element, #effective_observation_request_to_event_mapping, #event_handling_suspended?, #event_listener_proxies, for, #get_data, #handle_javascript_observation_request, #handle_observation_request, #has_style?, #id, #id=, #listener_dom_element, #listener_path, #listeners, #listeners_for, max_id_number_for, max_id_numbers, #method_missing, #name, next_id_number_for, #observation_requests, #parent_dom_element, #parent_path, #parents, #post_add_content, #post_dispose_child, #post_initialize_child, #print, #property_type_converters, #reattach, #remove_all_listeners, #remove_css_class, #remove_css_classes, #remove_event_listener_proxies, #render, reset_max_id_numbers!, #resume_event_handling, #selector, #set_attribute, #set_data, #set_focus, #shell, #skip_content_on_render_blocks?, #style_element, #suspend_event_handling, #swt_data, #swt_widget, underscored_widget_name, widget_class, widget_exists?, widget_handling_listener, #widget_property_listener_installers
Methods included from PropertyOwner
#attribute_getter, #attribute_setter, #get_attribute, #set_attribute
Constructor Details
#initialize(parent, args, block) ⇒ ComboProxy
Returns a new instance of ComboProxy.
11 12 13 14 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 11 def initialize(parent, args, block) super(parent, args, block) @items = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Glimmer::DataBinding::ObservableElement
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
9 10 11 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 9 def items @items end |
#text ⇒ Object
Returns the value of attribute text.
9 10 11 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 9 def text @text end |
Instance Method Details
#dom ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 61 def dom items = @items select_id = id select_style = css select_class = name @dom ||= html { select(id: select_id, class: select_class, style: select_style) { } }.to_s end |
#element ⇒ Object
16 17 18 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 16 def element 'select' end |
#observation_request_to_event_mapping ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 47 def observation_request_to_event_mapping { 'on_widget_selected' => { event: 'change', event_handler: -> (event_listener) { -> (event) { @text = event.target.value event_listener.call(event) } } }, } end |
#selection ⇒ Object
25 26 27 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 25 def selection text end |
#selection=(value) ⇒ Object
29 30 31 |
# File 'lib/glimmer/swt/combo_proxy.rb', line 29 def selection=(value) self.text = value end |