public class RelatedFilesSafeDeleteProcessorDelegate extends java.lang.Object implements SafeDeleteProcessorDelegate
NestingTreeStructureProvider
some files in the Project View are shown as
children of another peer file. When going to delete such 'parent' file RelatedFilesSafeDeleteProcessorDelegate
suggests to delete child files as well. Example: when deleting foo.ts file user is suggested to delete generated foo.js and foo.js.map
files as well.EP_NAME
Constructor and Description |
---|
RelatedFilesSafeDeleteProcessorDelegate() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.String> |
findConflicts(PsiElement element,
PsiElement [] allElementsToDelete) |
NonCodeUsageSearchInfo |
findUsages(PsiElement element,
PsiElement [] allElementsToDelete,
java.util.List<UsageInfo> result) |
java.util.Collection<PsiElement> |
getAdditionalElementsToDelete(PsiElement element,
java.util.Collection<PsiElement> allElementsToDelete,
boolean askUser) |
java.util.Collection<? extends PsiElement> |
getElementsToSearch(PsiElement element,
java.util.Collection<PsiElement> allElementsToDelete)
Called before the refactoring dialog is shown.
|
boolean |
handlesElement(PsiElement element) |
boolean |
isToSearchForTextOccurrences(PsiElement element) |
boolean |
isToSearchInComments(PsiElement element) |
void |
prepareForDeletion(PsiElement element) |
UsageInfo[] |
preprocessUsages(Project project,
UsageInfo[] usages)
Called after the user has confirmed the refactoring.
|
void |
setToSearchForTextOccurrences(PsiElement element,
boolean enabled) |
void |
setToSearchInComments(PsiElement element,
boolean enabled) |
public RelatedFilesSafeDeleteProcessorDelegate()
public boolean handlesElement(PsiElement element)
handlesElement
in interface SafeDeleteProcessorDelegate
public java.util.Collection<PsiElement> getAdditionalElementsToDelete(PsiElement element, java.util.Collection<PsiElement> allElementsToDelete, boolean askUser)
getAdditionalElementsToDelete
in interface SafeDeleteProcessorDelegate
public NonCodeUsageSearchInfo findUsages(PsiElement element, PsiElement [] allElementsToDelete, java.util.List<UsageInfo> result)
findUsages
in interface SafeDeleteProcessorDelegate
public java.util.Collection<? extends PsiElement> getElementsToSearch(PsiElement element, java.util.Collection<PsiElement> allElementsToDelete)
SafeDeleteProcessorDelegate
getElementsToSearch
in interface SafeDeleteProcessorDelegate
element
- an element selected for deletion.allElementsToDelete
- all elements selected for deletion.public java.util.Collection<java.lang.String> findConflicts(PsiElement element, PsiElement [] allElementsToDelete)
findConflicts
in interface SafeDeleteProcessorDelegate
public UsageInfo[] preprocessUsages(Project project, UsageInfo[] usages)
SafeDeleteProcessorDelegate
preprocessUsages
in interface SafeDeleteProcessorDelegate
project
- the project where the refactoring happens.usages
- all usages to be processed by the refactoring.public void prepareForDeletion(PsiElement element) throws IncorrectOperationException
prepareForDeletion
in interface SafeDeleteProcessorDelegate
IncorrectOperationException
public boolean isToSearchInComments(PsiElement element)
isToSearchInComments
in interface SafeDeleteProcessorDelegate
public boolean isToSearchForTextOccurrences(PsiElement element)
isToSearchForTextOccurrences
in interface SafeDeleteProcessorDelegate
public void setToSearchInComments(PsiElement element, boolean enabled)
setToSearchInComments
in interface SafeDeleteProcessorDelegate
public void setToSearchForTextOccurrences(PsiElement element, boolean enabled)
setToSearchForTextOccurrences
in interface SafeDeleteProcessorDelegate