1 19 20 package org.netbeans.modules.retouche.source; 21 22 import java.io.IOException ; 23 import org.netbeans.api.retouche.source.ParserTaskImpl; 24 import org.netbeans.api.gsf.CancellableTask; 25 import org.netbeans.api.retouche.source.ClasspathInfo; 26 import org.netbeans.api.retouche.source.CompilationInfo; 27 import org.netbeans.api.retouche.source.Phase; 28 import org.netbeans.api.retouche.source.Source; 29 import org.netbeans.modules.gsf.Language; 30 import org.netbeans.modules.retouche.source.parsing.SourceFileObject; 31 import org.openide.ErrorManager; 32 33 43 public abstract class SourceAccessor { 44 45 46 static { 47 try { 48 Class.forName("org.netbeans.api.retouche.source.Source", true, SourceAccessor.class.getClassLoader()); } catch (ClassNotFoundException e) { 50 ErrorManager.getDefault().notify (e); 51 } 52 } 53 54 public static SourceAccessor INSTANCE; 55 56 57 public void runSpecialTask (final CancellableTask<CompilationInfo> task, final Source.Priority priority) { 58 INSTANCE.runSpecialTaskImpl (task, priority); 59 } 60 61 protected abstract void runSpecialTaskImpl (CancellableTask<CompilationInfo> task, Source.Priority priority); 62 63 public abstract ParserTaskImpl createParserTask(Language language, ClasspathInfo cpInfo, String sourceLevel); 64 65 66 public abstract ParserTaskImpl getParserTask (CompilationInfo compilationInfo); 73 74 81 public abstract CompilationInfo getCurrentCompilationInfo (Source js, Phase phase) throws IOException ; 82 83 public abstract void revalidate(Source js); 84 85 86 90 public abstract boolean isDispatchThread (); 91 92 } 93 | Popular Tags |