Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IClasspathContainer


    if (projectAdapter != null && projectAdapter.isFramework()) {
      if (cp != null && !cp.isExported() && cp.getPath() != null && cp.getPath().segmentCount() > 0 && WOFrameworkClasspathContainer.ID.equals(cp.getPath().segment(0))) {
        return new IRuntimeClasspathEntry[0];
      }
    }
    IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
    if (container == null) {
      abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Could_not_resolve_classpath_container___0__1, new Object[] { entry.getPath().toString() }), null);
      // execution will not reach here - exception will be thrown
      return null;
    }
    IClasspathEntry[] cpes = container.getClasspathEntries();
    int property = -1;
    switch (container.getKind()) {
    case IClasspathContainer.K_APPLICATION:
      property = IRuntimeClasspathEntry.USER_CLASSES;
      break;
    case IClasspathContainer.K_DEFAULT_SYSTEM:
      property = IRuntimeClasspathEntry.STANDARD_CLASSES;
View Full Code Here


  }

  public static WOFrameworkClasspathContainer getFrameworkClasspathContainer(IJavaProject project, IClasspathEntry classpathEntry) {
    WOFrameworkClasspathContainer frameworkContainer = null;
    try {
      IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), project);
      if (container instanceof WOFrameworkClasspathContainer) {
        frameworkContainer = (WOFrameworkClasspathContainer) container;
      }
    }
    catch (Exception e) {
View Full Code Here

    }
    return frameworkContainer;
  }

  public static boolean isFrameworkClasspathEntry(IJavaProject project, IClasspathEntry classpathEntry) throws JavaModelException {
    IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), project);
    return container instanceof WOFrameworkClasspathContainer;
  }
View Full Code Here

      int remaining = 0;
      for (int i = 0; i < projectLength; i++){
        if (isCanceled())
          return;
        JavaProject affectedProject = (JavaProject) this.affectedProjects[i];
        IClasspathContainer newContainer = this.respectiveContainers[i];
        if (newContainer == null) newContainer = JavaModelManager.CONTAINER_INITIALIZATION_IN_PROGRESS; // 30920 - prevent infinite loop
        boolean found = false;
        if (JavaProject.hasJavaNature(affectedProject.getProject())){
          IClasspathEntry[] rawClasspath = affectedProject.getRawClasspath();
          for (int j = 0, cpLength = rawClasspath.length; j <cpLength; j++) {
            IClasspathEntry entry = rawClasspath[j];
            if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER && entry.getPath().equals(this.containerPath)){
              found = true;
              break;
            }
          }
        }
        if (!found) {
          modifiedProjects[i] = null; // filter out this project - does not reference the container path, or isnt't yet Java project
          manager.containerPut(affectedProject, this.containerPath, newContainer);
          continue;
        }
        IClasspathContainer oldContainer = manager.containerGet(affectedProject, this.containerPath);
        if (oldContainer == JavaModelManager.CONTAINER_INITIALIZATION_IN_PROGRESS) {
          oldContainer = null;
        }
        if ((oldContainer != null && oldContainer.equals(this.respectiveContainers[i]))
            || (oldContainer == this.respectiveContainers[i])/*handle case where old and new containers are null (see bug 149043*/) {
          modifiedProjects[i] = null; // filter out this project - container did not change
          continue;
        }
        remaining++;
