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