本文整理汇总了Java中com.intellij.ide.structureView.StructureViewTreeElement类的典型用法代码示例。如果您正苦于以下问题:Java StructureViewTreeElement类的具体用法?Java StructureViewTreeElement怎么用?Java StructureViewTreeElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StructureViewTreeElement类属于com.intellij.ide.structureView包,在下文中一共展示了StructureViewTreeElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRoot
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@Override
@NotNull
public StructureViewTreeElement getRoot() {
XmlFile myFile = getPsiFile();
final DomFileElement<DomElement> fileElement = DomManager.getDomManager(myFile.getProject()).getFileElement(
myFile,
DomElement.class
);
return fileElement == null ?
new XmlFileTreeElement(myFile) :
new TSStructureTreeElement(
fileElement.getRootElement().createStableCopy(),
myDescriptor,
myNavigationProvider
);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:17,代码来源:TSStructureViewTreeModel.java
示例2: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
List<StructureViewTreeElement> result = new ArrayList<>();
final List<WeaveArrayElement> arrayElementList = getElement().getArrayElementList();
for (WeaveArrayElement weaveArrayElement : arrayElementList) {
final WeaveSimpleArrayElement simpleArrayElement = weaveArrayElement.getSimpleArrayElement();
if (simpleArrayElement != null) {
final WeaveExpression expression = simpleArrayElement.getExpression();
final StructureViewTreeElement structureViewTreeElement = WeaveStructureElementFactory.create(expression);
if (structureViewTreeElement != null) {
result.add(structureViewTreeElement);
}
}
}
return result;
}
示例3: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
List<StructureViewTreeElement> result = new ArrayList<>();
final WeaveObjectExpression weaveObjectExpression = getElement();
final WeaveMultipleKeyValuePairObj keyValuePairObj = weaveObjectExpression.getMultipleKeyValuePairObj();
if (keyValuePairObj != null) {
final List<WeaveKeyValuePair> valuePairList = keyValuePairObj.getKeyValuePairList();
for (WeaveKeyValuePair weaveKeyValuePair : valuePairList) {
addKeyValuePair(result, weaveKeyValuePair);
}
}
final WeaveSingleKeyValuePairObj singleKeyValuePairObj = weaveObjectExpression.getSingleKeyValuePairObj();
if (singleKeyValuePairObj != null) {
final WeaveKeyValuePair keyValuePair = singleKeyValuePairObj.getKeyValuePair();
addKeyValuePair(result, keyValuePair);
}
return result;
}
示例4: create
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@Nullable
public static StructureViewTreeElement create(PsiElement element) {
if (element instanceof WeaveObjectExpression) {
return new WeaveObjectView((WeaveObjectExpression) element);
} else if (element instanceof WeaveArrayExpression) {
return new WeaveArrayView((WeaveArrayExpression) element);
} else if (element instanceof WeaveBinaryExpression) {
return create(((WeaveBinaryExpression) element).getRight());
} else if (element instanceof WeaveBinaryClojureExpression) {
return create(((WeaveBinaryClojureExpression) element).getRight());
} else if (element instanceof WeaveUsingExpression) {
return create(((WeaveUsingExpression) element).getExpression());
} else if (element instanceof WeaveUnaryExpression) {
return create(((WeaveUnaryExpression) element).getExpression());
} else {
return null;
}
}
示例5: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
List<StructureViewTreeElement> elements = new ArrayList<StructureViewTreeElement>();
PsiElement element = getElement();
if (element instanceof YamlFile) {
addArrayElements(elements, element);
} else if (element instanceof YamlMapping || element instanceof YamlSequence) {
addArrayElements(elements, element);
} else if (element instanceof YamlTuple) {
addArrayElements(elements, (((YamlTuple) element).getValue()));
}
return elements;
}
示例6: getClassChildren
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
private Collection<StructureViewTreeElement> getClassChildren() {
final PsiClass aClass = getElement();
if (aClass == null) return Collections.emptyList();
LinkedHashSet<PsiElement> members = getOwnChildren(aClass);
List<StructureViewTreeElement> children = new ArrayList<StructureViewTreeElement>(members.size());
//aClass.processDeclarations(new AddAllMembersProcessor(inherited, aClass), ResolveState.initial(), null, aClass);
for (PsiElement child : members) {
if (!child.isValid()) continue;
if (child instanceof PsiClass && !myParents.contains((PsiClass)child)) {
children.add(new JavaClassTreeElement((PsiClass)child, false, myParents));
}
else if (child instanceof PsiField) {
children.add(new PsiFieldTreeElement((PsiField)child, false));
}
else if (child instanceof PsiMethod) {
children.add(new PsiMethodTreeElement((PsiMethod)child, false));
}
else if (child instanceof PsiClassInitializer) {
children.add(new ClassInitializerTreeElement((PsiClassInitializer)child));
}
}
return children;
}
示例7: getChildren
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public final StructureViewTreeElement[] getChildren() {
final T element = getElement();
if (element == null) return EMPTY_ARRAY;
List<StructureViewTreeElement> result = new ArrayList<StructureViewTreeElement>();
Collection<StructureViewTreeElement> baseChildren = getChildrenBase();
result.addAll(baseChildren);
StructureViewFactoryEx structureViewFactory = StructureViewFactoryEx.getInstanceEx(element.getProject());
Class<? extends PsiElement> aClass = element.getClass();
for (StructureViewExtension extension : structureViewFactory.getAllExtensions(aClass)) {
StructureViewTreeElement[] children = extension.getChildren(element);
if (children != null) {
ContainerUtil.addAll(result, children);
}
}
return result.toArray(new StructureViewTreeElement[result.size()]);
}
示例8: buildStructure
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
private synchronized void buildStructure(final String pattern) {
if (!Registry.is("search.everywhere.structure") || myStructureModel == null) return;
final List<StructureViewTreeElement> elements = new ArrayList<StructureViewTreeElement>();
final MinusculeMatcher matcher = new MinusculeMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE);
fillStructure(myStructureModel.getRoot(), elements, matcher);
if (elements.size() > 0) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (isCanceled()) return;
myListModel.titleIndex.structure = myListModel.size();
for (Object element : elements) {
myListModel.addElement(element);
}
myListModel.moreIndex.files = -1;
}
});
}
}
示例9: findElement
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@Nullable
private static StructureViewTreeElement findElement(StructureViewTreeElement node, PsiElement element, int hopes) {
final Object value = node.getValue();
if (value instanceof PsiElement) {
if (((PsiElement)value).isEquivalentTo(element)) return node;
if (hopes != 0) {
for (TreeElement child : node.getChildren()) {
if (child instanceof StructureViewTreeElement) {
final StructureViewTreeElement e = findElement((StructureViewTreeElement)child, element, hopes - 1);
if (e != null) {
return e;
}
}
}
}
}
return null;
}
示例10: getChildren
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@Override
public StructureViewTreeElement[] getChildren(PsiElement parent) {
Collection<StructureViewTreeElement> result = new ArrayList<StructureViewTreeElement>();
final PsiClass psiClass = (PsiClass) parent;
for (PsiField psiField : psiClass.getFields()) {
if (psiField instanceof SqliteMagicLightFieldBuilder) {
result.add(new PsiFieldTreeElement(psiField, false));
}
}
for (PsiMethod psiMethod : psiClass.getMethods()) {
if (psiMethod instanceof SqliteMagicLightMethodBuilder) {
result.add(new PsiMethodTreeElement(psiMethod, false));
}
}
if (!result.isEmpty()) {
return result.toArray(new StructureViewTreeElement[result.size()]);
} else {
return StructureViewTreeElement.EMPTY_ARRAY;
}
}
示例11: getStructureViewTreeElements
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
protected static Collection<StructureViewTreeElement> getStructureViewTreeElements(XmlTag[] subTags) {
final XmlStructureViewElementProvider[] providers =
(XmlStructureViewElementProvider[])Extensions.getExtensions(XmlStructureViewElementProvider.EXTENSION_POINT_NAME);
return ContainerUtil.map2List(subTags, new Function<XmlTag, StructureViewTreeElement>() {
@Override
public StructureViewTreeElement fun(final XmlTag xmlTag) {
for (final XmlStructureViewElementProvider provider : providers) {
final StructureViewTreeElement element = provider.createCustomXmlTagTreeElement(xmlTag);
if (element != null) {
return element;
}
}
return new XmlTagTreeElement(xmlTag);
}
});
}
示例12: getChildren
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@Override
public StructureViewTreeElement[] getChildren(PsiElement parent) {
if (parent instanceof AppleScriptPsiElement) {
new AppleScriptStructureViewElement((AppleScriptPsiElement) parent).getChildren();
}
return new StructureViewTreeElement[0];
}
示例13: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
return Arrays.stream(getElement().getChildren())
.filter(e -> e instanceof ImpexHeaderLine)
.map(e -> new ImpexHeaderTreeElement((ImpexHeaderLine) e))
.collect(Collectors.toList());
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:ImpexRootTreeElement.java
示例14: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
return getElement().getFullHeaderParameterList()
.stream()
.map(e -> new ImpexHeaderParameterElement(e))
.collect(Collectors.toList());
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:ImpexHeaderTreeElement.java
示例15: getChildrenBase
import com.intellij.ide.structureView.StructureViewTreeElement; //导入依赖的package包/类
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
final List<StructureViewTreeElement> result = new ArrayList<>();
final WeaveExpression expression = getElement().getExpression();
final StructureViewTreeElement treeElement = WeaveStructureElementFactory.create(expression);
if (treeElement != null) {
result.add(treeElement);
}else{
//
}
return result;
}