mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
reduce '*' using by user
This commit is contained in:
@@ -66,6 +66,7 @@ public class RunInspectionAction extends GotoActionBase {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.goto.inspection");
|
||||
|
||||
final ChooseByNamePopup popup = ChooseByNamePopup.createPopup(project, new GotoInspectionModel(project), getPsiContext(e));
|
||||
popup.setSearchInAnyPlace(true);
|
||||
popup.invoke(new ChooseByNamePopupComponent.Callback() {
|
||||
public void onClose() {
|
||||
if (RunInspectionAction.class.equals(myInAction)) {
|
||||
|
||||
@@ -81,6 +81,7 @@ public abstract class ChooseByNameBase {
|
||||
protected final String myInitialText;
|
||||
private boolean myPreselectInitialText;
|
||||
private final Reference<PsiElement> myContext;
|
||||
private boolean mySearchInAnyPlace = false;
|
||||
|
||||
protected Component myPreviouslyFocusedComponent;
|
||||
|
||||
@@ -166,6 +167,14 @@ public abstract class ChooseByNameBase {
|
||||
myShowListAfterCompletionKeyStroke = showListAfterCompletionKeyStroke;
|
||||
}
|
||||
|
||||
public boolean isSearchInAnyPlace() {
|
||||
return mySearchInAnyPlace;
|
||||
}
|
||||
|
||||
public void setSearchInAnyPlace(boolean searchInAnyPlace) {
|
||||
mySearchInAnyPlace = searchInAnyPlace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tool area. The method may be called only before invoke.
|
||||
*
|
||||
@@ -1196,6 +1205,10 @@ public abstract class ChooseByNameBase {
|
||||
String namePattern = getNamePattern(pattern);
|
||||
String qualifierPattern = getQualifierPattern(pattern);
|
||||
|
||||
if (isSearchInAnyPlace() && namePattern.trim().length() > 0) {
|
||||
namePattern = "*" + namePattern + "*";
|
||||
}
|
||||
|
||||
boolean empty = namePattern.length() == 0 || namePattern.equals("@"); // TODO[yole]: remove implicit dependency
|
||||
if (empty && !canShowListForEmptyPattern()) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user