public class CoreJavaDirectoryService extends JavaDirectoryService
Constructor and Description |
---|
CoreJavaDirectoryService() |
Modifier and Type | Method and Description |
---|---|
void |
checkCreateClass(PsiDirectory dir,
java.lang.String name)
Checks if it's possible to create a class with the specified name in the directory,
and throws an exception if the creation is not possible.
|
PsiClass |
createAnnotationType(PsiDirectory dir,
java.lang.String name)
Creates an annotation class with the specified name in the directory.
|
PsiClass |
createClass(PsiDirectory dir,
java.lang.String name)
Creates a class with the specified name in the directory.
|
PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName)
Creates a class with the specified name in the directory.
|
PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName,
boolean askForUndefinedVariables) |
PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName,
boolean askForUndefinedVariables,
java.util.Map<java.lang.String,java.lang.String> additionalProperties) |
PsiClass |
createEnum(PsiDirectory dir,
java.lang.String name)
Creates an enumeration class with the specified name in the directory.
|
PsiClass |
createInterface(PsiDirectory dir,
java.lang.String name)
Creates an interface class with the specified name in the directory.
|
PsiClass |
createRecord(PsiDirectory dir,
java.lang.String name)
Creates a record class with the specified name in the directory.
|
PsiClass [] |
getClasses(PsiDirectory dir)
Returns the list of Java classes contained in the directory.
|
LanguageLevel |
getLanguageLevel(PsiDirectory dir) |
PsiPackage |
getPackage(PsiDirectory dir)
Returns the package corresponding to the directory.
|
PsiPackage |
getPackageInSources(PsiDirectory dir)
Returns the package corresponding to the directory.
|
static PsiClass [] |
getPsiClasses(PsiDirectory dir,
PsiFile[] psiFiles) |
boolean |
isSourceRoot(PsiDirectory dir)
Checks if the directory is a source root for the project to which it belongs.
|
getInstance
public PsiPackage getPackage(PsiDirectory dir)
JavaDirectoryService
getPackage
in class JavaDirectoryService
public PsiPackage getPackageInSources(PsiDirectory dir)
JavaDirectoryService
getPackageInSources
in class JavaDirectoryService
public PsiClass [] getClasses(PsiDirectory dir)
JavaDirectoryService
getClasses
in class JavaDirectoryService
public static PsiClass [] getPsiClasses(PsiDirectory dir, PsiFile[] psiFiles)
public PsiClass createClass(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createClass
in class JavaDirectoryService
name
- the name of the class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName) throws IncorrectOperationException
JavaDirectoryService
createClass
in class JavaDirectoryService
name
- the name of the class to create (not including the file extension).templateName
- custom file template to create class text based on.IncorrectOperationException
- if the operation failed for some reason.public PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName, boolean askForUndefinedVariables) throws IncorrectOperationException
createClass
in class JavaDirectoryService
askForUndefinedVariables
- true show dialog asking for undefined variables
false leave them blankIncorrectOperationException
public PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName, boolean askForUndefinedVariables, java.util.Map<java.lang.String,java.lang.String> additionalProperties) throws IncorrectOperationException
createClass
in class JavaDirectoryService
additionalProperties
- additional properties to be substituted in the templateIncorrectOperationException
public void checkCreateClass(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
checkCreateClass
in class JavaDirectoryService
name
- the name of the class to check creation possibility (not including the file extension).IncorrectOperationException
- if the creation is not possible.public PsiClass createInterface(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createInterface
in class JavaDirectoryService
name
- the name of the interface to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public PsiClass createEnum(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createEnum
in class JavaDirectoryService
name
- the name of the enumeration class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public PsiClass createRecord(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createRecord
in class JavaDirectoryService
name
- the name of the record class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public PsiClass createAnnotationType(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createAnnotationType
in class JavaDirectoryService
name
- the name of the annotation class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public boolean isSourceRoot(PsiDirectory dir)
JavaDirectoryService
isSourceRoot
in class JavaDirectoryService
public LanguageLevel getLanguageLevel(PsiDirectory dir)
getLanguageLevel
in class JavaDirectoryService