Examples of IProject


Examples of org.eclipse.core.resources.IProject

   *    the given classpath and output location are compatible, otherwise a status
   *    object indicating what is wrong with the classpath or output location
   */
  public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClasspathEntry[] rawClasspath, IPath projectOutputLocation) {

    IProject project = javaProject.getProject();
    IPath projectPath= project.getFullPath();
    String projectName = javaProject.getElementName();

    /* validate output location */
    if (projectOutputLocation == null) {
      return new JavaModelStatus(IJavaModelStatusConstants.NULL_PATH);
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        break;

      // project entry check
      case IClasspathEntry.CPE_PROJECT :
        if (path.isAbsolute() && path.segmentCount() == 1) {
          IProject prereqProjectRsc = workspaceRoot.getProject(path.segment(0));
          IJavaProject prereqProject = JavaCore.create(prereqProjectRsc);
          try {
            if (!prereqProjectRsc.exists() || !prereqProjectRsc.hasNature(JavaCore.NATURE_ID)){
              return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundProject, new String[] {path.segment(0), projectName}));
            }
            if (!prereqProjectRsc.isOpen()){
              return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_closedProject, new String[] {path.segment(0)}));
            }
            if (!JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) {
              long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
              long prereqProjectTargetJDK = CompilerOptions.versionToJdkLevel(prereqProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    SourceIndexerRequestor requestor = new SourceIndexerRequestor(this);
    String documentPath = this.document.getPath();
    SourceElementParser parser = ((InternalSearchDocument) this.document).parser;
    if (parser == null) {
      IPath path = new Path(documentPath);
      IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
      parser = JavaModelManager.getJavaModelManager().indexManager.getSourceElementParser(JavaCore.create(project), requestor);
    } else {
      parser.requestor = requestor;
    }
   
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    IPath path= new Path(pathString);
    IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i= 0, max= projects.length; i < max; i++) {
      try {
        IProject project = projects[i];
        if (!project.isAccessible()
          || !project.hasNature(JavaCore.NATURE_ID)) continue;
        IJavaProject javaProject= this.javaModel.getJavaProject(project);
        IPackageFragmentRoot[] roots= javaProject.getPackageFragmentRoots();
        for (int j= 0, rootCount= roots.length; j < rootCount; j++) {
          PackageFragmentRoot root= (PackageFragmentRoot)roots[j];
          if (root.getPath().isPrefixOf(path) && !Util.isExcluded(path, root.fullInclusionPatternChars(), root.fullExclusionPatternChars(), false)) {
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    JavaModelManager.PerProjectInfo perProjectInfo;
    try {
      perProjectInfo = this.project.getPerProjectInfo();
    } catch (JavaModelException e) {
      // project doesn't exist
      IProject resource = this.project.getProject();
      if (resource.isAccessible()) {
        this.project.flushClasspathProblemMarkers(true/*flush cycle markers*/, true/*flush classpath format markers*/);
         
        // remove problems and tasks created  by the builder
        JavaBuilder.removeProblemsAndTasksFor(resource);
      }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
  int length = projects.length;
  Object[] resources = null;
  int index = 0;
  for (int i = 0; i < length; i++) {
    IProject project = projects[i];
    if (!JavaProject.hasJavaNature(project)) {
      if (resources == null) {
        resources = new Object[length];
      }
      resources[index++] = project;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

* @param visitedProjects Set to avoid infinite recursion
* @param referringEntry Project raw entry in referring project classpath
* @throws JavaModelException May happen while getting java model info
*/
void add(JavaProject javaProject, IPath pathToAdd, int includeMask, HashSet visitedProjects, IClasspathEntry referringEntry) throws JavaModelException {
  IProject project = javaProject.getProject();
  if (!project.isAccessible() || !visitedProjects.add(project)) return;

  IPath projectPath = project.getFullPath();
  String projectPathString = projectPath.toString();
  this.addEnclosingProjectOrJar(projectPath);

  IClasspathEntry[] entries = javaProject.getResolvedClasspath();
  IJavaModel model = javaProject.getJavaModel();
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
  int length = projects.length;
  IJavaElement[] children = new IJavaElement[length];
  int index = 0;
  for (int i = 0; i < length; i++) {
    IProject project = projects[i];
    if (JavaProject.hasJavaNature(project)) {
      children[index++] = getJavaProject(project);
    }
  }
  if (index < length)
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        // so that there is no concurrency with the Java builder
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=96575
        IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
          public void run(IProgressMonitor progressMonitor) throws CoreException {
            for (int i = 0; i < length; i++) {
              IProject project = projectsToTouch[i];
             
              // touch to force a build of this project
              if (JavaBuilder.DEBUG)
                System.out.println("Touching project " + project.getName() + " due to external jar file change"); //$NON-NLS-1$ //$NON-NLS-2$
              project.touch(progressMonitor);
            }
          }
        };
        try {
          ResourcesPlugin.getWorkspace().run(runnable, monitor);
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        break;
      case IResource.PROJECT :
        // NB: No need to check project's nature as if the project is not a java project:
        //     - if the project is added or changed this is a noop for projectsBeingDeleted
        //     - if the project is closed, it has already lost its java nature
        IProject project = (IProject)resource;
        JavaProject javaProject = (JavaProject)JavaCore.create(project);
        switch (delta.getKind()) {
          case IResourceDelta.ADDED :
            this.manager.batchContainerInitializations = true;
         
            // remember project and its dependents
            addToRootsToRefreshWithDependents(javaProject);
           
            // workaround for bug 15168 circular errors not reported
            if (JavaProject.hasJavaNature(project)) {
              addToParentInfo(javaProject);
              readRawClasspath(javaProject);
              // ensure project references are updated (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=121569)
              checkProjectReferenceChange(project, javaProject);
            }
           
            this.state.rootsAreStale = true;
            break;
           
          case IResourceDelta.CHANGED :
              if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
                this.manager.batchContainerInitializations = true;
   
                // project opened or closed: remember  project and its dependents
                addToRootsToRefreshWithDependents(javaProject);
               
                // workaround for bug 15168 circular errors not reported
                if (project.isOpen()) {
                  if (JavaProject.hasJavaNature(project)) {
                    addToParentInfo(javaProject);
                    readRawClasspath(javaProject);
                    // ensure project references are updated
                    checkProjectReferenceChange(project, javaProject);
                  }
                } else {
                  try {
                    javaProject.close();
                  } catch (JavaModelException e) {
                    // java project doesn't exist: ignore
                  }
                  this.removeFromParentInfo(javaProject);
                  this.manager.removePerProjectInfo(javaProject);
                  this.manager.containerRemove(javaProject);
                }
                this.state.rootsAreStale = true;
              } else if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
                boolean wasJavaProject = this.state.findJavaProject(project.getName()) != null;
                boolean isJavaProject = JavaProject.hasJavaNature(project);
                if (wasJavaProject != isJavaProject) {
                  this.manager.batchContainerInitializations = true;
                 
                  // java nature added or removed: remember  project and its dependents
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.