Sha256: 11e593de2ffdbb26baf62347f22409665059b7f57498b3d987baf48065adad7c

Contents?: true

Size: 862 Bytes

Versions: 2

Compression:

Stored size: 862 Bytes

Contents

require File.dirname(__FILE__) + "/../../command_handler"
require File.dirname(__FILE__) + "/../custom_widget"
require File.dirname(__FILE__) + "/../g_widget"

module Glimmer
  module SWT
    module CommandHandlers
      class WidgetCommandHandler
        include CommandHandler

        include_package 'org.eclipse.swt.widgets'
        include_package 'org.eclipse.swt.browser'

        def can_handle?(parent, command_symbol, *args, &block)
          (parent.is_a?(GWidget) || parent.is_a?(SWT::CustomWidget)) and
          command_symbol.to_s != "shell" and
          GWidget.widget_exists?(command_symbol.to_s)
        end

        def do_handle(parent, command_symbol, *args, &block)
          Glimmer.logger.debug "widget styles are: " + args.inspect
          GWidget.new(command_symbol.to_s, parent.widget, args)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glimmer-0.4.6 lib/glimmer/swt/command_handlers/widget_command_handler.rb
glimmer-0.4.5 lib/glimmer/swt/command_handlers/widget_command_handler.rb