View Full Code Here

            StringBuffer buffer = new StringBuffer("    "); //$NON-NLS-1$
            if (o == null) {
              buffer.append("<null>"); //$NON-NLS-1$
              return buffer.toString();
            }
            IClasspathContainer container = (IClasspathContainer) o;
            buffer.append(container.getDescription());
            buffer.append(" {\n"); //$NON-NLS-1$
            IClasspathEntry[] entries = container.getClasspathEntries();
            if (entries != null){
              for (int i = 0; i < entries.length; i++){
                buffer.append("       "); //$NON-NLS-1$
                buffer.append(entries[i]);
                buffer.append('\n');
View Full Code Here

            addToResult(rawEntry, resolvedEntry, result, resolvedEntries, externalFoldersManager, referencedEntriesMap, false, knownDrives);
          }
          break;

        case IClasspathEntry.CPE_CONTAINER :
          IClasspathContainer container = usePreviousSession ? manager.getPreviousSessionContainer(rawEntry.getPath(), this) : JavaCore.getClasspathContainer(rawEntry.getPath(), this);
          if (container == null){
            result.unresolvedEntryStatus = new JavaModelStatus(IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND, this, rawEntry.getPath());
            break;
          }

          IClasspathEntry[] containerEntries = container.getClasspathEntries();
          if (containerEntries == null) {
            if (JavaModelManager.CP_RESOLVE_VERBOSE || JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
              JavaModelManager.getJavaModelManager().verbose_missbehaving_container_null_entries(this, rawEntry.getPath());
            }
            break;
View Full Code Here

                  status = new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION, Messages.bind(Messages.classpath_duplicateEntryExtraAttribute, new String[] {attName, entryPathMsg, projectName}));
                  break;
                }
              }
            }
            IClasspathContainer container = JavaModelManager.getJavaModelManager().getClasspathContainer(path, project);
            // container retrieval is performing validation check on container entry kinds.
            if (container == null) {
              if (status != null)
                return status;
              return new JavaModelStatus(IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND, project, path);
            } else if (container == JavaModelManager.CONTAINER_INITIALIZATION_IN_PROGRESS) {
              // don't create a marker if initialization is in progress (case of cp initialization batching)
              return JavaModelStatus.VERIFIED_OK;
            }
            IClasspathEntry[] containerEntries = container.getClasspathEntries();
            if (containerEntries != null){
              for (int i = 0, length = containerEntries.length; i < length; i++){
                IClasspathEntry containerEntry = containerEntries[i];
                int kind = containerEntry == null ? 0 : containerEntry.getEntryKind();
                if (containerEntry == null
View Full Code Here

          if (description == null) description = this.path.makeRelative().toString();
          return Messages.bind(Messages.classpath_unboundContainerPath, new String[] {description, javaProject.getElementName()});

        case INVALID_CP_CONTAINER_ENTRY:
          javaProject = (IJavaProject)this.elements[0];
          IClasspathContainer container = null;
          description = null;
          try {
            container = JavaCore.getClasspathContainer(this.path, javaProject);
          } catch(JavaModelException e){
            // project doesn't exist: ignore
          }
          if (container == null) {
             initializer = JavaCore.getClasspathContainerInitializer(this.path.segment(0));
            if (initializer != null) description = initializer.getDescription(this.path, javaProject);
          } else {
            description = container.getDescription();
          }
          if (description == null) description = this.path.makeRelative().toString();
          return Messages.bind(Messages.classpath_invalidContainer, new String[] {description, javaProject.getElementName()});

        case CP_VARIABLE_PATH_UNBOUND:
View Full Code Here

  }

  @Override
  public void initialize(IPath containerPath, IJavaProject project)
      throws CoreException {
    IClasspathContainer container = new IClasspathContainer() {
     
      public IPath getPath() {
        return   new Path(MockitoEntry.CONTAINER_PATH);
      }
     
View Full Code Here

                        if (cpEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {

                            if ( cpEntry.getPath().toString().equals( containerPath )) {

                                IClasspathContainer classpathContainer = JavaCore.getClasspathContainer(cpEntry.getPath(), javaProject);
                                IClasspathEntry[] containerEntries = classpathContainer.getClasspathEntries();

                                for (int ii = 0; ii  < containerEntries.length; ii++) {
                                    classpathEntries.add(containerEntries[ii]);
                                }
                            }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IClasspathContainer

Copyright © 2018 www.massapicom. 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.