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, #swt_widget

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?, #content, current_custom_widgets, 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, shortcut_keyword, #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



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

def center_within_display
  body_root.center_within_display
end

#closeObject

TODO consider using Forwardable instead



61
62
63
# File 'lib/glimmer/ui/custom_shell.rb', line 61

def close
  body_root.close
end

#disposed?Boolean

Returns:

  • (Boolean)


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

def disposed?
  swt_widget.is_disposed
end

#hideObject



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

def hide
  body_root.hide
end

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

Raises:

  • (Error)


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

def initialize(parent, *swt_constants, options, &content)
  super
  auto_exec do
    @swt_widget.set_data('custom_shell', self)
    @swt_widget.set_data('custom_window', self)
  end
  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



51
52
53
# File 'lib/glimmer/ui/custom_shell.rb', line 51

def open
  body_root.open
end

#showObject

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



56
57
58
# File 'lib/glimmer/ui/custom_shell.rb', line 56

def show
  open
end

#start_event_loopObject



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

def start_event_loop
  body_root.start_event_loop
end

#visible?Boolean

Returns:

  • (Boolean)


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

def visible?
  body_root.visible?
end