/** * Gets the artifact for the specified node. * * @param node the dependency node, possibly <code>null</code> * @return the node's artifact, or <code>null</code> if the specified node was <code>null</code> */ private static Artifact nullGetArtifact( DependencyNode node ) { return ( node != null ) ? node.getArtifact() : null; } }
private String constructKey() { Artifact artifact = node.getArtifact(); return artifact.getGroupId() + ":" + artifact.getArtifactId(); }
private String constructKey() { Artifact artifact = node.getArtifact(); return artifact.getGroupId() + ":" + artifact.getArtifactId(); }
/** * Removes the dependency node for the specified artifact from the dependency node cache. * * @param artifact the artifact to remove the dependency node for */ private void removeNode( Artifact artifact ) { DependencyNode node = nodesByArtifact.remove( artifact ); if ( !artifact.equals( node.getArtifact() ) ) { throw new IllegalStateException( "Removed dependency node artifact was expected to be " + artifact + " but was " + node.getArtifact() ); } }
/** * {@inheritDoc} */ public void startProcessChildren( Artifact artifact ) { log( "startProcessChildren: artifact=" + artifact ); if ( !currentNode.getArtifact().equals( artifact ) ) { throw new IllegalStateException( "Artifact was expected to be " + currentNode.getArtifact() + " but was " + artifact ); } parentNodes.push( currentNode ); }
/** * {@inheritDoc} */ public void startProcessChildren( Artifact artifact ) { log( "startProcessChildren: artifact=" + artifact ); if ( !currentNode.getArtifact().equals( artifact ) ) { throw new IllegalStateException( "Artifact was expected to be " + currentNode.getArtifact() + " but was " + artifact ); } parentNodes.push( currentNode ); }
public List<Artifact> getArtifacts() { List<Artifact> artifacts = new ArrayList<Artifact>(); for ( DependencyNode node : getNodes() ) { artifacts.add( node.getArtifact() ); } return artifacts; }
/** {@inheritDoc} */ public int compare( DependencyNode p1, DependencyNode p2 ) { return p1.getArtifact().getId().compareTo( p2.getArtifact().getId() ); } }
/** * {@inheritDoc} */ public boolean accept( DependencyNode node ) { Artifact artifact = node.getArtifact(); return filter.include( artifact ); }
private String constructKey( DependencyNode node ) { return constructKey( node.getArtifact() ); }
private String constructKey( DependencyNode node ) { return constructKey( node.getArtifact() ); }
private boolean containsConflicts( DependencyNode node ) { return containsConflicts( node.getArtifact() ); }
private boolean containsConflicts( DependencyNode node ) { return containsConflicts( node.getArtifact() ); }
public boolean accept(DependencyNode node) { return include(node.getArtifact()); }
private String constructKey( DependencyNode node ) { return constructKey( node.getArtifact() ); }
private String getFullArtifactName( DependencyNode node, boolean usePremanaged ) { Artifact artifact = node.getArtifact(); String version = node.getPremanagedVersion(); if ( !usePremanaged || version == null ) { version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version; }
private String getFullArtifactName( DependencyNode node, boolean usePremanaged ) { Artifact artifact = node.getArtifact(); String version = node.getPremanagedVersion(); if ( !usePremanaged || version == null ) { version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version; }
@Override public void actionPerformed(ActionEvent e) { if (dependencyNode != null) { MavenProject prj = lkp.lookup(MavenProject.class); if (prj != null) { ArtifactViewer.showArtifactViewer(dependencyNode.getArtifact(), prj.getRemoteArtifactRepositories(), ArtifactViewer.HINT_DEPENDENCIES); } } }
protected void saveDependency(final Project project, DependencyNode node, SensorContext context) { Resource from = (node.getParent().getParent() == null) ? index.getProject() : toResource(project, node.getParent().getArtifact(), context); Resource to = toResource(project, node.getArtifact(), context); Dependency dependency = new Dependency(from, to); dependency.setUsage(node.getArtifact().getScope()); dependency.setWeight(1); context.saveDependency(dependency); }
public TreeNode(DependencyNode node, final Lookup tcLookup) { super(createTreeChildren(node, tcLookup), Lookups.fixed(node)); this.tcLookup = tcLookup; final Artifact artifact = node.getArtifact(); setName(artifact.getId()); this.node = node; setDisplayName(artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getArtifactHandler().getExtension()); if (node.getDepth() > 1) { setIconBaseWithExtension(IconResources.TRANSITIVE_DEPENDENCY_ICON); } else { setIconBaseWithExtension(IconResources.ICON_DEPENDENCY_JAR); } setShortDescription(Bundle.TIP_listNode(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), calculateStateTipPart(node))); }