1 19 20 package org.netbeans.modules.java.source; 21 22 import com.sun.tools.javac.api.JavacTaskImpl; 23 import java.io.IOException ; 24 import javax.tools.DiagnosticListener; 25 import javax.tools.JavaFileObject; 26 import org.netbeans.api.java.source.CancellableTask; 27 import org.netbeans.api.java.source.ClasspathInfo; 28 import org.netbeans.api.java.source.CompilationInfo; 29 import org.netbeans.api.java.source.JavaSource; 30 import org.netbeans.api.java.source.WorkingCopy; 31 import org.netbeans.api.java.source.query.QueryEnvironment; 32 import org.openide.ErrorManager; 33 34 38 public abstract class JavaSourceAccessor { 39 40 41 static { 42 try { 43 Class.forName("org.netbeans.api.java.source.JavaSource", true, JavaSourceAccessor.class.getClassLoader()); } catch (ClassNotFoundException e) { 45 ErrorManager.getDefault().notify (e); 46 } 47 } 48 49 public static JavaSourceAccessor INSTANCE; 50 51 52 public void runSpecialTask (final CancellableTask<CompilationInfo> task, final JavaSource.Priority priority) { 53 INSTANCE.runSpecialTaskImpl (task, priority); 54 } 55 56 protected abstract void runSpecialTaskImpl (CancellableTask<CompilationInfo> task, JavaSource.Priority priority); 57 58 public abstract JavacTaskImpl createJavacTask(ClasspathInfo cpInfo, DiagnosticListener<? super JavaFileObject> diagnosticListener, String sourceLevel); 59 60 61 67 public abstract JavacTaskImpl getJavacTask (CompilationInfo compilationInfo); 68 69 75 public abstract QueryEnvironment getCommandEnvironment(WorkingCopy copy); 76 77 84 public abstract CompilationInfo getCurrentCompilationInfo (JavaSource js, JavaSource.Phase phase) throws IOException ; 85 86 public abstract void revalidate(JavaSource js); 87 88 89 93 public abstract boolean isDispatchThread (); 94 95 } 96 | Popular Tags |