public interface PsiDirectory extends PsiFileSystemItem
Iconable.IconFlags, Iconable.LastComputedIcon
Modifier and Type | Field and Description |
---|---|
static PsiDirectory[] |
EMPTY_ARRAY
The empty array of PSI directories which can be reused to avoid unnecessary allocations.
|
ARRAY_FACTORY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier and Type | Method and Description |
---|---|
void |
checkCreateFile(java.lang.String name)
Checks if it's possible to create a file with the specified name in the directory,
and throws an exception if the creation is not possible.
|
void |
checkCreateSubdirectory(java.lang.String name)
Checks if it's possible to create a subdirectory with the specified name in the directory,
and throws an exception if the creation is not possible.
|
PsiFile |
copyFileFrom(java.lang.String newName,
PsiFile originalFile) |
PsiFile |
createFile(java.lang.String name)
Creates a file with the specified name in the directory.
|
PsiDirectory |
createSubdirectory(java.lang.String name)
Creates a subdirectory with the specified name in the directory.
|
PsiFile |
findFile(java.lang.String name)
Finds a file with the specified name in this directory.
|
PsiDirectory |
findSubdirectory(java.lang.String name)
Finds the subdirectory of this directory with the specified name.
|
PsiFile [] |
getFiles()
Returns the list of files in the directory.
|
java.lang.String |
getName()
Returns the name of the element.
|
PsiDirectory |
getParent()
Returns the parent of the PSI element.
|
PsiDirectory |
getParentDirectory()
Returns the parent directory of the directory.
|
PsiDirectory [] |
getSubdirectories()
Returns the list of subdirectories of this directory.
|
VirtualFile |
getVirtualFile()
Returns the virtual file represented by the PSI directory.
|
PsiElement |
setName(java.lang.String name)
Renames the element.
|
isDirectory, processChildren
checkSetName
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
getPresentation
canNavigate, canNavigateToSource, navigate
static final PsiDirectory[] EMPTY_ARRAY
VirtualFile getVirtualFile()
getVirtualFile
in interface PsiFileSystemItem
java.lang.String getName()
PsiNamedElement
getName
in interface NavigationItem
getName
in interface PsiFileSystemItem
getName
in interface PsiNamedElement
PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElement
setName
in interface PsiNamedElement
name
- the new element name.this
or a different element if the rename caused the element to be replaced).IncorrectOperationException
- if the modification is not supported or not possible for some reason.PsiDirectory getParentDirectory()
PsiDirectory getParent()
PsiElement
getParent
in interface PsiElement
getParent
in interface PsiFileSystemItem
PsiDirectory [] getSubdirectories()
PsiFile [] getFiles()
PsiDirectory findSubdirectory(java.lang.String name)
name
- the name of the subdirectory to find.PsiFile findFile(java.lang.String name)
name
- the name of the file to find.PsiDirectory createSubdirectory(java.lang.String name) throws IncorrectOperationException
name
- the name of the subdirectory to create.IncorrectOperationException
- if the operation failed for some reason.void checkCreateSubdirectory(java.lang.String name) throws IncorrectOperationException
name
- the name of the subdirectory to check creation possibility.IncorrectOperationException
- if the creation is not possible.PsiFile createFile(java.lang.String name) throws IncorrectOperationException
name
- the name of the file to create.IncorrectOperationException
- if the operation failed for some reason.PsiFile copyFileFrom(java.lang.String newName, PsiFile originalFile) throws IncorrectOperationException
IncorrectOperationException
void checkCreateFile(java.lang.String name) throws IncorrectOperationException
name
- the name of the file to check creation possibility.IncorrectOperationException
- if the creation is not possible.