List of usage examples for org.eclipse.jdt.core IClasspathAttribute INDEX_LOCATION_ATTRIBUTE_NAME
String INDEX_LOCATION_ATTRIBUTE_NAME
To view the source code for org.eclipse.jdt.core IClasspathAttribute INDEX_LOCATION_ATTRIBUTE_NAME.
Click Source Link
From source file:com.codenvy.ide.ext.java.server.internal.core.ClasspathEntry.java
License:Open Source License
/** * This function computes the URL of the index location for this classpath entry. It returns null if the URL is * invalid./* w w w .j a v a 2 s . c o m*/ */ public URL getLibraryIndexLocation() { switch (getEntryKind()) { case IClasspathEntry.CPE_LIBRARY: case IClasspathEntry.CPE_VARIABLE: break; default: return null; } if (this.extraAttributes == null) return null; for (int i = 0; i < this.extraAttributes.length; i++) { IClasspathAttribute attrib = this.extraAttributes[i]; if (IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) { String value = attrib.getValue(); try { return new URL(value); } catch (MalformedURLException e) { return null; } } } return null; }
From source file:org.eclipse.che.jdt.core.launching.JREContainer.java
License:Open Source License
private static IClasspathAttribute[] buildClasspathAttributes(final IVMInstallType vm, final LibraryLocation lib, final boolean overrideJavaDoc) { List<IClasspathAttribute> classpathAttributes = new LinkedList<IClasspathAttribute>(); // process the javadoc location URL javadocLocation = lib.getJavadocLocation(); if (overrideJavaDoc && javadocLocation == null) { javadocLocation = null; //vm.getJavadocLocation(); }/*from w w w.j a va 2s .com*/ if (javadocLocation != null) { IClasspathAttribute javadocCPAttribute = JavaCore.newClasspathAttribute( IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, javadocLocation.toExternalForm()); classpathAttributes.add(javadocCPAttribute); } // process the index location URL indexLocation = lib.getIndexLocation(); if (indexLocation != null) { IClasspathAttribute indexCPLocation = JavaCore.newClasspathAttribute( IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME, indexLocation.toExternalForm()); classpathAttributes.add(indexCPLocation); } return classpathAttributes.toArray(new IClasspathAttribute[classpathAttributes.size()]); }