use of com.intellij.codeInsight.intention.IntentionActionProvider in project intellij-community by JetBrains.
the class EditorNotificationActions method collectDescriptorsForEditor.
public static void collectDescriptorsForEditor(@NotNull Editor editor, @NotNull List<HighlightInfo.IntentionActionDescriptor> descriptors) {
Project project = editor.getProject();
if (project == null)
return;
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
if (!(fileEditorManager instanceof FileEditorManagerImpl))
return;
TextEditor fileEditor = TextEditorProvider.getInstance().getTextEditor(editor);
List<JComponent> components = ((FileEditorManagerImpl) fileEditorManager).getTopComponents(fileEditor);
for (JComponent component : components) {
if (component instanceof IntentionActionProvider) {
IntentionActionWithOptions action = ((IntentionActionProvider) component).getIntentionAction();
if (action != null) {
descriptors.add(new HighlightInfo.IntentionActionDescriptor(action, action.getOptions(), null));
}
}
}
}
Aggregations