本文整理匯總了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) {
}
}
}