public final class IntentionManagerImpl extends IntentionManager implements Disposable
Disposable.Parent
EP_INTENTION_ACTIONS, SHOW_INTENTION_OPTIONS_KEY
Constructor and Description |
---|
IntentionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addAction(IntentionAction action)
Registers an intention action.
|
void |
checkForDuplicates() |
LocalQuickFix |
convertToFix(IntentionAction action)
Wraps given action in a LocalQuickFix object.
|
IntentionAction |
createCleanupAllIntention() |
IntentionAction |
createFixAllIntention(InspectionToolWrapper toolWrapper,
IntentionAction action) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
IntentionAction [] |
getAvailableIntentionActions()
Returns all registered intention actions which are available now
(not disabled via Settings|Intentions or Alt-Enter|Disable intention quick fix)
|
java.util.List<IntentionAction> |
getCleanupIntentionOptions() |
IntentionAction [] |
getIntentionActions()
Returns all registered intention actions.
|
java.util.List<IntentionAction> |
getStandardIntentionOptions(HighlightDisplayKey displayKey,
PsiElement context) |
boolean |
hasActiveRequests() |
void |
registerIntentionAndMetaData(IntentionAction action,
java.lang.String... category)
Registers an intention action which can be enabled or disabled through the "Intention
Settings" dialog.
|
void |
unregisterIntention(IntentionAction intentionAction) |
<T extends java.lang.Throwable> |
withDisabledIntentions(ThrowableRunnable<T> runnable) |
getInstance, getInstance
public void registerIntentionAndMetaData(IntentionAction action, java.lang.String... category)
IntentionManager
IntentionAction.getFamilyName()
needs to
be created under the intentionDescriptions
directory of the resource root.
The directory needs to contain three files. description.html
provides the
description of the intention, before.java.template
provides the sample code
before the intention is invoked, and after.java.template
provides the sample
code after invoking the intention. The templates can contain a fragment of code surrounded
with <spot>
and </spot>
markers. If present, that fragment
will be surrounded by a blinking rectangle in the inspection preview pane.registerIntentionAndMetaData
in class IntentionManager
action
- the intention action to register.category
- the name of the category or categories under which the intention will be shown
in the "Intention Settings" dialog.public void unregisterIntention(IntentionAction intentionAction)
unregisterIntention
in class IntentionManager
public java.util.List<IntentionAction> getStandardIntentionOptions(HighlightDisplayKey displayKey, PsiElement context)
getStandardIntentionOptions
in class IntentionManager
public IntentionAction createFixAllIntention(InspectionToolWrapper toolWrapper, IntentionAction action)
createFixAllIntention
in class IntentionManager
public void dispose()
Disposable
dispose
in interface Disposable
public IntentionAction createCleanupAllIntention()
createCleanupAllIntention
in class IntentionManager
public java.util.List<IntentionAction> getCleanupIntentionOptions()
getCleanupIntentionOptions
in class IntentionManager
IntentionManager.createCleanupAllIntention()
e.g. edit enabled cleanup inspections or starting cleanup on predefined scopepublic LocalQuickFix convertToFix(IntentionAction action)
IntentionManager
convertToFix
in class IntentionManager
action
- action to convert.public void addAction(IntentionAction action)
IntentionManager
addAction
in class IntentionManager
action
- the intention action to register.public IntentionAction [] getIntentionActions()
IntentionManager
getIntentionActions
in class IntentionManager
public IntentionAction [] getAvailableIntentionActions()
IntentionManager
getAvailableIntentionActions
in class IntentionManager
public void checkForDuplicates()
public boolean hasActiveRequests()
public <T extends java.lang.Throwable> void withDisabledIntentions(ThrowableRunnable<T> runnable) throws T extends java.lang.Throwable
T extends java.lang.Throwable