public class JavaDirectoryServiceImpl extends CoreJavaDirectoryService
Constructor and Description |
---|
JavaDirectoryServiceImpl() |
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.
|
static void |
checkCreateClassOrInterface(PsiDirectory directory,
java.lang.String name) |
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.
|
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.
|
boolean |
isSourceRoot(PsiDirectory dir)
Checks if the directory is a source root for the project to which it belongs.
|
getClasses, getPsiClasses
getInstance
public PsiPackage getPackage(PsiDirectory dir)
JavaDirectoryService
getPackage
in class CoreJavaDirectoryService
public PsiPackage getPackageInSources(PsiDirectory dir)
JavaDirectoryService
getPackageInSources
in class CoreJavaDirectoryService
public PsiClass createClass(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createClass
in class CoreJavaDirectoryService
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 CoreJavaDirectoryService
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 CoreJavaDirectoryService
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 CoreJavaDirectoryService
additionalProperties
- additional properties to be substituted in the templateIncorrectOperationException
public PsiClass createInterface(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
createInterface
in class CoreJavaDirectoryService
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 CoreJavaDirectoryService
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 CoreJavaDirectoryService
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 CoreJavaDirectoryService
name
- the name of the annotation class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public void checkCreateClass(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
JavaDirectoryService
checkCreateClass
in class CoreJavaDirectoryService
name
- the name of the class to check creation possibility (not including the file extension).IncorrectOperationException
- if the creation is not possible.public static void checkCreateClassOrInterface(PsiDirectory directory, java.lang.String name) throws IncorrectOperationException
IncorrectOperationException
public boolean isSourceRoot(PsiDirectory dir)
JavaDirectoryService
isSourceRoot
in class CoreJavaDirectoryService
public LanguageLevel getLanguageLevel(PsiDirectory dir)
getLanguageLevel
in class CoreJavaDirectoryService