Class: JavaMateView::MateText

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

Instance Method Summary collapse

Instance Method Details

#delay_parsingObject



33
34
35
36
37
# File 'lib/javamateview.rb', line 33

def delay_parsing
  parser.parserScheduler.deactivate
  yield
  parser.parserScheduler.reactivate
end

#set_root_scope_by_content_name(grammar_name, name) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/javamateview.rb', line 21

def set_root_scope_by_content_name(grammar_name, name)
  scope = JavaMateView::Scope.new(self, "re")
  bs = JavaMateView::Bundle.bundles
  ruby = bs.detect {|b| b.name == grammar_name}
  ps = ruby.grammars.first.patterns
  dps = ps.select {|pt| pt.is_a?(Java::ComRedcareditorMate::DoublePattern) }  
  rps = dps.detect {|pt| pt.contentName == name }
  scope.pattern = rps
  scope.isOpen = true
  self.parser.root = scope
end