Examples of IProjectDescription


Examples of org.eclipse.core.resources.IProjectDescription

                    IErlElementLocator.Scope.PROJECT_ONLY);
            final IErlModule x2 = model.findIncludeFromProject(aProject, xx, null,
                    IErlElementLocator.Scope.ALL_PROJECTS);
            final IErlModule x3 = model.findIncludeFromProject(aProject, xx, null,
                    IErlElementLocator.Scope.REFERENCED_PROJECTS);
            final IProjectDescription description = workspaceProject.getDescription();
            description.setReferencedProjects(new IProject[] { project1
                    .getWorkspaceProject() });
            workspaceProject.setDescription(description, null);
            aProject.open(null);
            final IErlModule x4 = model.findIncludeFromProject(aProject, xx, null,
                    IErlElementLocator.Scope.PROJECT_ONLY);
            final IErlModule x5 = model.findIncludeFromProject(aProject, xx, null,
                    IErlElementLocator.Scope.ALL_PROJECTS);
            final IErlModule x6 = model.findIncludeFromProject(aProject, xx, null,
                    IErlElementLocator.Scope.REFERENCED_PROJECTS);
            // then
            // the non-external should be preferred
            assertNotNull(x1);
            assertEquals(xxHrl, x1.getName());
            assertNotSame(referencedInclude, x1);
            assertEquals(referencedInclude, x2);
            assertNotNull(x3);
            assertEquals(xxHrl, x3.getName());
            assertNotSame(referencedInclude, x3);
            assertNotNull(x4);
            assertNotSame(referencedInclude, x4);
            assertEquals(referencedInclude, x5);
            assertEquals(referencedInclude, x6);
        } finally {
            if (externalIncludeFile != null && externalIncludeFile.exists()) {
                externalIncludeFile.delete();
            }
            ((ErlProject) aProject).setIncludeDirs(includeDirs);
            final IProjectDescription description = workspaceProject.getDescription();
            description.setReferencedProjects(referencedProjects);
            workspaceProject.setDescription(description, null);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

    }

    @Test
    public void getReferencedProjects() throws Exception {
        final IProject aProject = project.getWorkspaceProject();
        final IProjectDescription description = aProject.getDescription();
        final IProject[] refs = new IProject[] { project2.getWorkspaceProject() };
        try {
            description.setReferencedProjects(refs);
            aProject.setDescription(description, null);
            final List<IErlProject> expected = Lists.newArrayList(project2);
            assertEquals(expected, project.getReferencedProjects());
        } finally {
            description.setReferencedProjects(new IProject[0]);
            aProject.setDescription(description, null);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

      _workspaceProject_2.delete(true, null);
      HandleDelta _newDelta_7 = this.newDelta();
      HandleDelta _insertRemoved_2 = _newDelta_7.insertRemoved(erlProject2);
      ErlNotificationTest.assertEquality(_insertRemoved_2, this.listener.delta);
      IProject _workspaceProject_3 = erlProject1.getWorkspaceProject();
      final IProjectDescription description = _workspaceProject_3.getDescription();
      final String[] oldNatures = description.getNatureIds();
      description.setNatureIds(new String[] {});
      IProject _workspaceProject_4 = erlProject1.getWorkspaceProject();
      _workspaceProject_4.setDescription(description, null);
      HandleDelta _newDelta_8 = this.newDelta();
      HandleDelta _insertRemoved_3 = _newDelta_8.insertRemoved(erlProject1, HandleDelta.F_DESCRIPTION);
      ErlNotificationTest.assertEquality(_insertRemoved_3, this.listener.delta);
      description.setNatureIds(oldNatures);
      IProject _workspaceProject_5 = erlProject1.getWorkspaceProject();
      _workspaceProject_5.setDescription(description, null);
      HandleDelta _newDelta_9 = this.newDelta();
      int _bitwiseOr = (HandleDelta.F_DESCRIPTION | HandleDelta.F_CONTENT);
      HandleDelta _insertChanged_1 = _newDelta_9.insertChanged(erlProject1, _bitwiseOr);
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

    this.project = lproject;
  }
 
  public static void setErlangProjectBuilder(final IProject prj, final BuilderTool builder) throws CoreException {
    ErlangNature.unsetAllErlangBuilders(prj);
    final IProjectDescription description = prj.getDescription();
    final ICommand[] old = description.getBuildSpec();
    int _length = old.length;
    int _plus = (_length + 1);
    final ICommand[] specs = new ICommand[_plus];
    int _length_1 = old.length;
    System.arraycopy(old, 0, specs, 0, _length_1);
    final ICommand command = description.newCommand();
    String _id = builder.getId();
    command.setBuilderName(_id);
    int _length_2 = old.length;
    specs[_length_2] = command;
    description.setBuildSpec(specs);
    NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
    prj.setDescription(description, _nullProgressMonitor);
  }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

    NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
    prj.setDescription(description, _nullProgressMonitor);
  }
 
  public static void unsetAllErlangBuilders(final IProject prj) throws CoreException {
    final IProjectDescription description = prj.getDescription();
    final ICommand[] old = description.getBuildSpec();
    BuilderTool[] _values = BuilderTool.values();
    final Function1<BuilderTool, String> _function = new Function1<BuilderTool, String>() {
      public String apply(final BuilderTool it) {
        return it.getId();
      }
    };
    final List<String> allIds = ListExtensions.<BuilderTool, String>map(((List<BuilderTool>)Conversions.doWrapArray(_values)), _function);
    final ArrayList<ICommand> specs = CollectionLiterals.<ICommand>newArrayList();
    for (final ICommand cmd : old) {
      {
        final String oldBuilderName = cmd.getBuilderName();
        boolean _contains = allIds.contains(oldBuilderName);
        boolean _not = (!_contains);
        if (_not) {
          specs.add(cmd);
        }
      }
    }
    description.setBuildSpec(((ICommand[])Conversions.unwrapArray(specs, ICommand.class)));
    NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
    prj.setDescription(description, _nullProgressMonitor);
  }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

                _elvis = _nullProgressMonitor;
              }
              final IProgressMonitor monitor = _elvis;
              try {
                monitor.beginTask("", 4);
                final IProjectDescription description = workspace.newProjectDescription(ErlProject.this.name);
                description.setLocationURI(location);
                SubProgressMonitor _subProgressMonitor = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.create(description, _subProgressMonitor);
                SubProgressMonitor _subProgressMonitor_1 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.open(_subProgressMonitor_1);
                description.setNatureIds(new String[] { IErlProject.NATURE_ID });
                SubProgressMonitor _subProgressMonitor_2 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDescription(description, _subProgressMonitor_2);
                SubProgressMonitor _subProgressMonitor_3 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDefaultCharset("UTF-8", _subProgressMonitor_3);
              } finally {
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

    public void getModulesWithReferencedProjectsWithPrefix() throws Exception {
        // given
        // two erlang projects, the first references the second, second has
        // an erlang module
        final IProject project = project1.getWorkspaceProject();
        final IProjectDescription description = project.getDescription();
        final IProject[] refs = new IProject[] { project2.getWorkspaceProject() };
        description.setReferencedProjects(refs);
        project.setDescription(description, null);
        final IErlModule module = createModule(project2, "abc.erl",
                "-module(abc).\n-export(f/0)\nf() ->\n   {abc, ok}.\n");
        createModule(project1, "bbc.erl",
                "-module(bbc).\n-export(f/0)\nf() ->\n   {abc, ok}.\n");
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

   * @throws CoreException
   */
  private IProject createIProject(String name, java.net.URI hdfsURI) throws CoreException {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IProject project = workspace.getRoot().getProject(name);
    IProjectDescription pd = workspace.newProjectDescription(name);
    pd.setLocationURI(hdfsURI);
    project.create(pd, new NullProgressMonitor());
    project.open(new NullProgressMonitor());
    RepositoryProvider.map(project, HDFSTeamRepositoryProvider.ID);
    return project;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

   *          the project to add the nature
   *
   * @throws CoreException
   */
  public static void addNLPNature(IProject project) throws CoreException {
    IProjectDescription description = project.getDescription();
    String[] natures = description.getNatureIds();
    String[] newNatures = new String[natures.length + 1];
    System.arraycopy(natures, 0, newNatures, 0, natures.length);
    newNatures[natures.length] = NlpProject.ID;
    description.setNatureIds(newNatures);
    project.setDescription(description, null);
  }
View Full Code Here

Examples of org.eclipse.core.resources.IProjectDescription

   
    private static void createProject(IProject project, IPath location)
    {
        if (!project.exists())
        {
            IProjectDescription projectDescribtion = project.getWorkspace()
                    .newProjectDescription(project.getName());
           
            if (Platform.getLocation().equals(location))
            {
                location = null;
            }
           
            projectDescribtion.setLocation(location);
           
            try
            {
                project.create(projectDescribtion, null);
            }
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.