Class: Glimmer::DSL::SWT::FontExpression

Inherits:
Expression
  • Object
show all
Includes:
TopLevelExpression
Defined in:
lib/glimmer/dsl/swt/font_expression.rb

Overview

font expression Note: Cannot be a static expression because it clashes with font property expression

Instance Method Summary collapse

Instance Method Details

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
# File 'lib/glimmer/dsl/swt/font_expression.rb', line 35

def can_interpret?(parent, keyword, *args, &block)
  keyword.to_s == 'font' and
    (parent.nil? || !parent.respond_to?('font')) and
    !parent.is_a?(Glimmer::SWT::Custom::Shape) and
    args.size == 1 and
    (args.first.is_a?(Hash) || args.first.is_a?(org.eclipse.swt.graphics.FontData))
end

#interpret(parent, keyword, *args, &block) ⇒ Object



43
44
45
# File 'lib/glimmer/dsl/swt/font_expression.rb', line 43

def interpret(parent, keyword, *args, &block)
  Glimmer::SWT::FontProxy.new(*args)
end