/** * Adds a new project class path entry to the project. * @param project * @param newProjectEntry (must be absolute <code>IPath</code>) */ public AddToClasspathChange(IJavaProject project, IPath newProjectEntry){ this(project, JavaCore.newProjectEntry(newProjectEntry)); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * <p> * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * </p> * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * <p> * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * </p> * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * <p> * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * </p> * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * <p> * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * </p> * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
/** * Creates and returns a new non-exported classpath entry of kind <code>CPE_PROJECT</code> * for the project identified by the given absolute path. * <p> * This method is fully equivalent to calling * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IClasspathAttribute[], boolean) * newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false)}. * </p> * * @param path the absolute path of the binary archive * @return a new project classpath entry */ public static IClasspathEntry newProjectEntry(IPath path) { return newProjectEntry(path, false); }
private static IClasspathEntry[] getProjectDependency(IProject clientProj){ IClasspathEntry projectEntry = JavaCore.newProjectEntry(clientProj.getFullPath(), true); return new IClasspathEntry[]{projectEntry}; }
protected void addProjectEntry(IProject project, Rule[] rules, ArrayList<IClasspathEntry> entries) throws CoreException { if (project.hasNature(JavaCore.NATURE_ID)) { IClasspathEntry entry = null; if (rules != null) { IAccessRule[] accessRules = getAccessRules(rules); entry = JavaCore.newProjectEntry(project.getFullPath(), accessRules, true, new IClasspathAttribute[0], false); } else { entry = JavaCore.newProjectEntry(project.getFullPath()); } if (!entries.contains(entry)) entries.add(entry); } }
public static void addProjectReference(IJavaProject from, IJavaProject to) throws CoreException { addToClasspath(from, JavaCore.newProjectEntry(to.getPath())); }
public static void addProjectReference(IJavaProject from, IJavaProject to) throws CoreException { addToClasspath(from, JavaCore.newProjectEntry(to.getPath())); }
private List<IClasspathEntry> collectProjectDependencies() { Builder<IClasspathEntry> result = ImmutableList.builder(); for (EclipseProjectDependency dependency : this.gradleProject.getProjectDependencies()) { IPath path = new Path("/" + dependency.getPath()); IClasspathEntry entry = JavaCore .newProjectEntry(path, ClasspathUtils.createAccessRules(dependency), true, ClasspathUtils.createClasspathAttributes(dependency), dependency.isExported()); result.add(entry); } return result.build(); }
/** * Returns a new runtime classpath entry for the given project. * * @param project Java project * @return runtime classpath entry * @since 2.0 */ public static IRuntimeClasspathEntry newProjectRuntimeClasspathEntry(IJavaProject project) { return newRuntimeClasspathEntry(JavaCore.newProjectEntry(project.getProject().getFullPath())); }
/** * Returns a new runtime classpath entry for the given project. * * @param project Java project * @return runtime classpath entry * @since 2.0 */ public static IRuntimeClasspathEntry newProjectRuntimeClasspathEntry(IJavaProject project) { return newRuntimeClasspathEntry(JavaCore.newProjectEntry(project.getProject().getFullPath())); }
/** * Returns a new runtime classpath entry for the given project. * * @param project * Java project * @param classpathProperty * the type of entry - one of <code>USER_CLASSES</code>, <code>BOOTSTRAP_CLASSES</code>,<code>STANDARD_CLASSES</code>, * <code>MODULE_PATH</code> or <code>CLASS_PATH</code> * @return runtime classpath entry * @since 3.10 */ public static IRuntimeClasspathEntry newProjectRuntimeClasspathEntry(IJavaProject project, int classpathProperty) { return newRuntimeClasspathEntry(JavaCore.newProjectEntry(project.getProject().getFullPath()), classpathProperty); }
private IClasspathEntry createModifiedEntry(IClasspathEntry oldEntry) { return JavaCore.newProjectEntry(createNewPath(), oldEntry.getAccessRules(), oldEntry.combineAccessRules(), oldEntry.getExtraAttributes(), oldEntry.isExported()); }
private IClasspathEntry createModifiedEntry(IClasspathEntry oldEntry) { return JavaCore.newProjectEntry(createNewPath(), oldEntry.getAccessRules(), oldEntry.combineAccessRules(), oldEntry.getExtraAttributes(), oldEntry.isExported()); }
private IClasspathEntry createModifiedEntry(IClasspathEntry oldEntry) { return JavaCore.newProjectEntry(createNewPath(), oldEntry.getAccessRules(), oldEntry.combineAccessRules(), oldEntry.getExtraAttributes(), oldEntry.isExported()); }
private IClasspathEntry addAttributes(IClasspathEntry entry, IClasspathAttribute[] extraAttributes) { switch (entry.getEntryKind()) { case IClasspathEntry.CPE_CONTAINER: return JavaCore.newContainerEntry(entry.getPath(), entry.getAccessRules(), extraAttributes, entry.isExported()); case IClasspathEntry.CPE_LIBRARY: return JavaCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), extraAttributes, entry.isExported()); case IClasspathEntry.CPE_PROJECT: return JavaCore.newProjectEntry(entry.getPath(), entry.getAccessRules(), entry.combineAccessRules(), extraAttributes, entry.isExported()); default: return entry; // other kinds are not handled } }
private static IClasspathEntry addAttributes(IClasspathEntry entry, IClasspathAttribute[] extraAttributes) { switch (entry.getEntryKind()) { case IClasspathEntry.CPE_LIBRARY: return JavaCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), extraAttributes, entry.isExported()); case IClasspathEntry.CPE_PROJECT: return JavaCore.newProjectEntry(entry.getPath(), entry.getAccessRules(), entry.combineAccessRules(), extraAttributes, entry.isExported()); case IClasspathEntry.CPE_CONTAINER: return JavaCore.newContainerEntry(entry.getPath(), entry.getAccessRules(), extraAttributes, entry.isExported()); case IClasspathEntry.CPE_VARIABLE: return JavaCore.newVariableEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), extraAttributes, entry.isExported()); default: return entry; // other kinds are not handled } }