Class: UU::OS::GVC::Dialog
- Inherits:
-
Object
- Object
- UU::OS::GVC::Dialog
- Defined in:
- uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb
Overview
Component for generating URIs for opening dialog windows.
Instance Attribute Summary (collapse)
-
- (Object) callback_action
The VUC action to trigger after the dialog is closed.
-
- (Object) height
The height of the dialog.
-
- (Object) use_case_uri
The use case to show in the dialog.
-
- (Object) width
The width of the dialog.
Instance Method Summary (collapse)
-
- (Dialog) initialize(use_case_uri, window_parameters = nil)
constructor
Creates a new instance of Dialog which can be used for opening a dialog.
-
- (String) to_s
Returns dialog as a String.
-
- (String) to_uri
Returns dialog as a URI.
Constructor Details
- (Dialog) initialize(use_case_uri, window_parameters = nil)
Creates a new instance of Dialog which can be used for opening a dialog. The Dialog is then typically converted to a UES-URI by using #to_uri method.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 49 def initialize(use_case_uri, window_parameters = nil) @use_case_uri = use_case_uri if !window_parameters.nil? && window_parameters.kind_of?(Hash) window_parameters.entries.each do |attribute| field_setter = get_setter(attribute[0]) begin self.send(field_setter, attribute[1]) rescue Exception => e raise e end end end end |
Instance Attribute Details
- (Object) callback_action
The VUC action to trigger after the dialog is closed.
21 22 23 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 21 def callback_action @callback_action end |
- (Object) height
The height of the dialog.
18 19 20 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 18 def height @height end |
- (Object) use_case_uri
The use case to show in the dialog.
12 13 14 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 12 def use_case_uri @use_case_uri end |
- (Object) width
The width of the dialog.
15 16 17 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 15 def width @width end |
Instance Method Details
- (String) to_s
Returns dialog as a String.
66 67 68 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 66 def to_s to_uri end |
- (String) to_uri
Returns dialog as a URI.
dialog = UU::OS::GVC::Dialog.new(uc_uri, { :width => 400 })
.action_uri = dialog.to_uri
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/dialog.rb', line 76 def to_uri win_params = { :target => "DIALOG_WINDOW" } if !@width.nil? then win_params[:width] = @width; end if !@height.nil? then win_params[:height] = @height; end if !@callback_action.nil? then win_params[:callbackAction] = @callback_action; end uri_builder = UU::OS::UESURIBuilder.parse_uesuri(@use_case_uri) uri_builder = uri_builder.add_parameter('windowParameters', win_params.to_json) uri_builder.to_uesuri end |