Class: Glimmer::SWT::ScaleProxy
- Inherits:
-
WidgetProxy
- Object
- WidgetProxy
- Glimmer::SWT::ScaleProxy
- Defined in:
- lib/glimmer/swt/scale_proxy.rb
Constant Summary collapse
- STYLE =
<<~CSS .scale { width: 100%; } CSS
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
-
#increment ⇒ Object
Returns the value of attribute increment.
-
#maximum ⇒ Object
Returns the value of attribute maximum.
-
#minimum ⇒ Object
Returns the value of attribute minimum.
-
#selection ⇒ Object
Returns the value of attribute selection.
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) ⇒ ScaleProxy
constructor
A new instance of ScaleProxy.
- #observation_request_to_event_mapping ⇒ Object
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) ⇒ ScaleProxy
Returns a new instance of ScaleProxy.
35 36 37 38 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 35 def initialize(parent, args, block) super(parent, args, block) dom_element. end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Glimmer::SWT::WidgetProxy
Instance Attribute Details
#increment ⇒ Object
Returns the value of attribute increment.
33 34 35 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 33 def increment @increment end |
#maximum ⇒ Object
Returns the value of attribute maximum.
33 34 35 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 33 def maximum @maximum end |
#minimum ⇒ Object
Returns the value of attribute minimum.
33 34 35 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 33 def minimum @minimum end |
#selection ⇒ Object
Returns the value of attribute selection.
33 34 35 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 33 def selection @selection end |
Instance Method Details
#dom ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 91 def dom scale_selection = @selection scale_id = id scale_style = css scale_class = name = {type: 'text', id: scale_id, style: scale_style, class: scale_class, value: scale_selection} = .merge('disabled': 'disabled') unless @enabled @dom ||= html { div() }.to_s end |
#element ⇒ Object
62 63 64 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 62 def element 'div' end |
#observation_request_to_event_mapping ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/glimmer/swt/scale_proxy.rb', line 66 def observation_request_to_event_mapping { 'on_widget_selected' => [ { event: 'change', event_handler: -> (event_listener) { -> (event) { self.selection = dom_element.('option', 'value') event_listener.call(event) } } }, { event: 'slidestop', event_handler: -> (event_listener) { -> (event) { self.selection = dom_element.('option', 'value') event_listener.call(event) } } }, ], } end |