Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IClasspathContainer


                IClasspathEntry entry = root.getRawClasspathEntry();
                IPath containerPath = null;
                IJavaProject javaProject = root.getJavaProject();
                if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
                    containerPath = entry.getPath();
                    IClasspathContainer container = JavaCore
                        .getClasspathContainer(containerPath, javaProject);
                    if(!isSourceAttachmentPossible(containerPath, javaProject)){
                        editor.setSourceAttachmentPossible(false);
                        attachAction.setEnabled(false);
                        BytecodeOutlinePlugin
View Full Code Here


        IJavaProject javaProject = JavaCore.create(project);
        return resetClasspaths(model, javaProject, errors);
    }

    public static boolean resetClasspaths(Project model, IJavaProject javaProject, Collection<String> errors) throws CoreException {
        IClasspathContainer container = JavaCore.getClasspathContainer(BndtoolsConstants.BND_CLASSPATH_ID, javaProject);
        List<IClasspathEntry> currentClasspath = Arrays.asList(container.getClasspathEntries());

        List<IClasspathEntry> newClasspath = BndContainerInitializer.calculateProjectClasspath(model, javaProject, errors);
        newClasspath = BndContainerSourceManager.loadAttachedSources(javaProject, newClasspath);

        replaceClasspathProblemMarkers(javaProject.getProject(), errors);
View Full Code Here

                IPath outputLocation = entry.getOutputLocation();
                if (exports && outputLocation != null)
                    files.add(getFileForPath(outputLocation));
                break;
            case IClasspathEntry.CPE_CONTAINER :
                IClasspathContainer container = JavaCore.getClasspathContainer(path, project);
                boolean allow = true;
                for (Predicate<IClasspathContainer> filter : containerFilters)
                    if (!filter.select(container))
                        allow = false;
                if (allow)
                    queue.addAll(Arrays.asList(container.getClasspathEntries()));
                break;
            case IClasspathEntry.CPE_PROJECT :
                IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(path.lastSegment());
                IJavaProject targetJavaProject = JavaCore.create(targetProject);
                accumulateClasspath(files, targetJavaProject, true, containerFilters);
View Full Code Here

                IPath outputLocation = entry.getOutputLocation();
                if (exports && outputLocation != null)
                    files.add(getFileForPath(outputLocation));
                break;
            case IClasspathEntry.CPE_CONTAINER :
                IClasspathContainer container = JavaCore.getClasspathContainer(path, project);
                boolean allow = true;
                for (Predicate<IClasspathContainer> filter : containerFilters)
                    if (!filter.select(container))
                        allow = false;
                if (allow)
                    queue.addAll(Arrays.asList(container.getClasspathEntries()));
                break;
            case IClasspathEntry.CPE_PROJECT :
                IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(path.lastSegment());
                IJavaProject targetJavaProject = JavaCore.create(targetProject);
                accumulateClasspath(files, targetJavaProject, true, containerFilters);
View Full Code Here

        IJavaProject javaProject = JavaCore.create(project);
        return resetClasspaths(model, javaProject, errors);
    }

    public static boolean resetClasspaths(Project model, IJavaProject javaProject, Collection<String> errors) throws CoreException {
        IClasspathContainer container = JavaCore.getClasspathContainer(BndtoolsConstants.BND_CLASSPATH_ID, javaProject);
        List<IClasspathEntry> currentClasspath = Arrays.asList(container.getClasspathEntries());

        List<IClasspathEntry> newClasspath = BndContainerInitializer.calculateProjectClasspath(model, javaProject, errors);
        newClasspath = BndContainerSourceManager.loadAttachedSources(javaProject, newClasspath);

        replaceClasspathProblemMarkers(javaProject.getProject(), errors);
View Full Code Here

              if (isSpringLibrary(entry)) {
                foundSpringLibrary = true;
              }
            }
            else if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
              IClasspathContainer container = JavaCore
                  .getClasspathContainer(entry.getPath(), javaProject);
              if (container != null) {
                for (IClasspathEntry childEntry : container.getClasspathEntries()) {
                  if (isLiftLibrary(childEntry)) {
                    return CloudFoundryConstants.LIFT;
                  }
                  if (isSpringLibrary(childEntry)) {
                    foundSpringLibrary = true;
View Full Code Here

    public AndroidClasspathContainerInitializer() {
    }

    @Override
    public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
        final IClasspathContainer container = getAndroidContainer(containerPath, project);
        JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {
                project
        },
        new IClasspathContainer[] {
                container
View Full Code Here

    {
        ISigilProjectModel sigil = SigilCore.create(project.getProject());
       
        SigilClassPathContainer.flushCachedClassPath(sigil);

        IClasspathContainer sigilContainer = new SigilClassPathContainer(sigil);

        IJavaProject[] affectedProjects = new IJavaProject[] { project };

        IClasspathContainer[] respectiveContainers = new IClasspathContainer[] { sigilContainer };
View Full Code Here

    public void initialize(IPath containerPath, IJavaProject project)
        throws CoreException
    {
        ISigilProjectModel sigil = SigilCore.create(project.getProject());

        IClasspathContainer sigilContainer = new SigilClassPathContainer(sigil);

        IJavaProject[] affectedProjects = new IJavaProject[] { project };

        IClasspathContainer[] respectiveContainers = new IClasspathContainer[] { sigilContainer };
View Full Code Here

        if (IvyClasspathContainerHelper.isIvyClasspathContainer(containerPath)) {

            IvyDEMessage.info("Initializing container " + 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.logError("Unable to get container for " + containerPath.toString(), ex);
                return;
            }

            try {
                boolean refresh = false;
                IvyClasspathContainerImpl ivycp = null;
                IClasspathEntry entry = IvyClasspathContainerHelper.getEntry(containerPath,
                    project);
                IClasspathAttribute[] attributes;
                boolean exported;
                if (entry != null) {
                    attributes = entry.getExtraAttributes();
                    exported = entry.isExported();
                } else {
                    exported = false;
                    attributes = new IClasspathAttribute[0];
                }

                if (container instanceof IvyClasspathContainerImpl) {
                    IvyDEMessage.debug("Container already configured");
                    ivycp = (IvyClasspathContainerImpl) container;
                } else {
                    if (container == null) {
                        IvyDEMessage.debug("No saved container");
                        // try what the IvyDE plugin saved
                        IvyClasspathContainerSerializer serializer = IvyPlugin.getDefault()
                                .getIvyClasspathContainerSerializer();
                        Map ivycps = serializer.read(project);
                        if (ivycps != null) {
                            IvyDEMessage.debug("Found serialized containers");
                            ivycp = (IvyClasspathContainerImpl) ivycps.get(containerPath);
                        }
                        if (ivycp == null) {
                            IvyDEMessage.debug("No serialized containers match the expected container path");
                            // still bad luck or just a new classpath container
                            ivycp = new IvyClasspathContainerImpl(project, containerPath,
                                    new IClasspathEntry[0], attributes);
                            // empty, so force refresh at least
                            refresh = true;
                        }
                    } else {
                        IvyDEMessage.debug("Loading from a saved container");
                        // this might be the persisted one : reuse the persisted entries
                        ivycp = new IvyClasspathContainerImpl(project, containerPath,
                                container.getClasspathEntries(), attributes);
                    }
                }

                // FIXME : container path upgrade removed since it seems to make some trouble:
                // containers get either uninitialized or initialized twice...
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.