Class: Glimmer::SWT::ToolBarProxy

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

Overview

Proxy for org.eclipse.swt.widgets.ToolBarProxy

Follows the Proxy Design Pattern

Constant Summary

Constants inherited from WidgetProxy

WidgetProxy::DEFAULT_INITIALIZERS, WidgetProxy::DEFAULT_STYLES, WidgetProxy::KEYWORD_ALIASES

Instance Attribute Summary collapse

Attributes inherited from WidgetProxy

#drag_source_proxy, #drag_source_style, #drag_source_transfer, #drop_target_proxy, #drop_target_transfer, #finished_add_content, #parent_proxy, #swt_widget

Attributes included from Custom::Drawable

#image_double_buffered, #requires_shape_disposal

Instance Method Summary collapse

Methods inherited from WidgetProxy

#add_observer, #async_exec, #auto_exec, #can_add_observer?, #can_handle_drag_observation_request?, #can_handle_drop_observation_request?, #can_handle_observation_request?, #content, create, #dispose, #disposed?, #ensure_drag_source_proxy, #ensure_drop_target_proxy, #extract_args, #finish_add_content!, flyweight_swt_widget_classes, #get_attribute, #handle_observation_request, #has_attribute?, #has_style?, #height, #method_missing, #pack_same_size, #post_initialize_child, #print, #proxy_source_object, #remove_observer, #respond_to?, #set_attribute, #shell_proxy, swt_widget_class_for, swt_widget_class_manual_entries, #sync_exec, #timer_exec, underscored_widget_name, widget_exists?, #widget_property_listener_installers, widget_proxy_class, #width, #x, #y

Methods included from Custom::Drawable

#add_shape, #clear_shapes, #deregister_shape_painting, #expanded_shapes, #image_buffered_shapes, #paint_pixel_by_pixel, #setup_shape_painting, #shape_at_location, #shapes, #swt_drawable

Methods included from ProxyProperties

#get_attribute, #has_attribute?, #has_attribute_getter?, #has_attribute_setter?, #method_missing, #proxy_source_object, #respond_to?, #set_attribute

Methods included from Properties

attribute_getter, #attribute_getter, attribute_setter, #attribute_setter, normalized_attribute, #normalized_attribute, ruby_attribute_getter, #ruby_attribute_setter, ruby_attribute_setter

Methods included from Packages

included

Constructor Details

#initialize(*init_args, &block) ⇒ ToolBarProxy

Returns a new instance of ToolBarProxy.



32
33
34
35
36
# File 'lib/glimmer/swt/tool_bar_proxy.rb', line 32

def initialize(*init_args, &block)
  super
  self.cool_item_proxy = WidgetProxy.new("cool_item", parent_proxy, []) if parent_proxy.swt_widget.is_a?(CoolBar)
  self.swt_cool_item = cool_item_proxy&.swt_widget
end

Dynamic Method Handling

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

Instance Attribute Details

#cool_item_proxyObject

Returns the value of attribute cool_item_proxy.



30
31
32
# File 'lib/glimmer/swt/tool_bar_proxy.rb', line 30

def cool_item_proxy
  @cool_item_proxy
end

#swt_cool_itemObject

Returns the value of attribute swt_cool_item.



30
31
32
# File 'lib/glimmer/swt/tool_bar_proxy.rb', line 30

def swt_cool_item
  @swt_cool_item
end

Instance Method Details

#apply_preferred_sizeObject



42
43
44
45
46
47
48
# File 'lib/glimmer/swt/tool_bar_proxy.rb', line 42

def apply_preferred_size
  swt_widget.pack
  size = swt_widget.size
  cool_item_proxy.control = swt_widget
  preferred = swt_cool_item.computeSize(size.x, size.y)
  swt_cool_item.setPreferredSize(preferred)
end

#post_add_contentObject



38
39
40
# File 'lib/glimmer/swt/tool_bar_proxy.rb', line 38

def post_add_content
  apply_preferred_size if cool_item_proxy
end