本文整理汇总了Java中com.intellij.ide.util.treeView.AbstractTreeNode.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractTreeNode.getValue方法的具体用法?Java AbstractTreeNode.getValue怎么用?Java AbstractTreeNode.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.util.treeView.AbstractTreeNode
的用法示例。
在下文中一共展示了AbstractTreeNode.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例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 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: processValuesFlownTo
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
private static boolean processValuesFlownTo(@NotNull final PsiExpression argument,
@NotNull PsiElement scope,
@NotNull PsiManager manager,
@NotNull final Processor<PsiExpression> processor) {
SliceAnalysisParams params = new SliceAnalysisParams();
params.dataFlowToThis = true;
params.scope = new AnalysisScope(new LocalSearchScope(scope), manager.getProject());
SliceRootNode rootNode = new SliceRootNode(manager.getProject(), new DuplicateMap(), LanguageSlicing.getProvider(argument).createRootUsage(argument, params));
Collection<? extends AbstractTreeNode> children = rootNode.getChildren().iterator().next().getChildren();
for (AbstractTreeNode child : children) {
SliceUsage usage = (SliceUsage)child.getValue();
PsiElement element = usage.getElement();
if (element instanceof PsiExpression && !processor.process((PsiExpression)element)) return false;
}
return !children.isEmpty();
}
示例7: processValuesFlownTo
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
private static boolean processValuesFlownTo(@NotNull final PsiExpression argument,
@NotNull PsiElement scope,
@NotNull PsiManager manager,
@NotNull final Processor<PsiExpression> processor) {
SliceAnalysisParams params = new SliceAnalysisParams();
params.dataFlowToThis = true;
params.scope = new AnalysisScope(new LocalSearchScope(scope), manager.getProject());
SliceRootNode rootNode = new SliceRootNode(manager.getProject(), new DuplicateMap(),
LanguageSlicing.getProvider(argument).createRootUsage(argument, params));
@SuppressWarnings("unchecked")
Collection<? extends AbstractTreeNode> children = rootNode.getChildren().iterator().next().getChildren();
for (AbstractTreeNode child : children) {
SliceUsage usage = (SliceUsage)child.getValue();
if (usage == null) {
continue;
}
PsiElement element = usage.getElement();
if (element instanceof PsiExpression && !processor.process((PsiExpression)element)) return false;
}
return !children.isEmpty();
}
示例8: findSmartFirstLevelNodeByElement
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
@Nullable
DefaultMutableTreeNode findSmartFirstLevelNodeByElement(final Object element) {
for (Object child : getRoot().getChildren()) {
AbstractTreeNode favorite = (AbstractTreeNode)child;
Object currentValue = favorite.getValue();
if (currentValue instanceof SmartPsiElementPointer) {
currentValue = ((SmartPsiElementPointer)favorite.getValue()).getElement();
}
/*else if (currentValue instanceof PsiJavaFile) {
final PsiClass[] classes = ((PsiJavaFile)currentValue).getClasses();
if (classes.length > 0) {
currentValue = classes[0];
}
}*/
if (Comparing.equal(element, currentValue)) {
final DefaultMutableTreeNode nodeWithObject =
findFirstLevelNodeWithObject((DefaultMutableTreeNode)getTree().getModel().getRoot(), favorite);
if (nodeWithObject != null) {
return nodeWithObject;
}
}
}
return null;
}
示例9: modifyChildNode
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
@Nullable
public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) {
Object value = childNode.getValue();
if (value instanceof PsiDirectory) {
PsiDirectory directory = (PsiDirectory)value;
Lesson lesson = myCourse.getLesson(directory.getName());
return lesson != null ? createChildDirectoryNode(lesson, directory) : null;
}
return null;
}
示例10: 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;
}
Object value = childNode.getValue();
if (value instanceof PsiElement) {
PsiElement psiElement = (PsiElement) value;
PsiFile psiFile = psiElement.getContainingFile();
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null) {
return null;
}
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);
}
if (!(myTask instanceof TaskWithSubtasks)) {
return new CCStudentInvisibleFileNode(myProject, psiFile, myViewSettings, getTestNodeName(configurator, psiElement));
}
String testFileName = getTestNodeName(configurator, psiElement);
return isActiveSubtaskTest(virtualFile) ? new CCStudentInvisibleFileNode(myProject, psiFile, myViewSettings, testFileName) : null;
}
return null;
}
示例11: modify
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
@Override
public Collection<AbstractTreeNode> modify(AbstractTreeNode parent, Collection<AbstractTreeNode> children, ViewSettings settings) {
ArrayList<AbstractTreeNode> result = new ArrayList<AbstractTreeNode>();
for (final AbstractTreeNode child : children) {
Object o = child.getValue();
if (o instanceof LuaPsiFile) {
result.add(new LuaFileTreeNode(myProject, (LuaPsiFile) o, settings));
continue;
}
result.add(child);
}
return result;
}
示例12: isParentGrouped
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
private static boolean isParentGrouped(AbstractTreeNode parent) {
while (parent != null) {
if (parent.getValue() instanceof SuperTypeGroup) return true;
parent = parent.getParent();
}
return false;
}
示例13: findPsiFileIn
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
private PsiFile findPsiFileIn(Collection<AbstractTreeNode> objects) {
for (Iterator<AbstractTreeNode> iterator = objects.iterator(); iterator.hasNext();) {
AbstractTreeNode treeNode = iterator.next();
if (treeNode.getValue() instanceof PsiFile) return (PsiFile)treeNode.getValue();
}
return null;
}
示例14: getPsiElement
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
@Nullable
private static PsiElement getPsiElement(@SuppressWarnings("rawtypes") AbstractTreeNode node) {
Object value = node.getValue();
if (value instanceof PsiElement) {
return (PsiElement) value;
}
if (value instanceof SmartPsiElementPointer) {
return ((SmartPsiElementPointer) value).getElement();
}
return null;
}
示例15: getValueAtIndex
import com.intellij.ide.util.treeView.AbstractTreeNode; //导入方法依赖的package包/类
private static Object getValueAtIndex(AbstractTreeNode node) {
if (node == null) return null;
Object value = node.getValue();
if (value instanceof StructureViewTreeElement) {
return ((StructureViewTreeElement)value).getValue();
}
return value;
}