Class: Glimmer::DSL::MenuExpression
Instance Method Summary
collapse
#add_content
inherited
Methods inherited from Expression
#add_content, #textual?, #widget?
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/glimmer/dsl/menu_expression.rb', line 13
def can_interpret?(parent, keyword, *args, &block)
initial_condition = (keyword == 'menu')
if initial_condition
if widget?(parent)
return true
else
raise Glimmer::Error, "menu may only be nested under a widget (like shell or another menu)!"
end
end
false
end
|
#interpret(parent, keyword, *args, &block) ⇒ Object
25
26
27
|
# File 'lib/glimmer/dsl/menu_expression.rb', line 25
def interpret(parent, keyword, *args, &block)
SWT::.new(parent, args)
end
|