本文整理汇总了Java中com.intellij.ide.projectView.impl.AbstractUrl.createPath方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractUrl.createPath方法的具体用法?Java AbstractUrl.createPath怎么用?Java AbstractUrl.createPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.impl.AbstractUrl
的用法示例。
在下文中一共展示了AbstractUrl.createPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processUrls
import com.intellij.ide.projectView.impl.AbstractUrl; //导入方法依赖的package包/类
private static void processUrls(Project project,
Collection<TreeItem<Pair<AbstractUrl, String>>> urls,
Collection<AbstractTreeNode> result, final AbstractTreeNode me) {
for (TreeItem<Pair<AbstractUrl, String>> pair : urls) {
AbstractUrl abstractUrl = pair.getData().getFirst();
final Object[] path = abstractUrl.createPath(project);
if (path == null || path.length < 1 || path[0] == null) {
continue;
}
try {
final String className = pair.getData().getSecond();
@SuppressWarnings("unchecked")
final Class<? extends AbstractTreeNode> nodeClass = (Class<? extends AbstractTreeNode>)Class.forName(className);
final AbstractTreeNode node = ProjectViewNode
.createTreeNode(nodeClass, project, path[path.length - 1], FavoritesManager.getInstance(project).getViewSettings());
node.setParent(me);
node.setIndex(result.size());
result.add(node);
if (node instanceof ProjectViewNodeWithChildrenList) {
final List<TreeItem<Pair<AbstractUrl, String>>> children = pair.getChildren();
if (children != null && !children.isEmpty()) {
Collection<AbstractTreeNode> childList = new ArrayList<AbstractTreeNode>();
processUrls(project, children, childList, node);
for (AbstractTreeNode treeNode : childList) {
((ProjectViewNodeWithChildrenList)node).addChild(treeNode);
}
}
}
}
catch (Exception ignored) {
}
}
}