本文整理汇总了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 {
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
}
示例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;
}
}