| java.lang.Object org.netbeans.api.java.source.JavaSource
JavaSource | final public class JavaSource (Code) | | Class representing Java source file opened in the editor.
author: Petr Hrebejk, Tomas Zezula |
Inner Class :public static enum Phase | |
Inner Class :public static enum Priority | |
Inner Class :final public static class InsufficientMemoryException extends IOException | |
Inner Class :final static class ScanSync implements Future<Void> | |
Inner Class :final static class DeferredTask | |
Inner Class :static interface JavaFileObjectProvider | |
Inner Class :final static class DefaultJavaFileObjectProvider implements JavaFileObjectProvider | |
Inner Class :final static class DocPositionRegion extends PositionRegion | |
Method Summary | |
void | addPhaseCompletionTask(CancellableTask<CompilationInfo> task, Phase phase, Priority priority) Adds a task to given compilation phase. | public static JavaSource | create(ClasspathInfo cpInfo, Collection<? extends FileObject> files) Returns a
JavaSource instance representing given
org.openide.filesystems.FileObject s
and classpath represented by given
ClasspathInfo . | public static JavaSource | create(ClasspathInfo cpInfo, FileObject... files) Returns a
JavaSource instance representing given
org.openide.filesystems.FileObject s
and classpath represented by given
ClasspathInfo . | JavacTaskImpl | createJavacTask(DiagnosticListener<? super JavaFileObject> diagnosticListener, ClassNamesForFileOraculum oraculum) | public static JavaSource | forDocument(Document doc) Returns a
JavaSource instance associated to the given
javax.swing.Document ,
it returns null if the
Document is not
associated with data type providing the
JavaSource .
Parameters: doc - Document for which the JavaSource should be found/created. | public static JavaSource | forFileObject(FileObject fileObject) Returns a
JavaSource instance associated to given
org.openide.filesystems.FileObject ,
it returns null if the
Document is not associanted with data type providing the
JavaSource .
Parameters: fileObject - for which the JavaSource should be found/created. | public ClasspathInfo | getClasspathInfo() | public Collection<FileObject> | getFileObjects() | int | getReparseDelay() | boolean | isClassFile() | static void | logTime(FileObject source, Phase phase, long time) | static Phase | moveToPhase(Phase phase, CompilationInfoImpl currentInfo, boolean cancellable) | void | removePhaseCompletionTask(CancellableTask<CompilationInfo> task) Removes the task from the phase queue. | void | rescheduleTask(CancellableTask<CompilationInfo> task) Rerun the task in case it was already run. | void | revalidate() Marks this
JavaSource as modified, causes that the cached information are
cleared and all the PhaseCompletionTasks are restarted. | public ModificationResult | runModificationTask(Task<WorkingCopy> task) Runs a task which permits for modifying the sources. | public void | runUserActionTask(Task<CompilationController> task, boolean shared) Runs a task which permits for controlling phases of the parsing process.
You probably do not want to call this method unless you are reacting to
some user's GUI input which requires immediate action (e.g. | public Future<Void> | runWhenScanFinished(Task<CompilationController> task, boolean shared) Performs the given task when the scan finished. | void | setReparseDelay(int reparseDelay, boolean reset) |
jfoProvider | static JavaFileObjectProvider jfoProvider(Code) | | Used by unit tests
|
rootFo | final FileObject rootFo(Code) | | |
addPhaseCompletionTask | void addPhaseCompletionTask(CancellableTask<CompilationInfo> task, Phase phase, Priority priority) throws IOException(Code) | | Adds a task to given compilation phase. The tasks will run sequentially by
priority after given phase is reached.
See Also: CancellableTask See Also: for information about implementation requirements |
createJavacTask | JavacTaskImpl createJavacTask(DiagnosticListener<? super JavaFileObject> diagnosticListener, ClassNamesForFileOraculum oraculum)(Code) | | |
forFileObject | public static JavaSource forFileObject(FileObject fileObject) throws IllegalArgumentException(Code) | | Returns a
JavaSource instance associated to given
org.openide.filesystems.FileObject ,
it returns null if the
Document is not associanted with data type providing the
JavaSource .
Parameters: fileObject - for which the JavaSource should be found/created. JavaSource or null {@link IllegalArgumentException} if fileObject is null |
getReparseDelay | int getReparseDelay()(Code) | | |
isClassFile | boolean isClassFile()(Code) | | |
logTime | static void logTime(FileObject source, Phase phase, long time)(Code) | | |
moveToPhase | static Phase moveToPhase(Phase phase, CompilationInfoImpl currentInfo, boolean cancellable) throws IOException(Code) | | Not synchronized, only the CompilationJob's thread can call it!!!!
|
revalidate | void revalidate()(Code) | | Marks this
JavaSource as modified, causes that the cached information are
cleared and all the PhaseCompletionTasks are restarted.
The only client of this method should be the JavaDataObject or other DataObjects
providing the
JavaSource . If you call this method in another case you are
probably doing something incorrect.
|
runModificationTask | public ModificationResult runModificationTask(Task<WorkingCopy> task) throws IOException(Code) | | Runs a task which permits for modifying the sources.
Call to this method will cancel processing of all the phase completion tasks until
this task does not finish.
See Also: Task See Also: for information about implementation requirements Parameters: task - The task which. |
runUserActionTask | public void runUserActionTask(Task<CompilationController> task, boolean shared) throws IOException(Code) | | Runs a task which permits for controlling phases of the parsing process.
You probably do not want to call this method unless you are reacting to
some user's GUI input which requires immediate action (e.g. code completion popup).
In all other cases use
JavaSourceTaskFactory .
Call to this method will cancel processing of all the phase completion tasks until
this task does not finish.
See Also: org.netbeans.api.java.source.CancellableTask See Also: for information about implementation requirements Parameters: task - The task which. Parameters: shared - if true the java compiler may be reused by other org.netbeans.api.java.source.CancellableTasks,the value false may have negative impact on the IDE performance. |
runWhenScanFinished | public Future<Void> runWhenScanFinished(Task<CompilationController> task, boolean shared) throws IOException(Code) | | Performs the given task when the scan finished. When no background scan is running
it performs the given task synchronously. When the background scan is active it queues
the given task and returns, the task is performed when the background scan completes by
the thread doing the background scan.
Parameters: task - to be performed Parameters: shared - if true the java compiler may be reused by other org.netbeans.api.java.source.CancellableTasks,the value false may have negative impact on the IDE performance. Future which can be used to find out the sate of the task Future.isDone or Future.isCancelled.The caller may cancel the task using Future.cancel or wait until the task is performed Future.get. throws: IOException - encapsulating the exception thrown by CancellableTasks.run since: 0.12 |
setReparseDelay | void setReparseDelay(int reparseDelay, boolean reset)(Code) | | |
|
|