Java 类com.intellij.psi.IntentionFilterOwner 实例源码

项目:intellij-ce-playground    文件:ShowIntentionsPass.java   
private void getIntentionActionsToShow() {
  getActionsToShow(myEditor, myFile, myIntentionsInfo, myPassIdToShowIntentionsFor);
  if (myFile instanceof IntentionFilterOwner) {
    final IntentionFilterOwner.IntentionActionsFilter actionsFilter = ((IntentionFilterOwner)myFile).getIntentionActionsFilter();
    if (actionsFilter == null) return;
    if (actionsFilter != IntentionFilterOwner.IntentionActionsFilter.EVERYTHING_AVAILABLE) {
      myIntentionsInfo.filterActions(actionsFilter);
    }
  }

  if (myIntentionsInfo.isEmpty()) {
    return;
  }
  myShowBulb = !myIntentionsInfo.guttersToShow.isEmpty() ||
    ContainerUtil.exists(ContainerUtil.concat(myIntentionsInfo.errorFixesToShow, myIntentionsInfo.inspectionFixesToShow,myIntentionsInfo.intentionsToShow), new Condition<HighlightInfo.IntentionActionDescriptor>() {
      @Override
      public boolean value(HighlightInfo.IntentionActionDescriptor descriptor) {
        return IntentionManagerSettings.getInstance().isShowLightBulb(descriptor.getAction());
      }
    });
}
项目:tools-idea    文件:ShowIntentionsPass.java   
private void getIntentionActionsToShow() {
  if (LookupManager.getInstance(myProject).getActiveLookup() != null) return;

  getActionsToShow(myEditor, myFile, myIntentionsInfo, myPassIdToShowIntentionsFor);
  if (myFile instanceof IntentionFilterOwner) {
    final IntentionFilterOwner.IntentionActionsFilter actionsFilter = ((IntentionFilterOwner)myFile).getIntentionActionsFilter();
    if (actionsFilter == null) return;
    if (actionsFilter != IntentionFilterOwner.IntentionActionsFilter.EVERYTHING_AVAILABLE) {
      myIntentionsInfo.filterActions(actionsFilter);
    }
  }

  if (myIntentionsInfo.isEmpty()) {
    return;
  }
  myShowBulb = !myIntentionsInfo.guttersToShow.isEmpty();
  if (!myShowBulb) {
    for (HighlightInfo.IntentionActionDescriptor descriptor : ContainerUtil.concat(myIntentionsInfo.errorFixesToShow, myIntentionsInfo.inspectionFixesToShow,myIntentionsInfo.intentionsToShow)) {
      final IntentionAction action = descriptor.getAction();
      if (IntentionManagerSettings.getInstance().isShowLightBulb(action)) {
        myShowBulb = true;
        break;
      }
    }
  }
}
项目:intellij-ce-playground    文件:ShowIntentionsPass.java   
private static void filter(@NotNull List<HighlightInfo.IntentionActionDescriptor> descriptors,
                           @NotNull IntentionFilterOwner.IntentionActionsFilter actionsFilter) {
  for (Iterator<HighlightInfo.IntentionActionDescriptor> it = descriptors.iterator(); it.hasNext();) {
      HighlightInfo.IntentionActionDescriptor actionDescriptor = it.next();
      if (!actionsFilter.isAvailable(actionDescriptor.getAction())) it.remove();
    }
}
项目:tools-idea    文件:ShowIntentionsPass.java   
private static void filter(@NotNull List<HighlightInfo.IntentionActionDescriptor> descriptors,
                           @NotNull IntentionFilterOwner.IntentionActionsFilter actionsFilter) {
  for (Iterator<HighlightInfo.IntentionActionDescriptor> it = descriptors.iterator(); it.hasNext();) {
      HighlightInfo.IntentionActionDescriptor actionDescriptor = it.next();
      if (!actionsFilter.isAvailable(actionDescriptor.getAction())) it.remove();
    }
}
项目:intellij-ce-playground    文件:ShowIntentionsPass.java   
private void filterActions(@NotNull IntentionFilterOwner.IntentionActionsFilter actionsFilter) {
  filter(intentionsToShow, actionsFilter);
  filter(errorFixesToShow, actionsFilter);
  filter(inspectionFixesToShow, actionsFilter);
  filter(guttersToShow, actionsFilter);
}
项目:tools-idea    文件:ShowIntentionsPass.java   
public void filterActions(@NotNull IntentionFilterOwner.IntentionActionsFilter actionsFilter) {
  filter(intentionsToShow, actionsFilter);
  filter(errorFixesToShow, actionsFilter);
  filter(inspectionFixesToShow, actionsFilter);
  filter(guttersToShow, actionsFilter);
}