Class: SWT::ContainerTreeCommand

Inherits:
TreeCommand show all
Defined in:
lib/swt.rb

Direct Known Subclasses

ChildCommand, ChildrenCommand, ConditionalCommand

Instance Method Summary collapse

Methods inherited from TreeCommand

#stacktrace

Constructor Details

#initialize(parent) ⇒ ContainerTreeCommand


59
60
61
62
# File 'lib/swt.rb', line 59

def initialize(parent)
  super(parent)
  @children=[]
end

Instance Method Details

#accept(child) ⇒ Object


63
64
65
66
# File 'lib/swt.rb', line 63

def accept(child)
  @children << child
  child
end

#invoke(stack) ⇒ Object


67
68
69
# File 'lib/swt.rb', line 67

def invoke(stack)
  @children.each { |x| x.invoke stack}
end

#to_sObject


70
71
72
# File 'lib/swt.rb', line 70

def to_s
  "#{self.class} ([#{@children.join ','}])"
end