Sha256: ffa5e27b1a6470d7270a890e58d8a159b06aa8c0a03ce26d805aaa55c585fa95

Contents?: true

Size: 934 Bytes

Versions: 12

Compression:

Stored size: 934 Bytes

Contents

require 'glimmer'
require 'glimmer/dsl/static_expression'
require 'glimmer/dsl/parent_expression'
require 'glimmer/swt/widget_proxy'
require 'glimmer/swt/tab_item_proxy'

module Glimmer
  module DSL
    module SWT
      class TabItemExpression < StaticExpression
        include ParentExpression
  
        include_package 'org.eclipse.swt.widgets'
  
        def can_interpret?(parent, keyword, *args, &block)
          initial_condition = (keyword == 'tab_item') and widget?(parent)
          if initial_condition
            if parent.swt_widget.is_a?(TabFolder)
              return true
            else
              Glimmer::Config.logger&.error "tab_item widget may only be used directly under a tab_folder widget!"
            end
          end
          false
        end
  
        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::TabItemProxy.new(parent, args)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
glimmer-0.8.2 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.8.1 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.8.0 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.8 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.7 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.6 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.5 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.4 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.3 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.2 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.1 lib/glimmer/dsl/swt/tab_item_expression.rb
glimmer-0.7.0 lib/glimmer/dsl/swt/tab_item_expression.rb