本文整理汇总了Java中com.intellij.ide.util.treeView.AbstractTreeNode类的典型用法代码示例。如果您正苦于以下问题:Java AbstractTreeNode类的具体用法?Java AbstractTreeNode怎么用?Java AbstractTreeNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractTreeNode类属于com.intellij.ide.util.treeView包,在下文中一共展示了AbstractTreeNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: modifyExternalLibrariesNodes
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@NotNull
protected Collection<AbstractTreeNode> modifyExternalLibrariesNodes(
@NotNull final Collection<AbstractTreeNode> children
) {
Validate.notNull(children);
final Collection<AbstractTreeNode> treeNodes = new ArrayList<AbstractTreeNode>();
for (AbstractTreeNode child : children) {
if (child instanceof PsiDirectoryNode) {
final VirtualFile virtualFile = ((PsiDirectoryNode) child).getVirtualFile();
if (null == virtualFile) {
continue;
}
if (!HybrisConstants.CLASSES_DIRECTORY.equalsIgnoreCase(virtualFile.getName())) {
treeNodes.add(child);
}
} else {
treeNodes.add(child);
}
}
return treeNodes;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:HybrisProjectView.java
示例2: contains
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Override
public boolean contains(@NotNull final VirtualFile file) {
for (AbstractTreeNode abstractTreeNode : this.getValue()) {
if (abstractTreeNode instanceof ProjectViewNode) {
final ProjectViewNode projectViewNode = (ProjectViewNode) abstractTreeNode;
if (null == projectViewNode.getVirtualFile()) {
continue;
}
if (projectViewNode.getVirtualFile().equals(file)) {
return true;
}
if (file.getPath().startsWith(projectViewNode.getVirtualFile().getPath())) {
return true;
}
}
}
return false;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:JunkProjectViewNode.java
示例3: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Nullable
@Override
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
Object value = childNode.getValue();
if (value instanceof PsiDirectory && !((PsiDirectory)value).getName().equals(EduNames.SRC)) {
return createChildDirectoryNode(null, (PsiDirectory)value);
}
if (value instanceof PsiElement) {
PsiFile psiFile = ((PsiElement) value).getContainingFile();
if (psiFile == null) return null;
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null) {
return null;
}
return StudyUtils.getTaskFile(myProject, virtualFile) != null ? childNode : null;
}
return null;
}
示例4: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Nullable
@Override
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
Object value = childNode.getValue();
if (value instanceof PsiDirectory) {
return createChildDirectoryNode(null, (PsiDirectory)value);
}
if (value instanceof PsiElement) {
PsiFile psiFile = ((PsiElement) value).getContainingFile();
if (psiFile == null) return null;
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null) {
return null;
}
return StudyUtils.getTaskFile(myProject, virtualFile) != null ? childNode : null;
}
return null;
}
示例5: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Nullable
@Override
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
Object value = childNode.getValue();
if (value instanceof PsiDirectory) {
PsiDirectory directory = (PsiDirectory)value;
Task task = myLesson.getTask(directory.getName());
if (task == null) {
return null;
}
VirtualFile srcDir = directory.getVirtualFile().findChild(EduNames.SRC);
if (srcDir != null) {
directory = PsiManager.getInstance(myProject).findDirectory(srcDir);
if (directory == null) {
return null;
}
}
return createChildDirectoryNode(task, directory);
}
return null;
}
示例6: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Nullable
@Override
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
final AbstractTreeNode node = super.modifyChildNode(childNode);
if (node != null) return node;
Object value = childNode.getValue();
if (value instanceof PsiElement) {
PsiFile psiFile = ((PsiElement) value).getContainingFile();
VirtualFile virtualFile = psiFile.getVirtualFile();
Course course = StudyTaskManager.getInstance(myProject).getCourse();
if (course == null) {
return null;
}
EduPluginConfigurator configurator = EduPluginConfigurator.INSTANCE.forLanguage(course.getLanguageById());
if (configurator == null) {
return new CCStudentInvisibleFileNode(myProject, psiFile, myViewSettings);
}
if (!CCUtils.isTestsFile(myProject, virtualFile)) {
return new CCStudentInvisibleFileNode(myProject, psiFile, myViewSettings);
}
}
return null;
}
示例7: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Nullable
@Override
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
AbstractTreeNode node = super.modifyChildNode(childNode);
if (node != null) {
return node;
}
if (childNode instanceof PsiFileNode) {
VirtualFile virtualFile = ((PsiFileNode)childNode).getVirtualFile();
if (virtualFile == null) {
return null;
}
if (FileUtilRt.getExtension(virtualFile.getName()).equals("iml")) {
return null;
}
return new CCStudentInvisibleFileNode(myProject, ((PsiFileNode)childNode).getValue(), myViewSettings);
}
return null;
}
示例8: modify
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@NotNull
@Override
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
ArrayList<AbstractTreeNode> nodes = new ArrayList<AbstractTreeNode>();
if (isLanguageFolder(parent)) {
if (children.size() > 0 && parent.getValue() instanceof PsiDirectory) {
Collection<PsiFileNode> childrenPsi2 = new ArrayList<>();
for (AbstractTreeNode eachChild : children) {
if (!(eachChild.getValue() instanceof PsiFile)) continue;
PsiFile psiFile = (PsiFile) eachChild.getValue();
LanguageNodeFile nodeFile = new LanguageNodeFile(parent.getProject(), psiFile, settings);
childrenPsi2.add(nodeFile);
}
LanguageNestingNode languageFormNode = new LanguageNestingNode(childrenPsi2.iterator().next(), childrenPsi2);
nodes.add(languageFormNode);
}
} else {
nodes.addAll(children);
}
return nodes;
}
示例9: getSummaryForRootNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Override
public String getSummaryForRootNode(AbstractTreeNode childNode) {
final Object value = childNode.getValue();
String coverageInformationString = myAnnotator.getPackageCoverageInformationString((PsiPackage)value, null,
myCoverageDataManager);
if (coverageInformationString == null) {
if (!myCoverageViewManager.isReady()) return "Loading...";
PackageAnnotator.SummaryCoverageInfo info = new PackageAnnotator.PackageCoverageInfo();
final Collection children = childNode.getChildren();
for (Object child : children) {
final Object childValue = ((CoverageListNode)child).getValue();
PackageAnnotator.SummaryCoverageInfo childInfo = getSummaryCoverageForNodeValue(childValue);
info = JavaCoverageAnnotator.merge(info, childInfo);
}
coverageInformationString = JavaCoverageAnnotator.getCoverageInformationString(info, false);
}
return getNotCoveredMessage(coverageInformationString) + " in 'all classes in scope'";
}
示例10: getChildren
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Override
@NotNull
public Collection<AbstractTreeNode> getChildren() {
ArrayList<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>();
if (myToDoSettings.getIsPackagesShown()) {
TodoTreeHelper.getInstance(getProject()).addPackagesToChildren(children, getValue(), myBuilder);
}
else {
for (Iterator i = myBuilder.getAllFiles(); i.hasNext();) {
final PsiFile psiFile = (PsiFile)i.next();
if (psiFile == null) { // skip invalid PSI files
continue;
}
final VirtualFile virtualFile = psiFile.getVirtualFile();
final boolean isInContent = ModuleRootManager.getInstance(getValue()).getFileIndex().isInContent(virtualFile);
if (!isInContent) continue;
TodoFileNode fileNode = new TodoFileNode(getProject(), psiFile, myBuilder, false);
if (getTreeStructure().accept(psiFile) && !children.contains(fileNode)) {
children.add(fileNode);
}
}
}
return children;
}
示例11: goDownToNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
private AbstractTreeNode goDownToNode(AbstractTreeNode lastPathNode, final Object lastPathElement, VirtualFile file) {
if (file == null) return lastPathNode;
AbstractTreeNode found = lastPathNode;
while (found != null) {
if (nodeIsAcceptableForElement(lastPathNode, lastPathElement)) {
break;
}
else {
found = findInChildren(lastPathNode, file, lastPathElement);
if (found != null) {
lastPathNode = found;
}
}
}
return lastPathNode;
}
示例12: getChildren
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Override
@NotNull
public Collection<AbstractTreeNode> getChildren() {
final ArrayList<VirtualFile> roots = new ArrayList<VirtualFile>();
Module myModule = getValue().getModule();
if (myModule == null) {
final Module[] modules = ModuleManager.getInstance(getProject()).getModules();
for (Module module : modules) {
addModuleLibraryRoots(ModuleRootManager.getInstance(module), roots);
}
}
else {
addModuleLibraryRoots(ModuleRootManager.getInstance(myModule), roots);
}
return PackageUtil.createPackageViewChildrenOnFiles(roots, getProject(), getSettings(), null, true);
}
示例13: writePanel
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
private static void writePanel(final CommanderPanel panel, final Element element) {
/*TODO[anton,vova]: it's a patch!!!*/
final AbstractListBuilder builder = panel.getBuilder();
if (builder == null) return;
final AbstractTreeNode parentNode = builder.getParentNode();
final Object parentElement = parentNode != null? parentNode.getValue() : null;
if (parentElement instanceof PsiDirectory) {
final PsiDirectory directory = (PsiDirectory) parentElement;
element.setAttribute(ATTRIBUTE_URL, directory.getVirtualFile().getUrl());
}
else if (parentElement instanceof PsiClass) {
for (PsiElement e = (PsiElement) parentElement; e != null && e.isValid(); e = e.getParent()) {
if (e instanceof PsiClass) {
final String qualifiedName = ((PsiClass) e).getQualifiedName();
if (qualifiedName != null) {
element.setAttribute(ATTRIBUTE_CLASS, qualifiedName);
break;
}
}
}
}
}
示例14: getChildren
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
@Override
@NotNull
public Collection<AbstractTreeNode> getChildren() {
Module module = getValue();
final Module[] deps = ModuleRootManager.getInstance(module).getDependencies(true);
final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>();
for (Module dependency : deps) {
children.add(new ProjectViewModuleNode(myProject, dependency, getSettings()) {
@Override
protected boolean showModuleNameInBold() {
return false;
}
});
}
return children;
}
示例15: drillDown
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入依赖的package包/类
public final void drillDown() {
final Object value = getSelectedValue();
if (value instanceof AbstractTreeNode) {
try {
final AbstractTreeNode node = (AbstractTreeNode)value;
buildList(node);
ensureSelectionExist();
}
finally {
updateParentTitle();
}
}
else { // an element that denotes parent
goUp();
}
}