Changeset 540

Show
Ignore:
Timestamp:
01/23/10 00:48:50 (3 years ago)
Author:
joerg
Message:
 
Location:
trunk/src/jlatexeditor
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/codehelper/BackgroundParser.java

    r539 r540  
    22 
    33import jlatexeditor.JLatexEditorJFrame; 
     4import sce.component.AbstractResource; 
    45import sce.component.SourceCodeEditor; 
    56import util.ParseUtil; 
     
    2627    while(true) { 
    2728      try { 
    28         synchronized (this) { wait(5000); } 
     29        synchronized (this) { wait(1000); } 
    2930      } catch (InterruptedException e) { } 
    3031 
    3132      SourceCodeEditor editor = jle.getMainEditor(); 
    32       String text = editor.getText(); 
    33       File directory = new File(editor.getResource().getName()).getParentFile(); 
     33      AbstractResource resource = editor.getResource(); 
     34      if(!(resource instanceof JLatexEditorJFrame.FileDoc)) continue; 
     35 
     36      String text= editor.getText(); 
     37      File file = ((JLatexEditorJFrame.FileDoc) resource).getFile(); 
     38      File directory = file.getParentFile(); 
    3439 
    3540      String bibCommand = "\\bibliography{"; 
     
    4550 
    4651  private void parseBib(File directory, String fileName) { 
     52    if(!fileName.endsWith(".bib")) fileName = fileName + ".bib"; 
    4753    File bibFile = new File(directory, fileName); 
    4854    if(bibFile.lastModified() == bibModified) return; 
  • trunk/src/jlatexeditor/codehelper/BibParser.java

    r539 r540  
    5353      entry.setBlock(block); 
    5454      results.add(entry); 
     55      System.out.println(entry); 
    5556    } 
    5657 
  • trunk/src/jlatexeditor/JLatexEditorJFrame.java

    r539 r540  
    77package jlatexeditor; 
    88 
     9import jlatexeditor.codehelper.BackgroundParser; 
    910import jlatexeditor.codehelper.JumpTo; 
    1011import jlatexeditor.codehelper.SpellCheckSuggester; 
     
    7071  private final ProgramUpdater updater = new ProgramUpdater("JLatexEditor update", "http://endrullis.de/JLatexEditor/update/"); 
    7172 
     73  // background parser 
     74  private BackgroundParser backgroundParser; 
    7275 
    7376  public static void main(String args[]){ 
     
    339342      }.start(); 
    340343    } 
     344 
     345    // background parser 
     346    backgroundParser = new BackgroundParser(this); 
     347    backgroundParser.start(); 
    341348  } 
    342349