Commit 066f2277 authored by Sergey Ignatov's avatar Sergey Ignatov
Browse files

IDEA-127307 "Goto Action": option to suppress disabled entries

parent 45b9379c
Showing with 6 additions and 10 deletions
+6 -10
......@@ -183,7 +183,7 @@ public class GotoActionAction extends GotoActionBase implements DumbAware {
@NotNull
@Override
protected Set<Object> filter(@NotNull Set<Object> elements) {
return super.filter(model.filterAndSortItems(elements));
return super.filter(model.filterAndSortItems(elements, myCheckBox.isSelected()));
}
@Override
......
......@@ -35,7 +35,6 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.MinusculeMatcher;
......@@ -130,7 +129,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator<Object>, D
@Nullable
@Override
public String getCheckBoxName() {
return null;
return IdeBundle.message("checkbox.disabled.included");
}
@Override
......@@ -150,7 +149,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator<Object>, D
@Override
public boolean loadInitialCheckBoxState() {
return true;
return false;
}
@Override
......@@ -407,14 +406,14 @@ public class GotoActionModel implements ChooseByNameModel, Comparator<Object>, D
}
@NotNull
public SortedSet<Object> filterAndSortItems(@NotNull Set<Object> elements) {
public SortedSet<Object> filterAndSortItems(@NotNull Set<Object> elements, boolean inclideDisabled) {
List<ActionWrapper> toUpdate = getActionsToUpdate(elements);
if (!toUpdate.isEmpty()) {
updateActions(toUpdate);
}
TreeSet<Object> objects = ContainerUtilRt.newTreeSet(this);
if (Registry.is("goto.action.skip.disabled")) {
if (!inclideDisabled) {
for (Object o : elements) {
if (o instanceof MatchedValue) {
Comparable v = ((MatchedValue)o).value;
......
......@@ -724,7 +724,7 @@ label.no.matches.found=no matches found
prompt.gotofile.enter.file.name=Enter file name:
prompt.gotoaction.enter.action=Enter action or option name:
checkbox.include.non.project.files=Include &non-&&project files
checkbox.other.included=Include &non-&&menu actions
checkbox.disabled.included=Include &disabled actions
label.no.non.java.files.found=No matches found in project
label.no.menu.actions.found=No actions in main menu found
label.no.files.found=No files found
......
......@@ -1169,8 +1169,5 @@ ESLint.Language.Service.full.log.description=ESLint: include source code fragmen
goto.action.skip.tophits.and.options=false
goto.action.skip.tophits.and.options.description=Skip top hits and options in go to action
goto.action.skip.disabled=true
goto.action.skip.disabled.description=Show only enabled actions in Go to Action
dsm.show.cycle.count.in.tooltip=false
dsm.show.cycle.count.in.tooltip.description=Shows number of cycles found in the tooltip of the Toggle Cycles toolbar button after some calculation time
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment