use of com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper in project intellij-community by JetBrains.
the class FavoritesTreeViewPanel method setupToolWindow.
public void setupToolWindow(ToolWindowEx window) {
final CollapseAllAction collapseAction = new CollapseAllAction(myTree);
collapseAction.getTemplatePresentation().setIcon(AllIcons.General.CollapseAll);
collapseAction.getTemplatePresentation().setHoveredIcon(AllIcons.General.CollapseAllHover);
window.setTitleActions(collapseAction);
final DefaultActionGroup group = new DefaultActionGroup();
final ProjectViewDirectoryHelper helper = ProjectViewDirectoryHelper.getInstance(myProject);
if (helper.supportsFlattenPackages()) {
group.add(new FavoritesFlattenPackagesAction(myProject, myBuilder));
}
if (helper.supportsHideEmptyMiddlePackages()) {
group.add(new FavoritesCompactEmptyMiddlePackagesAction(myProject, myBuilder));
}
if (helper.supportsFlattenPackages()) {
group.addAction(new FavoritesAbbreviatePackageNamesAction(myProject, myBuilder));
}
if (!PlatformUtils.isCidr()) {
group.add(new FavoritesShowMembersAction(myProject, myBuilder));
}
final FavoritesAutoscrollFromSourceHandler handler = new FavoritesAutoscrollFromSourceHandler(myProject, myBuilder);
handler.install();
group.add(handler.createToggleAction());
group.add(new FavoritesAutoScrollToSourceAction(myProject, myAutoScrollToSourceHandler, myBuilder));
window.setAdditionalGearActions(group);
}
use of com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper in project android by JetBrains.
the class AndroidSourceTypeNode method getChildren.
@NotNull
@Override
public Collection<? extends AbstractTreeNode> getChildren() {
List<AbstractTreeNode> children = Lists.newArrayList();
ProjectViewDirectoryHelper projectViewDirectoryHelper = ProjectViewDirectoryHelper.getInstance(myProject);
AndroidProjectTreeBuilder treeBuilder = (AndroidProjectTreeBuilder) myProjectViewPane.getTreeBuilder();
for (PsiDirectory directory : getSourceDirectories()) {
Collection<AbstractTreeNode> directoryChildren = projectViewDirectoryHelper.getDirectoryChildren(directory, getSettings(), true);
children.addAll(annotateWithSourceProvider(directoryChildren));
// Inform the tree builder of the node that this particular virtual file maps to
treeBuilder.createMapping(directory.getVirtualFile(), this);
}
return children;
}
use of com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper in project android by JetBrains.
the class NonAndroidSourceTypeNode method getChildren.
@NotNull
@Override
public Collection<? extends AbstractTreeNode> getChildren() {
List<VirtualFile> sourceFolders = getSourceFolders();
List<AbstractTreeNode> children = Lists.newArrayListWithExpectedSize(sourceFolders.size());
PsiManager psiManager = PsiManager.getInstance(myProject);
ProjectViewDirectoryHelper directoryHelper = ProjectViewDirectoryHelper.getInstance(myProject);
for (VirtualFile file : sourceFolders) {
PsiDirectory dir = psiManager.findDirectory(file);
if (dir != null) {
children.addAll(directoryHelper.getDirectoryChildren(dir, getSettings(), true));
}
}
return children;
}
Aggregations