Module: Glimmer::UI::CustomShell
- Includes:
- CustomWidget
- Included in:
- ContactManager, EmailShell, HelloButton, HelloCCombo, HelloCTab, HelloCanvas, HelloCheckbox, HelloCheckboxGroup, HelloCombo, HelloComposite, HelloComputed, HelloCursor, HelloLabel, HelloLayout, HelloPrint, HelloProgressBar, HelloRadio, HelloRadioGroup, HelloScale, HelloSlider, HelloSpinner, HelloTab, HelloTable, HelloText, Login, Tetris, Tetris::View::HighScoreDialog, Weather
- Defined in:
- lib/glimmer/ui/custom_shell.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary
Attributes included from CustomWidget
#body_root, #options, #parent, #swt_style
Class Method Summary
collapse
Instance Method Summary
collapse
add_custom_widget_namespaces_for, #add_observer, #async_exec, #attribute_setter, #can_add_observer?, #can_handle_observation_request?, #content, custom_widget_namespaces, for, #get_attribute, #handle_observation_request, #has_attribute?, #has_instance_method?, #has_style?, #local_respond_to?, #method_missing, namespaces_for_class, #post_initialize_child, reset_custom_widget_namespaces, #respond_to?, #set_attribute, #sync_exec
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Glimmer::UI::CustomWidget
Class Method Details
.encoded_request_parameter_string ⇒ Object
55
56
57
|
# File 'lib/glimmer/ui/custom_shell.rb', line 55
def encoded_request_parameter_string
`document.location.href`.match(/\?(.*)$/).to_a[1].to_s
end
|
.included(klass) ⇒ Object
.request_parameter_string ⇒ Object
51
52
53
|
# File 'lib/glimmer/ui/custom_shell.rb', line 51
def request_parameter_string
URI.decode_www_form_component(`document.location.href`.match(/\?(.*)$/).to_a[1].to_s)
end
|
.requested? ⇒ Boolean
63
64
65
|
# File 'lib/glimmer/ui/custom_shell.rb', line 63
def requested?
request_parameter_string.include?('custom_shell=')
end
|
.requested_and_not_handled? ⇒ Boolean
59
60
61
|
# File 'lib/glimmer/ui/custom_shell.rb', line 59
def requested_and_not_handled?
requested? && !request_parameter_string.include?('custom_shell_handled=true')
end
|
Instance Method Details
#close ⇒ Object
92
93
94
|
# File 'lib/glimmer/ui/custom_shell.rb', line 92
def close
body_root.close
end
|
#hide ⇒ Object
96
97
98
|
# File 'lib/glimmer/ui/custom_shell.rb', line 96
def hide
body_root.hide
end
|
#initialize(parent, args, options, &content) ⇒ Object
68
69
70
71
72
73
|
# File 'lib/glimmer/ui/custom_shell.rb', line 68
def initialize(parent, args, options, &content)
super(parent, args, options, &content)
body_root.set_data('custom_shell', self)
body_root.set_data('custom_window', self)
raise Error, 'Invalid custom shell body root! Must be a shell or another custom shell.' unless body_root.is_a?(Glimmer::SWT::ShellProxy) || body_root.is_a?(Glimmer::UI::CustomShell)
end
|
#open(async: true) ⇒ Object
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/glimmer/ui/custom_shell.rb', line 75
def open(async: true)
work = lambda do
body_root.open
end
if async
Glimmer::SWT::DisplayProxy.instance.async_exec(&work)
else
work.call
end
end
|
#show ⇒ Object
DO NOT OVERRIDE. JUST AN ALIAS FOR ‘#open`. OVERRIDE `#open` INSTEAD.
88
89
90
|
# File 'lib/glimmer/ui/custom_shell.rb', line 88
def show
open
end
|
#start_event_loop ⇒ Object
104
105
106
|
# File 'lib/glimmer/ui/custom_shell.rb', line 104
def start_event_loop
body_root.start_event_loop
end
|
#visible? ⇒ Boolean
100
101
102
|
# File 'lib/glimmer/ui/custom_shell.rb', line 100
def visible?
body_root.visible?
end
|