44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb', line 44
def interpret(parent, keyword, *args, &block)
model_binding = args[0]
widget_binding = DataBinding::WidgetBinding.new(parent, 'items', sync_exec: model_binding.binding_options[:sync_exec], async_exec: model_binding.binding_options[:async_exec])
widget_binding.call(model_binding.evaluate_options_property)
model = model_binding.base_model
widget_binding.observe(model, model_binding.options_property_name)
property_type = :string
property_type = :array if parent.has_style?(:multi)
list_selection_binding = DataBinding::ListSelectionBinding.new(parent, property_type, sync_exec: model_binding.binding_options[:sync_exec], async_exec: model_binding.binding_options[:async_exec])
list_selection_binding.call(model_binding.evaluate_property)
list_selection_binding.observe(model_binding)
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: model_binding.binding_options[:sync_exec], override_async_exec: model_binding.binding_options[:async_exec]) do
parent.on_widget_selected do
model_binding.call(list_selection_binding.evaluate_property)
end
end
end
|