Class: Glimmer::SWT::CompositeProxy

Inherits:
WidgetProxy show all
Defined in:
lib/glimmer/swt/composite_proxy.rb

Constant Summary

Constants inherited from WidgetProxy

WidgetProxy::DEFAULT_INITIALIZERS

Instance Attribute Summary collapse

Attributes inherited from WidgetProxy

#args, #background, #children, #disposed?, #enabled, #focus, #font, #foreground, #parent, #path, #rendered

Instance Method Summary collapse

Methods inherited from WidgetProxy

#add_content_on_render, #add_css_class, #add_css_classes, #add_observer, #apply_property_type_converters, #build_dom, #can_handle_observation_request?, #clear_css_classes, #content, #content_on_render_blocks, #css_classes, #default_observation_request_to_event_mapping, #dispose, #dom_element, #effective_observation_request_to_event_mapping, #element, for, #get_data, #handle_observation_request, #has_style?, #id, #id=, #listener_dom_element, #listener_path, max_id_number_for, max_id_numbers, #method_missing, #name, next_id_number_for, #observation_request_to_event_mapping, #observation_requests, #parent_dom_element, #parent_path, #post_add_content, #post_dispose_child, #post_initialize_child, #property_type_converters, #remove_all_listeners, #remove_css_class, #remove_css_classes, #render, reset_max_id_numbers!, #selector, #set_attribute, #set_data, #set_focus, #style_element, underscored_widget_name, widget_class, widget_exists?, #widget_property_listener_installers

Methods included from PropertyOwner

#attribute_getter, #attribute_setter, #get_attribute, #set_attribute

Constructor Details

#initialize(parent, args, block) ⇒ CompositeProxy

Returns a new instance of CompositeProxy.



9
10
11
12
# File 'lib/glimmer/swt/composite_proxy.rb', line 9

def initialize(parent, args, block)
  super(parent, args, block)
  @layout = default_layout
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::SWT::WidgetProxy

Instance Attribute Details

#layoutObject

Returns the value of attribute layout.



7
8
9
# File 'lib/glimmer/swt/composite_proxy.rb', line 7

def layout
  @layout
end

Instance Method Details

#default_layoutObject



14
15
16
# File 'lib/glimmer/swt/composite_proxy.rb', line 14

def default_layout
  GridLayoutProxy.new(self, [])
end

#domObject



18
19
20
21
22
23
24
25
# File 'lib/glimmer/swt/composite_proxy.rb', line 18

def dom
  div_id = id
  div_style = css
  div_class = name
  @dom ||= html {
    div(id: div_id, class: div_class, style: div_style)
  }.to_s
end