Search in sources :

Example 1 with QuickFixAction

use of com.intellij.codeInspection.ex.QuickFixAction in project intellij-community by JetBrains.

the class QuickFixesViewActionGroup method getChildren.

@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
    final InspectionResultsView view = getView(e);
    if (view == null || InvokeQuickFixAction.cantApplyFixes(view)) {
        return AnAction.EMPTY_ARRAY;
    }
    InspectionToolWrapper toolWrapper = view.getTree().getSelectedToolWrapper(true);
    if (toolWrapper == null)
        return AnAction.EMPTY_ARRAY;
    final QuickFixAction[] quickFixes = view.getProvider().getQuickFixes(toolWrapper, view.getTree());
    if (quickFixes == null || quickFixes.length == 0) {
        return AnAction.EMPTY_ARRAY;
    }
    return quickFixes;
}
Also used : InspectionResultsView(com.intellij.codeInspection.ui.InspectionResultsView) InspectionToolWrapper(com.intellij.codeInspection.ex.InspectionToolWrapper) QuickFixAction(com.intellij.codeInspection.ex.QuickFixAction) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)1 QuickFixAction (com.intellij.codeInspection.ex.QuickFixAction)1 InspectionResultsView (com.intellij.codeInspection.ui.InspectionResultsView)1 NotNull (org.jetbrains.annotations.NotNull)1