Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProjectNature


      project.setDescription(description, monitor);
      boolean success = WOLipsNatureUtils.addAntApplicationNatureToProject(project, monitor);
      assertTrue(success);
      success = WOLipsNatureUtils.addAntApplicationNatureToProject(project, monitor);
      assertTrue(success);
      IProjectNature nature = WOLipsNatureUtils.getNature(project);
      assertFalse(((Nature) nature).isFramework());
    } catch (CoreException e) {
      assertTrue(false);
    }
    CoreException exception = null;
View Full Code Here


public class LastLaunchSearchStrategy implements ITypeSystemSearchStrategy {

  public IFile findTypeSystem(IFile casFile) {
    IProject project = casFile.getProject();
    try {
      IProjectNature nature = project.getNature(RutaNature.NATURE_ID);
      if (!(nature instanceof RutaNature)) {
        return null;
      }
    } catch (CoreException e) {
      return null;
View Full Code Here

  public IFile findTypeSystem(IFile casFile) {
    IProject project = casFile.getProject();

    try {
      IProjectNature nature = project.getNature(RutaNature.NATURE_ID);
      if (!(nature instanceof RutaNature)) {
        return null;
      }
    } catch (CoreException e) {
      return null;
View Full Code Here

  private static Collection<IProject> getReferencedProjects(IProject proj, Collection<IProject> visited) throws CoreException {
    Collection<IProject> result = new HashSet<IProject>();
    IProject[] referencedProjects = proj.getReferencedProjects();
    result.addAll(Arrays.asList(referencedProjects));
    IProjectNature nature = proj.getNature(JAVANATURE);
    if(nature != null) {
      JavaProject javaProject = (JavaProject) JavaCore.create(proj);
      IClasspathEntry[] resolvedClasspath = javaProject.getResolvedClasspath();
      for (IClasspathEntry eachCPE : resolvedClasspath) {
        if(eachCPE.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
View Full Code Here

    return result;
  }

  public static List<IFolder> getDescriptorFolders(IProject proj) throws CoreException {
    List<IFolder> result = new ArrayList<IFolder>();
    IProjectNature javaNature = proj.getNature(JAVANATURE);
    if (javaNature != null) {
      IJavaProject javaProject = JavaCore.create(proj);
      IPath readOutputLocation = javaProject.readOutputLocation();
      IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(readOutputLocation);
      result.add(folder);
    }
    IProjectNature pearNature = proj.getNature("org.apache.uima.pear.UimaNature");
    if (pearNature != null) {
      IFolder findElement = proj.getFolder("desc");
      if (findElement != null) {
        result.add((IFolder) findElement);
      }
    }
    IProjectNature rutaNature = proj.getNature(RutaNature.NATURE_ID);
    if (rutaNature != null) {
      IFolder findElement = proj.getFolder(getDefaultDescriptorLocation());
      if (findElement != null) {
        result.add((IFolder) findElement);
      }
View Full Code Here

    return result;
  }

  private void extendClasspathWithProject(Collection<String> result, IProject project,
          Collection<IProject> visited) throws CoreException, JavaModelException {
    IProjectNature nature = project.getNature(RutaProjectUtils.JAVANATURE);
    if (nature != null) {
      JavaProject javaProject = (JavaProject) JavaCore.create(project);

      // add output, e.g., target/classes
      IPath readOutputLocation = javaProject.readOutputLocation();
View Full Code Here

        } catch (CoreException e) {
          RutaAddonsPlugin.error(e);
        }

        try {
          IProjectNature nature = each.getNature(RutaNature.NATURE_ID);
          if (nature != null) {
            List<IFolder> descriptorFolders = RutaProjectUtils.getDescriptorFolders(each);
            if (descriptorFolders != null && !descriptorFolders.isEmpty()) {
              IFolder descFolder = descriptorFolders.get(0);
              RutaProjectCreationWizard.copyDescriptors(descFolder);
View Full Code Here

    public static DjangoNature getDjangoNature(IProject project) {
        if (project != null && project.isOpen()) {
            try {
                if (project.hasNature(DJANGO_NATURE_ID)) {
                    synchronized (lockGetNature) {
                        IProjectNature n = project.getNature(DJANGO_NATURE_ID);
                        if (n instanceof DjangoNature) {
                            return (DjangoNature) n;
                        }
                    }
                }
View Full Code Here

                    newCommands[0] = command;
                    desc.setBuildSpec(newCommands);
                }
                project.setDescription(desc, monitor);

                IProjectNature n = getPythonNature(project);
                if (n instanceof PythonNature) {
                    PythonNature nature = (PythonNature) n;
                    //call initialize always - let it do the control.
                    nature.init(version, projectPythonpath, externalProjectPythonpath, monitor, projectInterpreter,
                            variableSubstitution);
View Full Code Here

                //than 1 nature).
                try {
                    if (project instanceof Project) {
                        Project p = (Project) project;
                        ProjectInfo info = (ProjectInfo) p.getResourceInfo(false, false);
                        IProjectNature nature = info.getNature(PYTHON_NATURE_ID);
                        if (nature instanceof PythonNature) {
                            return (PythonNature) nature;
                        }
                    }
                } catch (Throwable e) {
                    //Shouldn't really happen, but as using internal methods of project, who knows if it may change
                    //from one version to another.
                    Log.log(e);
                }

                synchronized (lockGetNature) {
                    IProjectNature n = project.getNature(PYTHON_NATURE_ID);
                    if (n instanceof PythonNature) {
                        return (PythonNature) n;
                    }
                }
            } catch (CoreException e) {
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IProjectNature

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.