Search in sources :

Example 1 with ResourceBundleGrouper

use of com.intellij.lang.properties.projectView.ResourceBundleGrouper in project intellij-community by JetBrains.

the class PackagesTreeStructureTest method doTest.

private void doTest(final boolean showModules, final boolean showLibraryContents, boolean flattenPackages, boolean abbreviatePackageNames, @NonNls final String expected, final int levels) throws InterruptedException {
    final ProjectViewImpl projectView = (ProjectViewImpl) ProjectView.getInstance(myProject);
    projectView.setShowModules(showModules, PackageViewPane.ID);
    projectView.setShowLibraryContents(showLibraryContents, PackageViewPane.ID);
    projectView.setFlattenPackages(flattenPackages, PackageViewPane.ID);
    projectView.setAbbreviatePackageNames(abbreviatePackageNames, PackageViewPane.ID);
    projectView.setHideEmptyPackages(true, PackageViewPane.ID);
    PackageViewPane packageViewPane = new PackageViewPane(myProject);
    packageViewPane.createComponent();
    ((AbstractProjectTreeStructure) packageViewPane.getTreeStructure()).setProviders(new ResourceBundleGrouper(myProject));
    packageViewPane.updateFromRoot(true);
    JTree tree = packageViewPane.getTree();
    TreeUtil.expand(tree, levels);
    PlatformTestUtil.assertTreeEqual(tree, expected);
    BaseProjectViewTestCase.checkContainsMethod(packageViewPane.getTreeStructure().getRootElement(), packageViewPane.getTreeStructure());
    Disposer.dispose(packageViewPane);
}
Also used : AbstractProjectTreeStructure(com.intellij.ide.projectView.impl.AbstractProjectTreeStructure) ResourceBundleGrouper(com.intellij.lang.properties.projectView.ResourceBundleGrouper) PackageViewPane(com.intellij.ide.projectView.impl.PackageViewPane) ProjectViewImpl(com.intellij.ide.projectView.impl.ProjectViewImpl)

Example 2 with ResourceBundleGrouper

use of com.intellij.lang.properties.projectView.ResourceBundleGrouper 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)

Aggregations

ResourceBundleGrouper (com.intellij.lang.properties.projectView.ResourceBundleGrouper)2 AbstractProjectTreeStructure (com.intellij.ide.projectView.impl.AbstractProjectTreeStructure)1 AbstractProjectViewPSIPane (com.intellij.ide.projectView.impl.AbstractProjectViewPSIPane)1 GroupByTypeComparator (com.intellij.ide.projectView.impl.GroupByTypeComparator)1 PackageViewPane (com.intellij.ide.projectView.impl.PackageViewPane)1 ProjectViewImpl (com.intellij.ide.projectView.impl.ProjectViewImpl)1 PsiFile (com.intellij.psi.PsiFile)1