Module: Glimmer::UI::CustomShell

Includes:
CustomWidget, SuperModule
Defined in:
lib/glimmer/ui/custom_shell.rb

Instance Attribute Summary

Attributes included from CustomWidget

#body_root, #options, #parent, #parent_proxy, #swt_style_symbols

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CustomWidget

add_custom_widget_namespaces_for, #add_observer, after_body, #async_exec, #attribute_setter, before_body, body, #can_add_observer?, #can_handle_observation_request?, #children_owner, #content, custom_widget_namespaces, def_option_attr_accessors, flyweight_custom_widget_classes, for, #get_attribute, #handle_observation_request, #has_attribute?, #has_instance_method?, #has_style?, keyword, #local_respond_to?, #method_missing, namespaces_for_class, #observer_registrations, option, options, #post_add_content, #post_initialize_child, reset_custom_widget_namespaces, #respond_to?, #set_attribute, #shell_proxy, shortcut_keyword, #swt_style, #sync_exec, #timer_exec

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::UI::CustomWidget

Class Method Details

.launch(*args, &content) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/glimmer/ui/custom_shell.rb', line 32

def launch(*args, &content)
  launched_custom_shell = send(keyword, *args, &content)
  auto_exec do
    launched_custom_shell.swt_widget.set_data('launched', true)
    launched_custom_shell.open
  end
end

Instance Method Details

#center_within_displayObject



85
86
87
# File 'lib/glimmer/ui/custom_shell.rb', line 85

def center_within_display
  body_root.center_within_display
end

#closeObject

TODO consider using Forwardable instead



69
70
71
# File 'lib/glimmer/ui/custom_shell.rb', line 69

def close
  body_root.close
end

#disposed?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/glimmer/ui/custom_shell.rb', line 81

def disposed?
  swt_widget.is_disposed
end

#hideObject



73
74
75
# File 'lib/glimmer/ui/custom_shell.rb', line 73

def hide
  body_root.hide
end

#initialize(parent, *swt_constants, options, &content) ⇒ Object

Raises:

  • (Error)


41
42
43
44
# File 'lib/glimmer/ui/custom_shell.rb', line 41

def initialize(parent, *swt_constants, options, &content)
  super
  raise Error, 'Invalid custom shell (window) body root! Must be a shell (window) or another custom shell (window).' unless body_root.swt_widget.is_a?(org.eclipse.swt.widgets.Shell)
end

#openObject

Classes may override



59
60
61
# File 'lib/glimmer/ui/custom_shell.rb', line 59

def open
  body_root.open
end

#showObject

DO NOT OVERRIDE. JUST AN ALIAS FOR ‘#open`. OVERRIDE `#open` INSTEAD.



64
65
66
# File 'lib/glimmer/ui/custom_shell.rb', line 64

def show
  open
end

#start_event_loopObject



89
90
91
# File 'lib/glimmer/ui/custom_shell.rb', line 89

def start_event_loop
  body_root.start_event_loop
end

#swt_widgetObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/glimmer/ui/custom_shell.rb', line 46

def swt_widget
  if @swt_widget.nil? && children_owner
    @swt_widget = children_owner.swt_widget
    auto_exec do
      @swt_widget.set_data('custom_widget', self)
      @swt_widget.set_data('custom_shell', self)
      @swt_widget.set_data('custom_window', self)
    end
  end
  @swt_widget
end

#visible?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/glimmer/ui/custom_shell.rb', line 77

def visible?
  body_root.visible?
end