Class: MateExample::ReplaceContents1

Inherits:
Jface::Action
  • Object
show all
Defined in:
lib/javamateview/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#windowObject

Returns the value of attribute window.



260
261
262
# File 'lib/javamateview/example.rb', line 260

def window
  @window
end

Instance Method Details

#runObject



262
263
264
265
266
267
268
269
270
# File 'lib/javamateview/example.rb', line 262

def run
  s = Time.now
  ##until Time.now - s > 120
  @window.mate_text.getMateDocument.set(File.read(File.dirname(__FILE__) + "/test_big_ruby_file.rb")*3)
  #@window.mate_text.getMateDocument.set("def foo")
  #end
  puts "parse took #{Time.now - s}s"
  puts "num scopes: #{@window.mate_text.parser.root.count_descendants}"
end

#sourceObject



272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/javamateview/example.rb', line 272

def source
  foo=<<-RUBY
class ExitAction < Jface::Action
  attr_accessor :window

  def run
window.close
  end
end
  
RUBY
end