ability to show "Current File" always (WEB-20644)
[idea/community.git] / platform / analysis-impl / src / com / intellij / psi / search / PredefinedSearchScopeProvider.java
1 /*
2  * Copyright 2000-2014 JetBrains s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.intellij.psi.search;
17
18 import com.intellij.openapi.actionSystem.DataContext;
19 import com.intellij.openapi.components.ServiceManager;
20 import com.intellij.openapi.project.Project;
21 import org.jetbrains.annotations.NotNull;
22 import org.jetbrains.annotations.Nullable;
23
24 import java.util.List;
25
26 public abstract class PredefinedSearchScopeProvider {
27   public static PredefinedSearchScopeProvider getInstance() {
28     return ServiceManager.getService(PredefinedSearchScopeProvider.class);
29   }
30
31   public abstract List<SearchScope> getPredefinedScopes(@NotNull final Project project,
32                                                         @Nullable final DataContext dataContext,
33                                                         boolean suggestSearchInLibs,
34                                                         boolean prevSearchFiles,
35                                                         boolean currentSelection,
36                                                         boolean usageView,
37                                                         boolean showEmptyScopes);
38
39   public final List<SearchScope> getPredefinedScopes(@NotNull final Project project,
40                                                      @Nullable final DataContext dataContext,
41                                                      boolean suggestSearchInLibs,
42                                                      boolean prevSearchFiles,
43                                                      boolean currentSelection,
44                                                      boolean usageView) {
45     return getPredefinedScopes(project,
46                                dataContext,
47                                suggestSearchInLibs,
48                                prevSearchFiles,
49                                currentSelection,
50                                usageView,
51                                false);
52   }
53 }