Sha256: 43bc5bde2c4780c8dcec6bc7dd4f4ce2ac2e4b5344efb34a4595f010c0d11a29

Contents?: true

Size: 1 KB

Versions: 30

Compression:

Stored size: 1 KB

Contents

require 'glimmer/dsl/expression'
require 'glimmer/data_binding/model_binding'
require 'glimmer/data_binding/table_items_binding'

module Glimmer
  module DSL
    module SWT
      #Depends on BindCommandHandler and TableColumnPropertiesDataBindingCommandHandler
      class TableItemsDataBindingExpression < Expression
        include_package 'org.eclipse.swt.widgets'
  
        def can_interpret?(parent, keyword, *args, &block)
          keyword == "items" and
            block.nil? and
            parent.respond_to?(:swt_widget) and
            parent.swt_widget.is_a?(Table) and
            args.size == 2 and
            args[0].is_a?(DataBinding::ModelBinding) and
            args[0].evaluate_property.is_a?(Array) and
            args[1].is_a?(Array)
        end
  
        def interpret(parent, keyword, *args, &block)
          model_binding = args[0]
          column_properties = args[1]
          DataBinding::TableItemsBinding.new(parent, model_binding, column_properties)
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
glimmer-dsl-swt-0.6.9 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.8 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.7 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.6 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.5 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.4 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.3 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.2 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.1 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.6.0 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.6 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.5 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.4 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.3 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.2 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.1 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.5.0 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.4.1 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.4.0 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb
glimmer-dsl-swt-0.3.1 lib/glimmer/dsl/swt/table_items_data_binding_expression.rb