1 package com
.intellij
.ide
.impl
;
3 import com
.intellij
.ide
.SelectInContext
;
4 import com
.intellij
.ide
.SelectInManager
;
5 import com
.intellij
.ide
.StandardTargetWeights
;
6 import com
.intellij
.ide
.projectView
.impl
.ProjectViewPane
;
7 import com
.intellij
.openapi
.project
.DumbAware
;
8 import com
.intellij
.openapi
.project
.Project
;
9 import com
.intellij
.openapi
.roots
.ProjectFileIndex
;
10 import com
.intellij
.openapi
.roots
.ProjectRootManager
;
11 import com
.intellij
.openapi
.vfs
.VirtualFile
;
12 import com
.intellij
.psi
.PsiFileSystemItem
;
14 public class ProjectPaneSelectInTarget
extends ProjectViewSelectInTarget
implements DumbAware
{
15 public ProjectPaneSelectInTarget(Project project
) {
19 public String
toString() {
20 return SelectInManager
.PROJECT
;
23 public boolean canSelect(PsiFileSystemItem file
) {
24 if (!super.canSelect(file
)) return false;
25 final VirtualFile vFile
= file
.getVirtualFile();
26 return canSelect(vFile
);
29 public boolean isSubIdSelectable(String subId
, SelectInContext context
) {
30 return canSelect(context
);
33 private boolean canSelect(final VirtualFile vFile
) {
34 if (vFile
!= null && vFile
.isValid()) {
35 ProjectFileIndex projectFileIndex
= ProjectRootManager
.getInstance(myProject
).getFileIndex();
36 if (projectFileIndex
.getModuleForFile(vFile
) != null) {
40 if (projectFileIndex
.isInLibraryClasses(vFile
) || projectFileIndex
.isInLibrarySource(vFile
)) {
44 return vFile
.getParent() == myProject
.getBaseDir();
50 public String
getMinorViewId() {
51 return ProjectViewPane
.ID
;
54 public float getWeight() {
55 return StandardTargetWeights
.PROJECT_WEIGHT
;
58 protected boolean canWorkWithCustomObjects() {