module Glimmer::UI::CustomShell
Public Class Methods
encoded_request_parameter_string()
click to toggle source
# 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)
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 42 def included(klass) klass.extend(CustomWidget::ClassMethods) klass.extend(CustomShell::ClassMethods) klass.include(Glimmer) Glimmer::UI::CustomWidget.add_custom_widget_namespaces_for(klass) keyword = klass.name.split(':').last.underscore LocalStorage[keyword] = $LOADED_FEATURES.last end
new(parent, args, options, &content)
click to toggle source
Calls superclass method
Glimmer::UI::CustomWidget::new
# 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
request_parameter_string()
click to toggle source
# 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?()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 63 def requested? request_parameter_string.include?('custom_shell=') end
requested_and_not_handled?()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 59 def requested_and_not_handled? requested? && !request_parameter_string.include?('custom_shell_handled=true') end
Public Instance Methods
center()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 104 def center body_root.center end
close()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 92 def close body_root.close end
hide()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 96 def hide body_root.hide end
open(async: true)
click to toggle source
# 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()
click to toggle source
DO NOT OVERRIDE. JUST AN ALIAS FOR `#open`. OVERRIDE `#open` INSTEAD.
# File lib/glimmer/ui/custom_shell.rb, line 88 def show open end
start_event_loop()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 108 def start_event_loop body_root.start_event_loop end
visible?()
click to toggle source
# File lib/glimmer/ui/custom_shell.rb, line 100 def visible? body_root.visible? end