mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
show .class files located in source content in project view
This commit is contained in:
@@ -21,7 +21,9 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.FileIndexFacade;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.impl.PsiManagerImpl;
|
||||
import com.intellij.psi.impl.compiled.ClsFileImpl;
|
||||
import com.intellij.psi.impl.file.PsiBinaryFileImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -40,7 +42,7 @@ public class ClassFileViewProvider extends SingleRootFileViewProvider {
|
||||
protected PsiFile createFile(@NotNull final Project project, @NotNull final VirtualFile vFile, @NotNull final FileType fileType) {
|
||||
FileIndexFacade fileIndex = ServiceManager.getService(project, FileIndexFacade.class);
|
||||
if (!fileIndex.isInLibraryClasses(vFile) && fileIndex.isInSource(vFile)) {
|
||||
return null;
|
||||
return new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
|
||||
}
|
||||
|
||||
// skip inners & anonymous
|
||||
|
||||
@@ -73,6 +73,7 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase {
|
||||
" Class1.java\n" +
|
||||
" Class2.java\n" +
|
||||
" Class4.java\n" +
|
||||
" emptyClassFile.class\n" +
|
||||
" Form1.form\n" +
|
||||
" Form1.java\n" +
|
||||
" Form2.form\n" +
|
||||
@@ -120,6 +121,7 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase {
|
||||
" Class1.java\n" +
|
||||
" Class2.java\n" +
|
||||
" Class4.java\n" +
|
||||
" emptyClassFile.class\n" +
|
||||
" Form1.form\n" +
|
||||
" Form1.java\n" +
|
||||
" Form2.form\n" +
|
||||
@@ -168,6 +170,7 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase {
|
||||
" Class1.java\n" +
|
||||
" Class2.java\n" +
|
||||
" Class4.java\n" +
|
||||
" emptyClassFile.class\n" +
|
||||
" Form1.form\n" +
|
||||
" Form1.java\n" +
|
||||
" Form2.form\n" +
|
||||
@@ -182,6 +185,7 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase {
|
||||
" Class1.java\n" +
|
||||
" Class2.java\n" +
|
||||
" Class4.java\n" +
|
||||
" emptyClassFile.class\n" +
|
||||
" Form1.form\n" +
|
||||
" Form1.java\n" +
|
||||
" Form2.form\n" +
|
||||
|
||||
Reference in New Issue
Block a user