/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.CollectConsumer;
import com.intellij.util.Function;
import com.intellij.util.Processor;
import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.THashSet;
-import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author peter
*/
+@SuppressWarnings("TestOnlyProblems")
public class GotoActionItemProvider implements ChooseByNameItemProvider {
- private static final TObjectHashingStrategy<AnAction> ACTION_OBJECT_HASHING_STRATEGY = new TObjectHashingStrategy<AnAction>() {
- @Override
- public int computeHashCode(AnAction object) {
- return object.getClass().hashCode();
- }
-
- @Override
- public boolean equals(AnAction o1, AnAction o2) {
- return Comparing.equal(o1.getClass(), o2.getClass());
- }
- };
private final ActionManager myActionManager = ActionManager.getInstance();
protected final SearchableOptionsRegistrar myIndex = SearchableOptionsRegistrar.getInstance();
private final GotoActionModel myModel;
}
private boolean processActions(String pattern, boolean everywhere, Processor<MatchedValue> consumer, DataContext dataContext) {
- Set<AnAction> actions = new THashSet<AnAction>(ACTION_OBJECT_HASHING_STRATEGY);
+ List<AnAction> actions = ContainerUtil.newArrayList();
if (everywhere) {
for (String id : ((ActionManagerImpl)myActionManager).getActionIds()) {
ProgressManager.checkCanceled();