2 * Copyright 2000-2009 JetBrains s.r.o.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package com
.intellij
.ide
.util
;
18 import com
.intellij
.openapi
.fileTypes
.FileType
;
19 import com
.intellij
.openapi
.project
.Project
;
20 import com
.intellij
.openapi
.util
.Condition
;
21 import com
.intellij
.psi
.PsiClass
;
22 import com
.intellij
.psi
.PsiFile
;
23 import com
.intellij
.psi
.search
.GlobalSearchScope
;
24 import org
.jetbrains
.annotations
.NotNull
;
25 import org
.jetbrains
.annotations
.Nullable
;
31 public class TreeClassChooserFactoryImpl
extends TreeClassChooserFactory
{
32 private final Project myProject
;
34 public TreeClassChooserFactoryImpl(final Project project
) {
39 public TreeClassChooser
createWithInnerClassesScopeChooser(String title
,
40 GlobalSearchScope scope
,
41 final TreeClassChooser
.ClassFilter classFilter
,
42 PsiClass initialClass
) {
43 return TreeClassChooserDialog
.withInnerClasses(title
, myProject
, scope
, classFilter
, initialClass
);
47 public TreeClassChooser
createNoInnerClassesScopeChooser(String title
,
48 GlobalSearchScope scope
,
49 TreeClassChooser
.ClassFilter classFilter
,
50 PsiClass initialClass
) {
51 return new TreeClassChooserDialog(title
, myProject
, scope
, classFilter
, initialClass
);
55 public TreeClassChooser
createProjectScopeChooser(String title
, PsiClass initialClass
) {
56 return new TreeClassChooserDialog(title
, myProject
, initialClass
);
60 public TreeClassChooser
createProjectScopeChooser(String title
) {
61 return new TreeClassChooserDialog(title
, myProject
);
65 public TreeClassChooser
createAllProjectScopeChooser(String title
) {
66 return new TreeClassChooserDialog(title
, myProject
, GlobalSearchScope
.allScope(myProject
), null, null);
70 public TreeClassChooser
createInheritanceClassChooser(String title
,
71 GlobalSearchScope scope
,
75 Condition
<?
super PsiClass
> additionalCondition
) {
76 TreeClassChooser
.ClassFilter classFilter
= new TreeClassChooserDialog
.InheritanceClassFilterImpl(base
, acceptsSelf
, acceptInner
, additionalCondition
);
77 return new TreeClassChooserDialog(title
, myProject
, scope
, classFilter
, base
, null, null);
81 public TreeClassChooser
createInheritanceClassChooser(String title
, GlobalSearchScope scope
, PsiClass base
, PsiClass initialClass
) {
82 return createInheritanceClassChooser(title
, scope
, base
, initialClass
, null);
86 public TreeClassChooser
createInheritanceClassChooser(String title
, GlobalSearchScope scope
, PsiClass base
, PsiClass initialClass
,
87 TreeClassChooser
.ClassFilter classFilter
) {
88 return new TreeClassChooserDialog(title
, myProject
, scope
, classFilter
, base
, initialClass
, null);
92 public TreeFileChooser
createFileChooser(@NotNull String title
,
93 final PsiFile initialFile
,
95 TreeFileChooser
.PsiFileFilter filter
) {
96 return new TreeFileChooserDialog(myProject
, title
, initialFile
, fileType
, filter
, false, false);
101 TreeFileChooser
createFileChooser(@NotNull String title
,
102 @Nullable PsiFile initialFile
,
103 @Nullable FileType fileType
,
104 @Nullable TreeFileChooser
.PsiFileFilter filter
,
105 boolean disableStructureProviders
) {
106 return new TreeFileChooserDialog(myProject
, title
, initialFile
, fileType
, filter
, disableStructureProviders
, false);
111 public TreeFileChooser
createFileChooser(@NotNull String title
, @Nullable PsiFile initialFile
, @Nullable FileType fileType
,
112 @Nullable TreeFileChooser
.PsiFileFilter filter
,
113 boolean disableStructureProviders
,
114 boolean showLibraryContents
) {
115 return new TreeFileChooserDialog(myProject
, title
, initialFile
, fileType
, filter
, disableStructureProviders
, showLibraryContents
);