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
-
#alignment ⇒ Object
Returns the value of attribute alignment.
-
#background_image ⇒ Object
Returns the value of attribute background_image.
-
#image ⇒ Object
Returns the value of attribute image.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from WidgetProxy
#args, #background, #children, #enabled, #focus, #font, #foreground, #parent, #path
Instance Method Summary collapse
- #dom ⇒ Object
- #element ⇒ Object
-
#initialize(parent, args, block) ⇒ LabelProxy
constructor
A new instance of LabelProxy.
Methods inherited from WidgetProxy
#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=, #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, #post_add_content, #post_initialize_child, #property_type_converters, #remove_css_class, #remove_css_classes, #render, reset_max_id_numbers!, #selector, #set_attribute, #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) ⇒ LabelProxy
Returns a new instance of LabelProxy.
9 10 11 12 |
# File 'lib/glimmer/swt/label_proxy.rb', line 9 def initialize(parent, args, block) super(parent, args, block) self.alignment = [:left, :center, :right].detect {|align| args.detect { |arg| SWTProxy[align] == arg } } end |
Instance Attribute Details
#alignment ⇒ Object
Returns the value of attribute alignment.
7 8 9 |
# File 'lib/glimmer/swt/label_proxy.rb', line 7 def alignment @alignment end |
#background_image ⇒ Object
Returns the value of attribute background_image.
7 8 9 |
# File 'lib/glimmer/swt/label_proxy.rb', line 7 def background_image @background_image end |
#image ⇒ Object
Returns the value of attribute image.
7 8 9 |
# File 'lib/glimmer/swt/label_proxy.rb', line 7 def image @image end |
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'lib/glimmer/swt/label_proxy.rb', line 7 def text @text end |
Instance Method Details
#dom ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/glimmer/swt/label_proxy.rb', line 42 def dom label_text = @text label_id = id label_class = name @dom ||= html { label(id: label_id, class: label_class) { label_text } }.to_s end |
#element ⇒ Object
32 33 34 |
# File 'lib/glimmer/swt/label_proxy.rb', line 32 def element 'label' end |