Class: Glimmer::DSL::SWT::DialogExpression

Inherits:
StaticExpression
  • Object
show all
Includes:
ParentExpression, TopLevelExpression
Defined in:
lib/glimmer/dsl/swt/dialog_expression.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


34
35
36
37
# File 'lib/glimmer/dsl/swt/dialog_expression.rb', line 34

def can_interpret?(parent, keyword, *args, &block)
  keyword == 'dialog' and
    (parent.nil? or parent.is_a?(Glimmer::SWT::ShellProxy))
end

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



39
40
41
42
43
44
# File 'lib/glimmer/dsl/swt/dialog_expression.rb', line 39

def interpret(parent, keyword, *args, &block)
  # TODO reconcile this with the actual org.eclipse.swt.widgets.Dialog widget (maybe rename this as dialog_shell)
  args = [parent] + args unless parent.nil?
  args += [:dialog_trim, :application_modal]
  Glimmer::SWT::ShellProxy.send(:new, *args)
end