Class: SWT::LabelCommand
- Inherits:
-
TreeCommand
- Object
- TreeCommand
- SWT::LabelCommand
- Defined in:
- lib/swt.rb
Instance Method Summary collapse
-
#initialize(parent, exp, index = 0) ⇒ LabelCommand
constructor
A new instance of LabelCommand.
- #invoke(stack) ⇒ Object
- #to_s ⇒ Object
Methods inherited from TreeCommand
Constructor Details
#initialize(parent, exp, index = 0) ⇒ LabelCommand
Returns a new instance of LabelCommand.
139 140 141 142 143 |
# File 'lib/swt.rb', line 139 def initialize(parent,exp,index=0) super(parent) @exp=exp @index=index end |
Instance Method Details
#invoke(stack) ⇒ Object
144 145 146 |
# File 'lib/swt.rb', line 144 def invoke(stack) stack.last.setText(@index,@exp.call(stack.last.getData("object")).to_s) end |
#to_s ⇒ Object
147 148 149 |
# File 'lib/swt.rb', line 147 def to_s "LabelCmd (#{@exp})" end |