当前位置: 首页>>代码示例>>Java>>正文


Java DependencyNode类代码示例

本文整理汇总了Java中org.apache.maven.shared.dependency.tree.DependencyNode的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode类的具体用法?Java DependencyNode怎么用?Java DependencyNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DependencyNode类属于org.apache.maven.shared.dependency.tree包,在下文中一共展示了DependencyNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: populateFields

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private void populateFields() {
    Iterator<? extends DependencyNode> iter = result.allInstances().iterator();
    if (iter.hasNext()) {
        final DependencyNode root = iter.next();
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                NodeVisitor vis = new NodeVisitor(Arrays.asList(new String[]{ Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST}));
                root.accept(vis);
                vis.getListOfDependencies();
                explorerManager.setRootContext(new AbstractNode(createListChildren(vis.getListOfDependencies(), getLookup())));
                treeExplorerManager.setRootContext(new AbstractNode(createTreeChildren(root, getLookup())));
                ((BeanTreeView)tvTree).expandAll();

            }
        });
    } else {

    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:DependencyPanel.java

示例2: calculateStateTipPart

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@NbBundle.Messages({
    "TIP_Included=Is included",
    "TIP_Conflict=Is omitted for conflict, version used is {0}",
    "TIP_Duplicate=Is omitted for duplicate with the same version",
    "TIP_Cycle=Is omitted for cycle"
})
private static String calculateStateTipPart(DependencyNode node) {
        int s = node.getState();
        if (s == DependencyNode.INCLUDED) {
            return Bundle.TIP_Included();
        } else if (s == DependencyNode.OMITTED_FOR_CONFLICT) {
            return Bundle.TIP_Conflict(node.getRelatedArtifact().getVersion());
        } else if (s == DependencyNode.OMITTED_FOR_DUPLICATE) {
            return Bundle.TIP_Duplicate();
        } else if (s == DependencyNode.OMITTED_FOR_CYCLE) {
            return Bundle.TIP_Cycle();
        }
        throw new IllegalStateException("illegal state:" + s);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:DependencyPanel.java

示例3: createTreeChildren

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private static Children createTreeChildren(final DependencyNode dn, final Lookup tcLookup) {
    if (!dn.hasChildren()) {
        return Children.LEAF;
    }
    return Children.create(new ChildFactory<DependencyNode>() {

        @Override
        protected Node createNodeForKey(DependencyNode key) {
            return new TreeNode(key, tcLookup);
        }

        @Override
        protected boolean createKeys(List<DependencyNode> toPopulate) {
            toPopulate.addAll(dn.getChildren());
            return true;
        }
    }, false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DependencyPanel.java

示例4: showDependencyExcludeDialog

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@Messages("TIT_Exclude=Add Dependency Excludes")
public static Map<Artifact, List<Artifact>> showDependencyExcludeDialog(Project prj) {
    NbMavenProject nbproj = prj.getLookup().lookup(NbMavenProject.class);
    final ExcludeDependencyPanel pnl = new ExcludeDependencyPanel(nbproj.getMavenProject());
    DialogDescriptor dd = new DialogDescriptor(pnl, TIT_Exclude());
    pnl.setStatusDisplayer(dd.createNotificationLineSupport());
    Object ret = DialogDisplayer.getDefault().notify(dd);
    if (ret == DialogDescriptor.OK_OPTION) {
        Map<Artifact, List<DependencyNode>> dependencyExcludes = pnl.getDependencyExcludes();
        Map<Artifact, List<Artifact>> toRet = new HashMap<Artifact, List<Artifact>>();
        for (Artifact exclude : dependencyExcludes.keySet()) {
            List<DependencyNode> directs = dependencyExcludes.get(exclude);
            List<Artifact> dirArts = new ArrayList<Artifact>();
            for (DependencyNode nd : directs) {
                dirArts.add(nd.getArtifact());
            }
            if (dirArts.size() > 0) {
                toRet.put(exclude, dirArts);
            }
        }
        return toRet;
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:DialogFactory.java

示例5: createReferenceModel

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private TreeNode createReferenceModel(Set<DependencyNode> nds, CheckNode trans) {
    DefaultMutableTreeNode root = new DefaultMutableTreeNode(null, true);
    ChangeListener list = new Listener();
    List<CheckNode> s = new ArrayList<CheckNode>();
    Icon icn = ImageUtilities.image2Icon(ImageUtilities.loadImage(IconResources.DEPENDENCY_ICON, true)); //NOI18N
    change2Trans.put(list, trans);
    change2Refs.put(list, s);
    for (DependencyNode nd : nds) {
        String label = nd.getArtifact().getGroupId() + ":" + nd.getArtifact().getArtifactId();
        CheckNode child = new CheckNode(nd, label, icn);
        child.setSelected(isSingle);
        child.addChangeListener(list);
        s.add(child);
        root.add(child);
    }
    return root;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ExcludeDependencyPanel.java

示例6: setReferenceTree

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private void setReferenceTree(CheckNode mtb) {
    Artifact art = (Artifact) mtb.getUserObject();
    if (modelCache.containsKey(art)) {
        trRef.setModel(modelCache.get(art));
    } else {
        if (rootnode == null) {
            trRef.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
        } else {
            DependencyExcludeNodeVisitor nv = new DependencyExcludeNodeVisitor(art.getGroupId(), art.getArtifactId(), art.getType());
            rootnode.accept(nv);
            Set<DependencyNode> nds = nv.getDirectDependencies();
            DefaultTreeModel dtm = new DefaultTreeModel(createReferenceModel(nds, mtb));
            trRef.setModel(dtm);
            modelCache.put(art, dtm);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ExcludeDependencyPanel.java

示例7: visit

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@Override
public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
        directs = new HashSet<DependencyNode>();
        path = new Stack<DependencyNode>();
        allPaths = new HashSet<Stack<DependencyNode>>();
        return true;
    }
    path.push(node);
    Artifact artifact = node.getArtifact();
    if (key.equals(artifact.getDependencyConflictId())) {
        if (!path.isEmpty()) {
            directs.add(path.firstElement());
            Stack<DependencyNode> copy = new Stack<DependencyNode>();
            copy.addAll(path);
            allPaths.add(copy);
        }
        return false;
    }
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DependencyExcludeNodeVisitor.java

示例8: createDependencyTree

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private static DependencyNode createDependencyTree(MavenProject project,
        DependencyTreeBuilder dependencyTreeBuilder, ArtifactRepository localRepository,
        ArtifactFactory artifactFactory, ArtifactMetadataSource artifactMetadataSource,
        ArtifactCollector artifactCollector,
        String scope) {
    ArtifactFilter artifactFilter = createResolvingArtifactFilter(scope);

    try {
        // TODO: note that filter does not get applied due to MNG-3236
        return dependencyTreeBuilder.buildDependencyTree(project,
                localRepository, artifactFactory,
                artifactMetadataSource, artifactFilter, artifactCollector);
    } catch (DependencyTreeBuilderException exception) {
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DependencyTreeFactory.java

示例9: getDependencyArtifacts

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
protected Set<Artifact> getDependencyArtifacts( Set<?> classPathArtifacts, Artifact rootArtifact )
    throws DependencyTreeBuilderException
{
    Set<Artifact> result = null;

    buildDependencyTree();
    DependencyNode artifactNode = findArtifactNode( rootArtifact, rootNode );
    if ( artifactNode != null )
    {
        result = new HashSet<Artifact>();
        addDependencyArtifacts( result, classPathArtifacts, artifactNode );
    }
    else
    {
        result = Collections.emptySet();
    }

    return result;
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:20,代码来源:AbstractDependencyProcessingPlayMojo.java

示例10: addDependencyArtifacts

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private void addDependencyArtifacts( Set<Artifact> collection, Set<?> classPathArtifacts, DependencyNode artifactNode )
{
    if ( artifactNode.getState() == DependencyNode.INCLUDED )
    {
        Artifact artifact = artifactNode.getArtifact();
        // don't use this artifact, because it can be unresolved
        // find corresponding artifact in "classPathArtifacts" set
        // (only if exists, if does not exist - we don't need it)
        for ( Iterator<?> iter = classPathArtifacts.iterator(); iter.hasNext(); )
        {
            Artifact a = (Artifact) iter.next();
            if ( areArtifactsEqual( artifact, a ) )
            {
                collection.add( a );
                break;
            }
        }
        List<?> childDependencyNodes = artifactNode.getChildren();
        for ( Iterator<?> iter = childDependencyNodes.iterator(); iter.hasNext(); )
        {
            DependencyNode childNode = (DependencyNode) iter.next();
            addDependencyArtifacts( collection, classPathArtifacts, childNode );
        }
    }
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:26,代码来源:AbstractDependencyProcessingPlayMojo.java

示例11: findArtifactNode

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private DependencyNode findArtifactNode( Artifact artifact, DependencyNode findRootNode )
{
    DependencyNode result = null;
    if ( findRootNode.getState() == DependencyNode.INCLUDED )
    {
        if ( findRootNode.getArtifact().equals( artifact ) )
        {
            result = findRootNode;
        }
        else
        {
            List<?> childDependencyNodes = findRootNode.getChildren();
            for ( Iterator<?> iter = childDependencyNodes.iterator(); iter.hasNext(); )
            {
                DependencyNode childNode = (DependencyNode) iter.next();
                DependencyNode tmp = findArtifactNode( artifact, childNode );
                if ( tmp != null )
                {
                    result = tmp;
                    break;
                }
            }
        }
    }
    return result;
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:27,代码来源:AbstractDependencyProcessingPlayMojo.java

示例12: visit

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@Override
public boolean visit(DependencyNode node) {
    // add this node
    hierarchy.push(node);

    // don't print test deps, but still add to hierarchy as they will
    // be removed in endVisit below
    if (isTest(node)) {
        return false;
    }

    // build the padding
    final StringBuilder pad = new StringBuilder();
    for (int i = 0; i < hierarchy.size() - 1; i++) {
        pad.append("   ");
    }
    pad.append("+- ");

    // log it
    output.append(pad).append(node.toNodeString()).append("\n");

    return true;
}
 
开发者ID:apache,项目名称:nifi-maven,代码行数:24,代码来源:NarProvidedDependenciesMojo.java

示例13: visit

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@Override public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
    }
    if (node.getState() == DependencyNode.INCLUDED) {
        ArtifactGraphNode grNode = scene.getGraphNodeRepresentant(node);
        if (grNode == null) {
            return false;
        }
        ArtifactWidget aw = (ArtifactWidget) scene.findWidget(grNode);
        aw.hightlightScopes(scopes);
        path.push(node);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:18,代码来源:ScopesVisitor.java

示例14: addPathToRoot

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
private void addPathToRoot(DependencyNode depN, DependencyNode parentDepN, List<ArtifactGraphEdge> edges, List<ArtifactGraphNode> nodes) {
    ArtifactGraphNode grNode;
    while (parentDepN != null) {
        grNode = getGraphNodeRepresentant(parentDepN);
        if (grNode == null) {
            return;
        }
        ArtifactGraphNode targetNode = getGraphNodeRepresentant(depN);
        if (targetNode == null) {
            return;
        }
        edges.addAll(findEdgesBetween(grNode, targetNode));
        nodes.add(grNode);
        depN = parentDepN;
        parentDepN = grNode.getArtifactParent();
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:18,代码来源:DependencyGraphScene.java

示例15: visit

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入依赖的package包/类
@Override public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
    }
    if (node.getState() == DependencyNode.INCLUDED) {
        ArtifactGraphNode grNode = scene.getGraphNodeRepresentant(node);
        if (grNode == null) {
            return false;
        }
        ArtifactWidget aw = (ArtifactWidget) scene.findWidget(grNode);
        aw.highlightText(searchTerm);
        path.push(node);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:18,代码来源:SearchVisitor.java


注:本文中的org.apache.maven.shared.dependency.tree.DependencyNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。