Sha256: e3a91173a796f1fc869fe8f3eb1c99f258a19dddada3aa9bc41d17f86abf581e

Contents?: true

Size: 926 Bytes

Versions: 1

Compression:

Stored size: 926 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.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

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-0.6.0 lib/glimmer/dsl/swt/tab_item_expression.rb