Module: Glimmer::UI::CustomShell

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

Class Attribute Summary collapse

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, #pack, #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 Attribute Details

.launched_custom_shellObject (readonly)

Returns the value of attribute launched_custom_shell.



31
32
33
# File 'lib/glimmer/ui/custom_shell.rb', line 31

def launched_custom_shell
  @launched_custom_shell
end

Class Method Details

.launch(*args, &content) ⇒ Object



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

def launch(*args, &content)
  @launched_custom_shell = send(keyword, *args, &content) if @launched_custom_shell.nil? || @launched_custom_shell.disposed?
  @launched_custom_shell.swt_widget.set_data('launched', true)
  @launched_custom_shell.open
end

Instance Method Details

#center_within_displayObject



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

def center_within_display
  body_root.center_within_display
end

#closeObject

TODO consider using Forwardable instead



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

def close
  body_root.close
end

#disposed?Boolean

Returns:

  • (Boolean)


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

def disposed?
  swt_widget.is_disposed
end

#hideObject



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

def hide
  body_root.hide
end

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

Raises:

  • (Error)


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

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

#openObject

Classes may override



47
48
49
# File 'lib/glimmer/ui/custom_shell.rb', line 47

def open
  body_root.open
end

#showObject

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



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

def show
  open
end

#start_event_loopObject



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

def start_event_loop
  body_root.start_event_loop
end

#visible?Boolean

Returns:

  • (Boolean)


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

def visible?
  body_root.visible?
end