Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IClasspathContainer


        } else {
            conf.ivySettingsPath = null;
        }
        entry = JavaCore.newContainerEntry(conf.getPath());
        try {
            IClasspathContainer cp = JavaCore.getClasspathContainer(entry.getPath(), project);
            if (cp instanceof IvyClasspathContainer) {
                ((IvyClasspathContainer) cp).scheduleResolve();
            }
        } catch (JavaModelException e) {
            // unless there are issues with the JDT, this should never happen
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

            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

    List<IClasspathContainer> cons = new ArrayList<IClasspathContainer>();
    if (containerPath.equals(JavaUtil.VS_LAYOUTEXT))
      cons.add(new LayoutExtensionLibrary(containerPath));
    List<ILibraryExtension> libExts = ExtensionRegistry.getLibExtensions();
    for (ILibraryExtension libExt : libExts) {
      IClasspathContainer con = libExt.createLibExt(containerPath);
      if (con != null) {
        cons.add(con);
      }
    }
    if (!cons.isEmpty()) {
View Full Code Here

    Object[] sel = viewer.getCheckedElements();
    if (sel == null || sel.length == 0)
      return false;
    this.selected_containers = new IClasspathEntry[sel.length];
    for (int i = 0; i < sel.length; i++) {
      IClasspathContainer icc = (IClasspathContainer) sel[i];
      this.selected_containers[i] = JavaCore.newContainerEntry(icc
          .getPath(), false);
    }
    return true;
  }
View Full Code Here

    viewer.setContentProvider(new LibContProv());
    viewer.setLabelProvider(new CheckedTableLabelProvider());
    viewer.setInput(new LibInput());
    if (toBeEdited != null) {
      IPath ipath = toBeEdited.getPath();
      IClasspathContainer lib = null;
      if (ipath.equals(JavaUtil.VS_LAYOUTEXT)) {
        lib = new LayoutExtensionLibrary();
      } else {
        List<ILibraryExtension> libExts = ExtensionRegistry
            .getLibExtensions();
        for (ILibraryExtension libExt : libExts) {
          lib = libExt.createLibExt(ipath);
          if (lib != null) {
            break;
          }
        }
      }
      if (lib != null) {
        viewer.setSelection(new StructuredSelection(new Object[] { lib }));
        viewer.setChecked(lib, true);
      }
    }
    for(IClasspathEntry currentEntry:currentEntries){
      IPath ipath = currentEntry.getPath();
      IClasspathContainer lib = null;
      if (ipath.equals(JavaUtil.VS_LAYOUTEXT)) {
        lib = new LayoutExtensionLibrary();
      } else {
        List<ILibraryExtension> libExts = ExtensionRegistry
            .getLibExtensions();
View Full Code Here

            }
            // add CPE_CONTAINER classpathes
            IClasspathEntry[] rawClasspath = javaProject.getRawClasspath();
            for (IClasspathEntry entry : rawClasspath) {
                if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
                    IClasspathContainer classpathContainer = JavaCore.getClasspathContainer(entry.getPath(), javaProject);
                    if (classpathContainer != null && !(classpathContainer instanceof JREContainer)) {
                        IClasspathEntry[] classpathEntries = classpathContainer.getClasspathEntries();
                        for (IClasspathEntry iClasspathEntry : classpathEntries) {
                            IPath path = iClasspathEntry.getPath();
                            if (isValidPath(path)) {
                                classPath.add(path.toOSString());
                            }
View Full Code Here

     * @return the IvyClasspathContainer is such, null, if not
     */
    public static IvyClasspathContainer jdt2IvyCPC(ClassPathContainer cpc) {
        IClasspathEntry entry = cpc.getClasspathEntry();
        try {
            IClasspathContainer icp = JavaCore.getClasspathContainer(entry.getPath(), cpc
                    .getJavaProject());
            if (icp instanceof IvyClasspathContainer) {
                return (IvyClasspathContainer) icp;
            }
        } catch (JavaModelException e) {
View Full Code Here

            for (int i = 0; i < entries.length; i++) {
                IClasspathEntry entry = entries[i];
                if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
                    IPath path = entry.getPath();
                    if (isIvyClasspathContainer(path)) {
                        IClasspathContainer cp = JavaCore.getClasspathContainer(path, javaProject);
                        if (cp instanceof IvyClasspathContainer) {
                            return (IvyClasspathContainer) cp;
                        }
                    }
                }
View Full Code Here

     */
    public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
        if (IvyClasspathUtil.isIvyClasspathContainer(containerPath)) {

            // try to get an existing one
            IClasspathContainer container = null;
            try {
                container = JavaCore.getClasspathContainer(containerPath, project);
            } catch (JavaModelException ex) {
                // unless there are issues with the JDT, this should never happen
                IvyPlugin.log(IStatus.ERROR, "Unable to get container for "
                        + containerPath.toString(), ex);
                return;
            }

            try {
                if (container == null) {
                    container = new IvyClasspathContainer(project, containerPath,
                            new IClasspathEntry[0]);
                } else if (!(container instanceof IvyClasspathContainer)) {
                    // this might be the persisted one : reuse the persisted entries
                    container = new IvyClasspathContainer(project, containerPath, container
                            .getClasspathEntries());
                }
                JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project},
                    new IClasspathContainer[] {container}, null);

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.