本文整理汇总了Java中com.intellij.ide.projectView.ViewSettings.isHideEmptyMiddlePackages方法的典型用法代码示例。如果您正苦于以下问题:Java ViewSettings.isHideEmptyMiddlePackages方法的具体用法?Java ViewSettings.isHideEmptyMiddlePackages怎么用?Java ViewSettings.isHideEmptyMiddlePackages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.ViewSettings
的用法示例。
在下文中一共展示了ViewSettings.isHideEmptyMiddlePackages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPackageAsChild
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
public static void addPackageAsChild(@NotNull Collection<AbstractTreeNode> children,
@NotNull PsiPackage aPackage,
@Nullable Module module,
@NotNull ViewSettings settings,
final boolean inLibrary) {
final boolean shouldSkipPackage = settings.isHideEmptyMiddlePackages() && isPackageEmpty(aPackage, module, !settings.isFlattenPackages(), inLibrary);
final Project project = aPackage.getProject();
if (!shouldSkipPackage) {
children.add(new PackageElementNode(project, new PackageElement(module, aPackage, inLibrary), settings));
}
if (settings.isFlattenPackages() || shouldSkipPackage) {
final PsiPackage[] subpackages = getSubpackages(aPackage, module, inLibrary);
for (PsiPackage subpackage : subpackages) {
addPackageAsChild(children, subpackage, module, settings, inLibrary);
}
}
}
示例2: addAllSubpackages
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
public void addAllSubpackages(List<AbstractTreeNode> container,
PsiDirectory dir,
@Nullable ModuleFileIndex moduleFileIndex,
ViewSettings viewSettings) {
final Project project = dir.getProject();
PsiDirectory[] subdirs = dir.getSubdirectories();
for (PsiDirectory subdir : subdirs) {
if (skipDirectory(subdir)) {
continue;
}
if (moduleFileIndex != null && !moduleFileIndex.isInContent(subdir.getVirtualFile())) {
container.add(new PsiDirectoryNode(project, subdir, viewSettings));
continue;
}
if (viewSettings.isHideEmptyMiddlePackages()) {
if (!isEmptyMiddleDirectory(subdir, false)) {
container.add(new PsiDirectoryNode(project, subdir, viewSettings));
}
}
else {
container.add(new PsiDirectoryNode(project, subdir, viewSettings));
}
addAllSubpackages(container, subdir, moduleFileIndex, viewSettings);
}
}
示例3: processPsiDirectoryChildren
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
public void processPsiDirectoryChildren(final PsiDirectory psiDir,
PsiElement[] children,
List<AbstractTreeNode> container,
ProjectFileIndex projectFileIndex,
@Nullable ModuleFileIndex moduleFileIndex,
ViewSettings viewSettings,
boolean withSubDirectories) {
for (PsiElement child : children) {
LOG.assertTrue(child.isValid());
if (!(child instanceof PsiFileSystemItem)) {
LOG.error("Either PsiFile or PsiDirectory expected as a child of " + child.getParent() + ", but was " + child);
continue;
}
final VirtualFile vFile = ((PsiFileSystemItem) child).getVirtualFile();
if (vFile == null) {
continue;
}
if (moduleFileIndex != null && !moduleFileIndex.isInContent(vFile)) {
continue;
}
if (child instanceof PsiFile) {
container.add(new PsiFileNode(child.getProject(), (PsiFile) child, viewSettings));
}
else if (child instanceof PsiDirectory) {
if (withSubDirectories) {
PsiDirectory dir = (PsiDirectory)child;
if (!vFile.equals(projectFileIndex.getSourceRootForFile(vFile))) { // if is not a source root
if (viewSettings.isHideEmptyMiddlePackages() && !skipDirectory(psiDir) && isEmptyMiddleDirectory(dir, true)) {
processPsiDirectoryChildren(dir, directoryChildrenInProject(dir, viewSettings),
container, projectFileIndex, moduleFileIndex, viewSettings, withSubDirectories); // expand it recursively
continue;
}
}
container.add(new PsiDirectoryNode(child.getProject(), (PsiDirectory) child, viewSettings));
}
}
}
}
示例4: wrapViewSettings
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
private ViewSettings wrapViewSettings(final ViewSettings original) {
return new ProjectViewSettings() {
@Override
public boolean isShowMembers() {
return original.isShowMembers();
}
@Override
public boolean isStructureView() {
return original.isStructureView();
}
@Override
public boolean isShowModules() {
return original.isShowModules();
}
@Override
public boolean isFlattenPackages() {
return false;
}
@Override
public boolean isAbbreviatePackageNames() {
return false;
}
@Override
public boolean isHideEmptyMiddlePackages() {
return original.isHideEmptyMiddlePackages();
}
@Override
public boolean isShowLibraryContents() {
return original.isShowLibraryContents();
}
@Override
public boolean isShowExcludedFiles() {
if (original instanceof ProjectViewSettings) {
return ((ProjectViewSettings) original).isShowExcludedFiles();
}
return true;
}
};
}