public class JdevProviderContext extends ProviderContext
BaseFileProvider is an abstract starting point for
an implementation of the JavaFileProvider interface that relies
on a JavaClassLocator instance for locating Java class and
source files. This implementation contains no caching.
| Modifier and Type | Class and Description |
|---|---|
protected class |
JdevProviderContext.NodeObserver
The NodeObserver attaches to nodes for which we have created
SourceFile instances for, and tracks the given node until
the node is closed, or renamed.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.net.URL,JdevProviderContext.NodeObserver> |
_urlToObserverMap
The set of URLs that we are currently tracking.
|
protected static java.lang.Class |
JAVACLASSNODE_CLASS
The JavaClassNode class instance
|
protected static java.lang.Class |
JAVASOURCENODE_CLASS
The JavaSourceNode class instance
|
CLASS_SUFFIX, provider, SOURCE_SUFFIXCLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE| Constructor and Description |
|---|
JdevProviderContext(boolean allowInMemoryIn) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearTracking()
Utility routine to stop tracking all Nodes.
|
SourceFile |
createSourceFile(java.net.URL sourceURL,
int j2se)
Deprecated.
Use createSourceFile( URL, JdkVersion ) instead
|
SourceFile |
createSourceFile(java.net.URL sourceURL,
JdkVersion jdkVersion)
Instead of directly interacting with the filesystem, use the
Ide's Node model.
|
protected int |
getFileType(java.net.URL url)
Use the recognizer to check for source files and class files.
|
SourceFile |
getSourceFile(java.net.URL url,
int j2se)
Deprecated.
Use getSourceFile( URL, JdkVersion ) instead
|
SourceFile |
getSourceFile(java.net.URL url,
JdkVersion jdkVersion)
Gets a new SourceFile for the source file at the given
URL.
|
protected SourcePreferences |
getSourcePreferences()
Retrieve preferences options from the coding style manager.
|
protected TextBuffer |
getTextBuffer(java.net.URL url)
Fetch the TextBuffer for the given URL.
|
protected void |
startTracking(java.net.URL url)
Utility routine to start tracking the Node represented by the URL.
|
protected void |
stopTracking(java.net.URL url)
Utility routine to stop tracking the Node represented by the URL.
|
boolean |
writeSourceFile(SourceFile file)
Called when SourceTransaction.commit() is called for the given
file.
|
getLightSourceFile, getLightSourceFile, getProvider, getSourceFile, getSourceFile, getSourceFileImpl, getSourceFileImpl, setProviderprotected static final java.lang.Class JAVACLASSNODE_CLASS
protected static final java.lang.Class JAVASOURCENODE_CLASS
protected java.util.Map<java.net.URL,JdevProviderContext.NodeObserver> _urlToObserverMap
protected final int getFileType(java.net.URL url)
getFileType in class ProviderContextprotected final SourcePreferences getSourcePreferences()
getSourcePreferences in class ProviderContextpublic SourceFile createSourceFile(java.net.URL sourceURL, JdkVersion jdkVersion) throws java.io.IOException, java.lang.IllegalArgumentException
createSourceFile in class ProviderContextsourceURL - The source URL to create a new Java file for.jdkVersion - The desired JdkVersion for the sourcejava.io.IOException - if the new file cannot be created.java.lang.IllegalArgumentException - if the URL is not recognized
as a Java source file.@Deprecated public SourceFile createSourceFile(java.net.URL sourceURL, int j2se) throws java.io.IOException, java.lang.IllegalArgumentException
createSourceFile in class ProviderContextjava.io.IOExceptionjava.lang.IllegalArgumentExceptionpublic SourceFile getSourceFile(java.net.URL url, JdkVersion jdkVersion)
ProviderContextgetSourceFile in class ProviderContexturl - The source URL for which to create a new SourceFile.jdkVersion - The desired JdkVersion for the source@Deprecated public SourceFile getSourceFile(java.net.URL url, int j2se)
getSourceFile in class ProviderContextpublic boolean writeSourceFile(SourceFile file)
ProviderContextwriteSourceFile in class ProviderContextprotected TextBuffer getTextBuffer(java.net.URL url)
getTextBuffer in class ProviderContextprotected void startTracking(java.net.URL url)
startTracking in class ProviderContextprotected void stopTracking(java.net.URL url)
public void clearTracking()
clearTracking in class ProviderContext