Search in sources :

Example 11 with AbstractProjectViewPSIPane

use of com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane in project intellij-community by JetBrains.

the class FormMergerTreeStructureProviderTest method testStandardProviders.

public void testStandardProviders() {
    final AbstractProjectViewPSIPane pane = myStructure.createPane();
    getProjectTreeStructure().setProviders(new ClassesTreeStructureProvider(myProject), new FormMergerTreeStructureProvider(myProject));
    assertStructureEqual(getPackageDirectory(), "PsiDirectory: package1\n" + " PsiClass:Class1\n" + " PsiJavaFile:Class2.java\n" + "  PsiClass:Class2\n" + "  PsiClass:Class3\n" + " PsiJavaFile:Class4.java\n" + " PsiFile(plain text):Form2.form\n" + " Form:Form1\n" + "  PsiClass:Form1\n" + "  PsiFile(plain text):Form1.form\n");
    PsiClass psiClass = ((PsiJavaFile) getPackageDirectory().findFile("Form1.java")).getClasses()[0];
    myStructure.checkNavigateFromSourceBehaviour(psiClass, psiClass.getContainingFile().getVirtualFile(), pane);
}
Also used : AbstractProjectViewPSIPane(com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane) ClassesTreeStructureProvider(com.intellij.ide.projectView.impl.ClassesTreeStructureProvider) PsiClass(com.intellij.psi.PsiClass)

Example 12 with AbstractProjectViewPSIPane

use of com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane in project intellij-community by JetBrains.

the class PropertiesProjectViewTest method testSortByType.

public void testSortByType() {
    myFixture.copyDirectoryToProject(getTestName(true), getTestName(true));
    AbstractProjectViewPSIPane pane = setupPane(true);
    String structure = "-Project\n" + " -PsiDirectory: src\n" + "  -PsiDirectory: sortByType\n" + "   a.properties\n" + "   xxx2.properties\n" + "   yyy.properties\n" + "   -Resource Bundle 'xxx'\n" + "    xxx.properties\n" + "    xxx_en.properties\n" + "   X.txt\n" + " External Libraries\n";
    PlatformTestUtil.assertTreeEqual(pane.getTree(), structure);
    pane = setupPane(false);
    structure = "-Project\n" + " -PsiDirectory: src\n" + "  -PsiDirectory: sortByType\n" + "   a.properties\n" + "   X.txt\n" + "   -Resource Bundle 'xxx'\n" + "    xxx.properties\n" + "    xxx_en.properties\n" + "   xxx2.properties\n" + "   yyy.properties\n" + " External Libraries\n";
    PlatformTestUtil.assertTreeEqual(pane.getTree(), structure);
}
Also used : AbstractProjectViewPSIPane(com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane)

Example 13 with AbstractProjectViewPSIPane

use of com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane in project intellij-community by JetBrains.

the class PropertiesProjectViewTest method setupPane.

private AbstractProjectViewPSIPane setupPane(final boolean sortByType) {
    myStructure.setProviders(new ResourceBundleGrouper(getProject()));
    final AbstractProjectViewPSIPane pane = myStructure.createPane();
    pane.getTreeBuilder().setNodeDescriptorComparator(new GroupByTypeComparator(sortByType));
    // there should be xxx.properties in all test data
    PsiFile psiFile = getPsiManager().findFile(myFixture.findFileInTempDir(getTestName(true) + "/xxx.properties"));
    assert psiFile != null;
    pane.select(psiFile, psiFile.getVirtualFile(), sortByType);
    return pane;
}
Also used : AbstractProjectViewPSIPane(com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane) ResourceBundleGrouper(com.intellij.lang.properties.projectView.ResourceBundleGrouper) GroupByTypeComparator(com.intellij.ide.projectView.impl.GroupByTypeComparator) PsiFile(com.intellij.psi.PsiFile)

Example 14 with AbstractProjectViewPSIPane

use of com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane in project intellij-community by JetBrains.

the class PropertiesProjectViewTest method testBundle.

public void testBundle() {
    myFixture.copyDirectoryToProject(getTestName(true), getTestName(true));
    final AbstractProjectViewPSIPane pane = setupPane(true);
    String structure = "-Project\n" + " -PsiDirectory: src\n" + "  -PsiDirectory: bundle\n" + "   yyy.properties\n" + "   -Resource Bundle 'xxx'\n" + "    xxx.properties\n" + "    xxx_en.properties\n" + "    xxx_ru_RU.properties\n" + "   X.txt\n" + " External Libraries\n";
    PlatformTestUtil.assertTreeEqual(pane.getTree(), structure);
}
Also used : AbstractProjectViewPSIPane(com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane)

Example 15 with AbstractProjectViewPSIPane

use of com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane in project intellij-community by JetBrains.

the class PropertiesProjectViewTest method testStandAlone.

public void testStandAlone() {
    myFixture.copyDirectoryToProject(getTestName(true), getTestName(true));
    final AbstractProjectViewPSIPane pane = setupPane(true);
    String structure = "-Project\n" + " -PsiDirectory: src\n" + "  -PsiDirectory: standAlone\n" + "   a.properties\n" + "   xxx.properties\n" + "   xxx2.properties\n" + "   yyy.properties\n" + "   X.txt\n" + " External Libraries\n";
    PlatformTestUtil.assertTreeEqual(pane.getTree(), structure);
}
Also used : AbstractProjectViewPSIPane(com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane)

Aggregations

AbstractProjectViewPSIPane (com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane)15 ClassesTreeStructureProvider (com.intellij.ide.projectView.impl.ClassesTreeStructureProvider)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 PsiClass (com.intellij.psi.PsiClass)2 PsiFile (com.intellij.psi.PsiFile)2 FormMergerTreeStructureProvider (com.intellij.uiDesigner.projectView.FormMergerTreeStructureProvider)2 GroupByTypeComparator (com.intellij.ide.projectView.impl.GroupByTypeComparator)1 StructureViewComponent (com.intellij.ide.structureView.newStructureView.StructureViewComponent)1 ResourceBundleGrouper (com.intellij.lang.properties.projectView.ResourceBundleGrouper)1 Document (com.intellij.openapi.editor.Document)1 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 FileEditorManager (com.intellij.openapi.fileEditor.FileEditorManager)1 PsiDirectory (com.intellij.psi.PsiDirectory)1 PsiField (com.intellij.psi.PsiField)1 RenameProcessor (com.intellij.refactoring.rename.RenameProcessor)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1