public class JavaInvertBooleanDelegate extends InvertBooleanDelegate
EP_NAME
Constructor and Description |
---|
JavaInvertBooleanDelegate() |
Modifier and Type | Method and Description |
---|---|
PsiElement |
adjustElement(PsiElement element,
Project project,
Editor editor)
Adjust element to invert, e.g.
|
boolean |
collectElementsToInvert(PsiElement namedElement,
PsiElement expression,
java.util.Collection<PsiElement> elementsToInvert) |
void |
collectRefElements(PsiElement element,
RenameProcessor renameProcessor,
java.lang.String newName,
java.util.Collection<PsiElement> elementsToInvert)
Eventually collect additional elements to rename, e.g.
|
void |
collectRefsToInvert(PsiElement namedElement,
java.util.Collection<PsiElement> elementsToInvert) |
void |
findConflicts(UsageInfo[] usageInfos,
MultiMap<PsiElement,java.lang.String> conflicts)
Detect usages which can't be inverted
|
PsiElement |
getElementToInvert(PsiElement namedElement,
PsiElement element)
Invoked from
InvertBooleanDelegate.collectForeignElementsToInvert(PsiElement, PsiElement, Language, Collection)
should be used to reject usages for elements from foreign language to be refactored |
void |
invertElementInitializer(PsiElement element)
Initialize variable with negated default initializer when default was initially omitted,
or invert variable initializer
|
boolean |
isAvailableOnElement(PsiElement element) |
boolean |
isVisibleOnElement(PsiElement element)
Quick check if element is potentially acceptable by delegate
|
void |
replaceWithNegatedExpression(PsiElement expression)
Replace expression with created negation
|
collectForeignElementsToInvert, findInvertBooleanDelegate
public boolean isVisibleOnElement(PsiElement element)
InvertBooleanDelegate
isVisibleOnElement
in class InvertBooleanDelegate
public boolean isAvailableOnElement(PsiElement element)
isAvailableOnElement
in class InvertBooleanDelegate
public PsiElement adjustElement(PsiElement element, Project project, Editor editor)
InvertBooleanDelegate
adjustElement
in class InvertBooleanDelegate
public void collectRefsToInvert(PsiElement namedElement, java.util.Collection<PsiElement> elementsToInvert)
public boolean collectElementsToInvert(PsiElement namedElement, PsiElement expression, java.util.Collection<PsiElement> elementsToInvert)
collectElementsToInvert
in class InvertBooleanDelegate
public PsiElement getElementToInvert(PsiElement namedElement, PsiElement element)
InvertBooleanDelegate
InvertBooleanDelegate.collectForeignElementsToInvert(PsiElement, PsiElement, Language, Collection)
should be used to reject usages for elements from foreign language to be refactoredgetElementToInvert
in class InvertBooleanDelegate
public void replaceWithNegatedExpression(PsiElement expression)
InvertBooleanDelegate
replaceWithNegatedExpression
in class InvertBooleanDelegate
expression
- to be inverted, found in InvertBooleanDelegate.collectRefElements(PsiElement, RenameProcessor, String, Collection)
public void invertElementInitializer(PsiElement element)
InvertBooleanDelegate
invertElementInitializer
in class InvertBooleanDelegate
public void collectRefElements(PsiElement element, RenameProcessor renameProcessor, java.lang.String newName, java.util.Collection<PsiElement> elementsToInvert)
InvertBooleanDelegate
collectRefElements
in class InvertBooleanDelegate
renameProcessor
- null if element is not named or name was not changedpublic void findConflicts(UsageInfo[] usageInfos, MultiMap<PsiElement,java.lang.String> conflicts)
InvertBooleanDelegate
findConflicts
in class InvertBooleanDelegate