コード例 #1
0
 private static UsageFilteringRule[] getActiveFilteringRules(final Project project) {
   final UsageFilteringRuleProvider[] providers =
       Extensions.getExtensions(UsageFilteringRuleProvider.EP_NAME);
   List<UsageFilteringRule> list = new ArrayList<UsageFilteringRule>(providers.length);
   for (UsageFilteringRuleProvider provider : providers) {
     ContainerUtil.addAll(list, provider.getActiveRules(project));
   }
   return list.toArray(new UsageFilteringRule[list.size()]);
 }
コード例 #2
0
  public void addFilteringActions(DefaultActionGroup group) {
    final JComponent component = getComponent();
    final MergeDupLines mergeDupLines = new MergeDupLines();
    mergeDupLines.registerCustomShortcutSet(mergeDupLines.getShortcutSet(), component, this);
    group.add(mergeDupLines);

    final UsageFilteringRuleProvider[] providers =
        Extensions.getExtensions(UsageFilteringRuleProvider.EP_NAME);
    for (UsageFilteringRuleProvider provider : providers) {
      AnAction[] actions = provider.createFilteringActions(this);
      for (AnAction action : actions) {
        group.add(action);
      }
    }
  }