Examples of IvyClasspathContainer


Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

public class ClasspathContainerSelectionDialog extends ElementListSelectionDialog {
    public ClasspathContainerSelectionDialog(Shell parentShell) {
        super(parentShell, new LabelProvider() {
            public String getText(Object element) {
                IvyClasspathContainer container = (IvyClasspathContainer) element;
                return container.getConf().getJavaProject().getProject().getName() + " -> "
                        + container.getDescription();
            }
        });
        setTitle("Ivy Classpath Containers");
        setMessage("Select a container to view in the resolve visualizer.");
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

    }

    private void makeActions() {
        refreshAction = new Action() {
            public void run() {
                final IvyClasspathContainer container = currentContainer;

                if (container == null) {
                    // nothing as been actually selected
                    return;
                }

                ResolveReport report = container.getResolveReport();
                if (report == null) {
                    // TODO we might want to launch some resolve here
                    // or at least open a popup inviting the end user to launch one
                    return;
                }
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        containerPage.finish();
        IClasspathEntry newEntry = containerPage.getSelection();
        IPath path = newEntry.getPath();
        IJavaProject project = containerPage.getProject();
        try {
            IvyClasspathContainer ivycp = new IvyClasspathContainer(project, path,
                    new IClasspathEntry[0], new IClasspathAttribute[0]);
            JavaCore.setClasspathContainer(path, new IJavaProject[] {project},
                new IClasspathContainer[] {ivycp}, null);
            IClasspathEntry[] entries = project.getRawClasspath();
            List newEntries = new ArrayList(Arrays.asList(entries));
            newEntries.add(newEntry);
            entries = (IClasspathEntry[]) newEntries
                    .toArray(new IClasspathEntry[newEntries.size()]);
            project.setRawClasspath(entries, project.getOutputLocation(), null);
            ivycp.launchResolve(false, null);
        } catch (JavaModelException e) {
            IvyPlugin.log(e);
            return false;
        }
        return true;
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        if (entry == null) {
            // cannot resolve without entry or project context
            return new IRuntimeClasspathEntry[0];
        }

        IvyClasspathContainer ivycp;

        IJavaProject project = entry.getJavaProject();
        if (project == null) {
            ivycp = new IvyClasspathContainer(null, entry.getPath(), null, null);
        } else {
            IClasspathContainer container = JavaCore
                    .getClasspathContainer(entry.getPath(), project);
            if (container == null) {
                String message = "Could not resolve classpath container: "
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        // add clean cache
        if (!containers.isEmpty()) {
            if (totalSelected == 1 && containers.size() == 1
                    && ((Set) containers.values().iterator().next()).size() == 1) {
                // only one container
                IvyClasspathContainer ivycp = (IvyClasspathContainer) ((Set) containers.values()
                        .iterator().next()).iterator().next();
                Ivy ivy = ivycp.getState().getCachedIvy();
                if (ivy != null) {
                    addCleanableForSingleContainer(menuManager, items, ivy);
                }
            } else {
                addCleanableForManyContainers(menuManager, items, containers.values());
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        }
    }

    private boolean collectContainer(Map/* <IProject, Set<IvyClasspathContainer>> */containers,
            ClassPathContainer element) {
        IvyClasspathContainer ivycp = IvyClasspathUtil.jdt2IvyCPC(element);
        if (ivycp == null) {
            return false;
        }
        doCollectContainer(containers, ivycp);
        return true;
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        Iterator itSet = containerSets.iterator();
        while (itSet.hasNext()) {
            Set set = (Set) itSet.next();
            Iterator itContainer = set.iterator();
            while (itContainer.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainer.next();
                Ivy ivy = ivycp.getState().getCachedIvy();
                if (ivy != null) {
                    addResolutionCleanable(allCleanables, ivy);
                    addResolutionCleanable(resolutionCleanables, ivy);

                    addRepositoryCleanable(allCleanables, ivy);
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        MultiStatus errorStatuses = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
                "Failed to update one or more Ivy files.  See details.", null);

        IvyClasspathContainer[] containers = getIvyClasspathContainers();
        for (int i = 0; i < containers.length; i++) {
            IvyClasspathContainer container = containers[i];

            ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
            if (md == null) {
                continue;
            }

            Map/* <ModuleRevisionId, String> */newRevisions = new HashMap();

            DependencyDescriptor[] dependencies = md.getDependencies();
            for (int j = 0; j < dependencies.length; j++) {
                for (int k = 0; k < multiRevisionDependencies.length; k++) {
                    MultiRevDependencyDescriptor multiRevision = multiRevisionDependencies[k];
                    ModuleRevisionId dependencyRevisionId = dependencies[j]
                            .getDependencyRevisionId();
                    if (dependencies[j].getDependencyId().equals(multiRevision.getModuleId())
                            && multiRevision.hasNewRevision()
                            && multiRevision.isForContainer(container)) {
                        newRevisions.put(dependencyRevisionId, multiRevisionDependencies[k]
                                .getNewRevision());
                        break; // move on to the next dependency
                    }
                }
            }
           
            UpdateOptions updateOptions = new UpdateOptions()
                .setResolvedRevisions(newRevisions)
                .setReplaceInclude(false)
                .setGenerateRevConstraint(false)
                .setNamespace(new RevisionPreservingNamespace());
            File ivyFile = container.getState().getIvyFile();
           
            File ivyTempFile = new File(ivyFile.toString() + ".temp");
            try {
                XmlModuleDescriptorUpdater.update(ivyFile.toURI().toURL(), ivyTempFile,
                    updateOptions);
                saveChanges(container, ivyFile, ivyTempFile);
            } catch (MalformedURLException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath()
                                + " (malformed URL)", e));
            } catch (IOException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
                        e));
            } catch (SAXException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                    "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
                    e));
            } finally {
                ivyTempFile.delete();
            }
        }
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        IFile file = ((IvyFileEditorInput) getEditorInput()).getFile();
        List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                .getIvySettingsClasspathContainers(file);
        Iterator/* <IvyClasspathContainer> */itContainers = containers.iterator();
        while (itContainers.hasNext()) {
            IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainers.next();
            ivycp.launchResolve(false, null);
        }
    }
View Full Code Here

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

        for (int i = 0; i < projects.length; i++) {
            List containers = IvyClasspathUtil.getIvyClasspathContainers(projects[i]);
            Iterator containerIter = containers.iterator();

            while (containerIter.hasNext()) {
                IvyClasspathContainer container = (IvyClasspathContainer) containerIter.next();
                ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
                if (md == null) {
                    continue;
                }
                DependencyDescriptor[] descriptors = md.getDependencies();
                for (int j = 0; j < descriptors.length; j++) {
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.