Sha256: 6842feeab185f0157bfec92f452ab77189dbcee89e25956c5c9f74d60b1e604b

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

Dir[File.dirname(__FILE__) + "/*.jar"].each {|fn| require fn }

module JavaMateView
  import com.redcareditor.mate.Bundle
  import com.redcareditor.mate.Grammar
  import com.redcareditor.mate.MateText
  import com.redcareditor.mate.Parser
  import com.redcareditor.mate.Pattern
  import com.redcareditor.mate.Scope
  import com.redcareditor.mate.ScopeMatcher
  import com.redcareditor.theme.Theme
  import com.redcareditor.theme.ThemeManager
  
  class MateText
    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
    
    def delay_parsing
      parser.deactivate
      yield
      parser.reactivate
    end
  end
end

 

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redcar-0.3.4.3 plugins/edit_view_swt/vendor/java-mateview.rb
redcar-0.3.4.2 plugins/edit_view_swt/vendor/java-mateview.rb
redcar-0.3.4.1 plugins/edit_view_swt/vendor/java-mateview.rb
redcar-0.3.4 plugins/edit_view_swt/vendor/java-mateview.rb