Class: Glimmer::DSL::SWT::WidgetExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::SWT::WidgetExpression
- Includes:
- ParentExpression
- Defined in:
- lib/glimmer/dsl/swt/widget_expression.rb
Constant Summary collapse
- EXCLUDED_KEYWORDS =
%w[shell display tab_item] + Glimmer::SWT::Custom::Shape.keywords - ['text']
Instance Method Summary collapse
- #add_content(parent, &block) ⇒ Object
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#add_content(parent, &block) ⇒ Object
46 47 48 49 |
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 46 def add_content(parent, &block) super parent.post_add_content end |
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
35 36 37 38 39 40 |
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 35 def can_interpret?(parent, keyword, *args, &block) result = !EXCLUDED_KEYWORDS.include?(keyword) && parent.respond_to?(:swt_widget) && #TODO change to composite?(parent) Glimmer::SWT::WidgetProxy.(keyword) (keyword.to_s == 'text' && args.first.is_a?(String)) ? false : result end |
#interpret(parent, keyword, *args, &block) ⇒ Object
42 43 44 |
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 42 def interpret(parent, keyword, *args, &block) Glimmer::SWT::WidgetProxy.create(keyword, parent, args) end |