Class: Glimmer::SWT::LabelProxy
- Inherits:
-
WidgetProxy
- Object
- WidgetProxy
- Glimmer::SWT::LabelProxy
- Defined in:
- lib/glimmer/swt/label_proxy.rb
Constant Summary
Constants inherited from WidgetProxy
WidgetProxy::DEFAULT_INITIALIZERS
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from WidgetProxy
#args, #background, #children, #enabled, #font, #foreground, #parent, #path
Instance Method Summary collapse
Methods inherited from WidgetProxy
#add_child, #add_css_class, #add_css_classes, #add_observer, #apply_property_type_converters, #build_dom, #can_handle_observation_request?, #clear_css_classes, #content, #css_classes, #dispose, #dom_element, for, #handle_observation_request, #has_style?, #id, #id=, #initialize, #listener_dom_element, #listener_path, max_id_number_for, max_id_numbers, #name, next_id_number_for, #observation_request_to_event_mapping, #parent_dom_element, #parent_path, #property_type_converters, #remove_css_class, #remove_css_classes, #render, reset_max_id_numbers!, #selector, #set_attribute, #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
This class inherits a constructor from Glimmer::SWT::WidgetProxy
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/glimmer/swt/label_proxy.rb', line 6 def text @text end |
Instance Method Details
#alignment ⇒ Object
17 18 19 |
# File 'lib/glimmer/swt/label_proxy.rb', line 17 def alignment [:left, :center, :right].detect {|value| args.detect { |arg| SWTProxy[value] == arg } } end |
#dom ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/glimmer/swt/label_proxy.rb', line 21 def dom label_text = @text label_id = id label_style = "text-align: #{alignment};" label_class = name @dom ||= html { label(id: label_id, style: label_style, class: label_class) { label_text } }.to_s end |
#element ⇒ Object
13 14 15 |
# File 'lib/glimmer/swt/label_proxy.rb', line 13 def element 'label' end |