IDEA-199698 visual glitches in new SE

This commit is contained in:
Mikhail Sokolov
2018-10-04 16:51:42 +03:00
parent 799b769b2f
commit db56d6e449
5 changed files with 14 additions and 6 deletions
@@ -102,8 +102,8 @@ public abstract class AbstractGotoSEContributor<F> implements SearchEverywhereCo
}, progressIndicator);
}
//todo param is unnecessary #UX-1
protected abstract FilteringGotoByModel<F> createModel(Project project);
@NotNull
protected abstract FilteringGotoByModel<F> createModel(@NotNull Project project);
@NotNull
@Override
@@ -56,8 +56,9 @@ public class ClassSearchEverywhereContributor extends AbstractGotoSEContributor<
return 100;
}
@NotNull
@Override
protected FilteringGotoByModel<Language> createModel(Project project) {
protected FilteringGotoByModel<Language> createModel(@NotNull Project project) {
return new GotoClassModel2(project);
}
@@ -29,6 +29,7 @@ import java.util.stream.Stream;
/**
* @author Konstantin Bulenkov
* @author Mikhail Sokolov
*/
public class FileSearchEverywhereContributor extends AbstractGotoSEContributor<FileType> {
private final GotoFileModel myModelForRenderer;
@@ -54,8 +55,9 @@ public class FileSearchEverywhereContributor extends AbstractGotoSEContributor<F
return 200;
}
@NotNull
@Override
protected FilteringGotoByModel<FileType> createModel(Project project) {
protected FilteringGotoByModel<FileType> createModel(@NotNull Project project) {
return new GotoFileModel(project);
}
@@ -80,7 +82,7 @@ public class FileSearchEverywhereContributor extends AbstractGotoSEContributor<F
public boolean processSelectedItem(@NotNull Object selected, int modifiers, @NotNull String searchText) {
if (selected instanceof PsiFile) {
VirtualFile file = ((PsiFile)selected).getVirtualFile();
if (file != null) {
if (file != null && myProject != null) {
Pair<Integer, Integer> pos = getLineAndColumn(searchText);
OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, file, pos.first, pos.second);
descriptor.setUseCurrentWindow(openInCurrentWindow(modifiers));
@@ -60,6 +60,10 @@ public class RecentFilesSEContributor extends FileSearchEverywhereContributor {
@Override
public void fetchElements(@NotNull String pattern, boolean everywhere, @Nullable SearchEverywhereContributorFilter<FileType> filter,
@NotNull ProgressIndicator progressIndicator, @NotNull Function<Object, Boolean> consumer) {
if (myProject == null) {
return; //nothing to search
}
String searchString = filterControlSymbols(pattern);
MinusculeMatcher matcher = NameUtil.buildMatcher("*" + searchString).build();
List<VirtualFile> opened = Arrays.asList(FileEditorManager.getInstance(myProject).getSelectedFiles());
@@ -54,8 +54,9 @@ public class SymbolSearchEverywhereContributor extends AbstractGotoSEContributor
return false;
}
@NotNull
@Override
protected FilteringGotoByModel<Language> createModel(Project project) {
protected FilteringGotoByModel<Language> createModel(@NotNull Project project) {
return new GotoSymbolModel2(project);
}